For the product running environment, three stagingtestingdevelopment types are defined in application. ini: online status test status development status.
; Project configuration information
Project configuration information to the configuration method. take the Apache server mode as an example:
; Can be defined in the httpd. conf virtual host configuration section or in the project. htaccss file.
The specific definition method is to add a line of command: SetEnv APPLICATION_ENV product runtime environment
For example, the development environment: SetEnv APPLICATION_ENV development
The. htacess file automatically generated when you create a project using the method used in the previous article is as follows:
; 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]
For the product running environment, three staging testing development statuses are defined in application. ini: online status test status development status.
[Production]
The configuration of the runtime environment in phpsettings php actually calls the php ini_set () function.
PhpSettings. display_startup_errors = 0
PhpSettings. display_errors = 0
PhpSettings. log_errors = 1
Phpsetask. log_errors_max_len = 1024
PhpSettings. ignore_repeated_errors = 1
PhpSettings. date. timezone = "Asia/Shanghai"
PhpSettings. error_log = APPLICATION_PATH "/../lib/error. log"
Bootstrap boot file configuration
Bootstrap. path = APPLICATION_PATH "/Bootstrap. php"
; Bootstrap. class = "Bootstrap" can be omitted. the default value is Bootstrap.
; Autoloadernamespaces register the automatically loaded namespace
Autoloadernamespaces.0 = "DB _"
Autoloadernamespaces.1 = "Help _"
Front-end controller configuration
Resources. frontController. params. displayExceptions = 0
Resources. frontController. moduleDirectory = APPLICATION_PATH "/modules"
Resources. frontController. moduleControllerDirectoryName = "controllers"
Resources. frontController. defaultModule = "default"
; Layout configuration
Resources. layout. layout = "default"
Resources. layout. layoutPath = APPLICATION_PATH "/layouts/default"
View configuration, which is configured separately based on the module (this part should be initialized in 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"
; Database configuration (this part requires initial database configuration in 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 ″
; Website launch environment configuration
[Staging: production]
PhpSettings. display_startup_errors = 0
PhpSettings. display_errors = 0
; Test environment configuration
[Testing: production]
PhpSettings. display_startup_errors = 1
PhpSettings. display_errors = 1
Development Environment configuration
[Development: production]
PhpSettings. display_startup_errors = 1
PhpSettings. display_errors = 1
Resources. frontController. params. displayExceptions = 1