本文分析了Zend Framework配置文件application.ini用法。分享给大家供大家参考,具体如下:
最方便,常用的配置方式使用配置文件。配置文件的具体的相关设置选项如下:
php.ini的相关的配置选项,具体格式如下:
phpSettings.配置选项,例如
1
2
|
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
|
includePath相关配置
1
2
|
includePaths.library = APPLICATION_PATH "/../library"
includePaths.zend = APPLICATION_PATH "/../../Library"
|
引导类的位置
1
|
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
|
引导类名称
1
|
bootstrap.class = "Bootstrap"
|
默认命名空间
1
|
appnamespace = "Application"
|
自定义命名空间
1
|
autoloadernamespaces.app = "App_"
|
是否显示异常
1
|
resources.frontController.params.displayExceptions
|
资源的配置
如果应用使用模块化方式
1
2
|
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] =
|
自定义布局插件
1
|
resources.frontController.plugins.layout = Abc_Controller_Plugin_Layout
|
layout的文件目录
1
|
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"
|
默认的laytou
1
|
resources.layout.layout = default
|
自定义helper路径
复制代码 代码如下:
resources.view.helperPath.App_View_Helper = APPLICATION_PATH "/modules/default/views/helpers"
设置sessiong
1
|
session.lifetime = 3600
|
设置时间
1
2
3
|
datetime.timezone = "Asia/Shanghai"
datetime. format . date = "m-d-Y"
datetime. format .datetime = "m-d-Y H:i:s"
|
数据库的配置
1
2
3
4
5
6
7
8
|
db.adapter = "pdo_mysql"
db.prefix = "pre_"
db.host = "localhost"
db.port = "3306"
db.dbname = "db"
db.username = "root"
db.password = ""
db.charset = "utf8"
|
日志的配置
1
2
3
4
5
6
7
8
9
|
log.adapter = pdo_mysql
log.params.host = localhost
log.params.port = 3306
log.params.username = root
log.params.password =
log.params.dbname = test
log.params.charset = utf8
log.params.profiler.enabled = true
log.params.profiler.class = Zend_Db_Profiler_Firebug
|
希望本文所述对大家PHP程序设计有所帮助。