Zend Framework教程之配置文件application.ini解析_php实例

WBOY
Release: 2016-06-07 17:08:55
Original
903 people have browsed it

本文分析了Zend Framework配置文件application.ini用法。分享给大家供大家参考,具体如下:

最方便,常用的配置方式使用配置文件。配置文件的具体的相关设置选项如下:

php.ini的相关的配置选项,具体格式如下:

phpSettings.配置选项,例如

phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

Copy after login

includePath相关配置

includePaths.library = APPLICATION_PATH "/../library"
includePaths.zend = APPLICATION_PATH "/../../Library"

Copy after login

引导类的位置

bootstrap.path = APPLICATION_PATH "/Bootstrap.php"

Copy after login

引导类名称

bootstrap.class = "Bootstrap"

Copy after login

默认命名空间

appnamespace = "Application"

Copy after login

自定义命名空间

autoloadernamespaces.app = "App_" 

Copy after login

是否显示异常

resources.frontController.params.displayExceptions 

Copy after login

资源的配置

如果应用使用模块化方式

resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] = 

Copy after login

自定义布局插件

resources.frontController.plugins.layout = Abc_Controller_Plugin_Layout

Copy after login

layout的文件目录

resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"

Copy after login

默认的laytou

resources.layout.layout = default

Copy after login

自定义helper路径

复制代码 代码如下:
resources.view.helperPath.App_View_Helper = APPLICATION_PATH "/modules/default/views/helpers"

设置sessiong

session.lifetime = 3600

Copy after login

设置时间

datetime.timezone = "Asia/Shanghai"
datetime.format.date = "m-d-Y"
datetime.format.datetime = "m-d-Y H:i:s"
Copy after login

数据库的配置

db.adapter = "pdo_mysql"
db.prefix = "pre_"
db.host = "localhost"
db.port = "3306"
db.dbname = "db"
db.username = "root"
db.password = ""
db.charset = "utf8"

Copy after login

日志的配置

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

Copy after login

更多关于zend相关内容感兴趣的读者可查看本站专题:《Zend FrameWork框架入门教程》、《php优秀开发框架总结》、《Yii框架入门及常用技巧总结》、《ThinkPHP入门教程》、《php面向对象程序设计入门教程》、《php+mysql数据库操作入门教程》及《php常见数据库操作技巧汇总》

希望本文所述对大家PHP程序设计有所帮助。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!