首頁 >後端開發 >php教程 >php之ZendFramewor篇(1)application.ini配置说明

php之ZendFramewor篇(1)application.ini配置说明

WBOY
WBOY原創
2016-06-13 10:38:30931瀏覽

php之ZendFramewor篇(一)application.ini配置说明

;项目配置信息;项目配置信息到配置方法. 以 Apache 服务器模式为例:;可以在 httpd.conf 虚拟主机配置段或者项目 .htaccss文件里定义.;具体定义方法是添加一行指令: SetEnv APPLICATION_ENV 产品运行环境;比如开发环境: SetEnv APPLICATION_ENV development;在使用上一篇文章中用到的方法新建项目时自动生成的.htacess文件内容如下;SetEnv APPLICATION_ENV development;RewriteEngine On;RewriteCond %{REQUEST_FILENAME} -s [OR];RewriteCond %{REQUEST_FILENAME} -l [OR];RewriteCond %{REQUEST_FILENAME} -d;RewriteRule ^.*$ – [NC,L];RewriteRule ^.*$ index.php [NC,L];关于产品运行环境,application.ini中定义了三种 staging testing development 即 上线状态 测试状态 开发状态[production];phpsettings php中运行时环境的配置,实际上调用的是php的ini_set() 函数phpSettings.display_startup_errors = 0phpSettings.display_errors = 0phpSettings.log_errors = 1phpSettings.log_errors_max_len = 1024phpSettings.ignore_repeated_errors = 1phpSettings.date.timezone = “Asia/Shanghai”phpSettings.error_log = APPLICATION_PATH “/../lib/error/error.log”;bootstrap 引导文件配置bootstrap.path = APPLICATION_PATH “/Bootstrap.php”;bootstrap.class = “Bootstrap” 此项可省略,应为默认的是Bootstrap;autoloadernamespaces 注册自动载入的命名空间autoloadernamespaces.0 = “DB_”autoloadernamespaces.1 = “Help_”;前端控制器配置resources.frontController.params.displayExceptions = 0resources.frontController.moduleDirectory = APPLICATION_PATH “/modules”resources.frontController.moduleControllerDirectoryName = “controllers”resources.frontController.defaultModule = “default”;布局配置resources.layout.layout = “default”resources.layout.layoutPath = APPLICATION_PATH “/layouts/default”;视图部分配置, 依据模块分开配置 (这部分要在Bootstrap中初始化)resources.view.params.default.basePath = APPLICATION_PATH “/modules/default/views/”resources.view.params.default.layout = “default”resources.view.params.default.layoutPath = APPLICATION_PATH “/layouts/default”resources.view.params.admin.basePath = APPLICATION_PATH “/modules/admin/views/”resources.view.params.admin.layout = “admin”resources.view.params.admin.layoutPath = APPLICATION_PATH “/layouts/admin”;数据库配置(这部分要在Bootstrap中初始数据库配置)resources.db.adapter = “mysqli”resources.db.params.host = “localhost”resources.db.params.username = “root”resources.db.params.password = “123456″resources.db.params.dbname = “dxk”resources.db.params.charset = “utf8″;网站上线环境配置[staging : production]phpSettings.display_startup_errors = 0phpSettings.display_errors = 0;测试环境配置[testing : production]phpSettings.display_startup_errors = 1phpSettings.display_errors = 1;开发环境配置[development : production]phpSettings.display_startup_errors = 1phpSettings.display_errors = 1resources.frontController.params.displayExceptions = 1

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn