This article provides a detailed analysis of thinkphp's basic configuration convention. php. For more information, see
The code is as follows:
Return array (
/* Project settings */
'App _ debug' => false, // whether to enable the debugging mode
'App _ DOMAIN_DEPLOY '=> false, // whether to deploy the project with an independent domain name
'App _ SUB_DOMAIN_DEPLOY '=> false, // whether to enable the subdomain name
'App _ PLUGIN_ON '=> false, // whether to enable the plug-in mechanism
'App _ FILE_CASE '=> false, // check whether the file is case-sensitive for Windows platforms
'App _ GROUP_DEPR '=>'. ', // delimiter between group modules
'App _ GROUP_LIST '=> '', // project grouping settings. multiple groups are separated by commas (,), for example, 'Home, admin'
'App _ AUTOLOAD_REG '=> false, // whether to enable SPL_AUTOLOAD_REGISTER
'App _ AUTOLOAD_PATH '=> 'Think. Util.', // _ autoLoad mechanism for additional detection path settings, pay attention to the search order
'App _ CONFIG_LIST '=> array ('taglibs', 'Routes', 'tags', 'htmls', 'modules', 'actions '), // the configuration list to be loaded for the project. the default options include taglibs (tag library definition), routes (Route definition), tags (tag definition), and htmls static cache definition, modules and actions)
/* Cookie settings */
'Cookie _ EXPIRE '=> 3600, // Coodie validity period
'Cookie _ DOMAIN '=> '', // valid cookie domain name
'Cookie _ path' => '/', // COOKIE PATH
'Cookie _ prefix' => '', // avoid conflict with the COOKIE PREFIX
/* Default setting */
'Default _ app' => '@', // DEFAULT project name, @ indicates the current project
'Default _ group' => 'home', // DEFAULT GROUP
'Default _ module' => 'index', // default module name
'Default _ action' => 'index', // DEFAULT operation name
'Default _ charset' => 'utf-8', // DEFAULT output encoding
'Default _ TIMEZONE '=> 'prc', // DEFAULT time zone
'Default _ AJAX_RETURN '=> 'json', // default ajax data return format, optional json xml...
'Default _ THEME '=> 'default', // DEFAULT Template topic name
'Default _ lang' => 'zh-cn', // DEFAULT Language
/* Database settings */
'Db _ type' => 'mysql', // Database TYPE
'Db _ host' => 'localhost', // server address
'Db _ name' => '', // database NAME
'Db _ user' => 'root', // USER name
'Db _ pwd' => '', // password
'Db _ port' => 3306, // PORT
'Db _ prefix' => 'think _ ', // database table PREFIX
'Db _ SUFFIX '=> '', // database table SUFFIX
'Db _ FIELDTYPE_CHECK '=> false, // whether to check the field type
'Db _ FIELDS_CACHE '=> true, // enable field caching
'Db _ charset' => 'utf8', // The database encoding uses utf8 by default.
'Db _ DEPLOY_TYPE '=> 0, // Database deployment method: 0 centralized (single server), 1 distributed (master/slave server)
'Db _ RW_SEPARATE '=> false, // whether the master-slave mode is valid for database read/write splitting
/* Data cache settings */
'Data _ CACHE_TIME '=>-1, // DATA cache validity period
'Data _ CACHE_COMPRESS '=> false, // whether the DATA cache compresses the cache
'Data _ CACHE_CHECK '=> false, // whether the DATA cache verifies the cache
'Data _ CACHE_TYPE '=> 'File', // DATA cache type, supported: File | Db | Apc | Memcache | Shmop | Sqlite | Xcache | Apachenote | Eaccelerator
'Data _ CACHE_PATH '=> TEMP_PATH, // cache path setting (only valid for File cache)
'Data _ cache_subdir' => false, // use sub-directory cache (automatically create sub-directories based on the hash of the cache ID)
'Data _ PATH_LEVEL '=> 1, // sub-directory cache level
/* Error setting */
'Error _ message' => 'an ERROR occurred temporarily on the page you browsed! Please try again later ~ ', // Error display information, not in debug mode
'Error _ page' => '', // ERROR targeting PAGE
/* Static cache settings */
'HTML _ CACHE_ON '=> false, // The static cache is disabled by default.
'HTML _ CACHE_TIME '=> 60, // static cache validity period
'HTML _ READ_TYPE '=> 0, // static cache read method 0 readfile 1 redirect
'HTML _ FILE_SUFFIX '=> '.shtml', // Default static file suffix
/* Language Settings */
'Lang _ SWITCH_ON '=> false, // The multi-language package function is disabled by default.
'Lang _ AUTO_DETECT '=> true, // The Automatic detection language is valid after the multi-language function is enabled.
/* Log settings */
'Log _ EXCEPTION_RECORD '=> true, // whether to LOG exception information (enabled by default)
'Log _ RECORD '=> false, // no logs are recorded by default.
'Log _ FILE_SIZE '=> 2097152, // LOG file size limit
'Log _ RECORD_LEVEL '=> array ('error', 'Alert', 'crit', 'err'), // The LOG level that can be recorded
/* Paging settings */
'Page _ rollpage' => 5, // Number of pages displayed on the PAGE
'Page _ LISTROWS '=> 20, // number of records displayed per PAGE
/* SESSION settings */
'Session _ AUTO_START '=> true, // whether to enable the SESSION automatically
// Built-in available SESSION parameters
// 'Session _ name' => '', // SESSION NAME
// 'Session _ path' => '', // SESSION storage PATH
// 'Session _ callback' => '', // CALLBACK function for SESSION object deserialization
/* Set the running time */
'Show _ RUN_TIME '=> false, // Run time display
'Show _ adv_time' => false, // displays the detailed running time.
'Show _ DB_TIMES '=> false, // displays the number of database queries and writes.
'Show _ CACHE_TIMES '=> false, // displays the number of cache operations
'Show _ USE_MEM '=> false, // display memory overhead
'Show _ PAGE_TRACE '=> false, // The Trace information of the displayed page is defined by the Trace file and assigned values for Action operations.
'Show _ ERROR_MSG '=> true, // The error message is displayed.
/* Template engine settings */
'Tmpl _ ENGINE_TYPE '=> 'think', // the default template engine. the following settings are only valid for the Think template engine.
'Tmpl _ DETECT_THEME '=> false, // automatically detects the template topic
'Tmpl _ TEMPLATE_SUFFIX '=>'. tpl ', // Default Template File suffix
'Tmpl _ CONTENT_TYPE '=> 'text/html', // default template output type
'Tmpl _ CACHFILE_SUFFIX '=>'. php', // Default Template cache suffix
'Tmpl _ DENY_FUNC_LIST '=> 'echo, exit', // The template engine disables the function.
'Tmpl _ PARSE_STRING '=> '', // The string to be automatically replaced by the template engine, which must be an array.
'Tmpl _ L_DELIM '=>' {', // template engine common tag start tag
'Tmpl _ R_DELIM '=>'} ', // template engine common tag end tag
'Tmpl _ VAR_IDENTIFY '=> 'array', // template variable identification. If this parameter is left blank, it is automatically judged. if the parameter is 'obj ', it indicates the object.
'Tmpl _ STRIP_SPACE '=> false, // whether to remove html spaces and line breaks in the template file
'Tmpl _ CACHE_ON '=> true, // whether to enable template compilation cache. if it is set to false, the template will be re-compiled every time.
'Tmpl _ CACHE_TIME '=>-1, // The template cache validity period-1 is permanent (in numbers, unit: Seconds)
'Tmpl _ ACTION_ERROR '=> 'public: success', // default error jumps to the corresponding template file
'Tmpl _ ACTION_SUCCESS '=> 'public: success', // The template file is successfully redirected by default.
'Tmpl _ TRACE_FILE '=> THINK_PATH.'/Tpl/PageTrace. tpl. php', // template file of page Trace
'Tmpl _ EXCEPTION_FILE '=> THINK_PATH.'/Tpl/ThinkException. tpl. php', // template file of the exception page
'Tmpl _ file_depr' => '/', // delimiter between MODULE_NAME and ACTION_NAME in the template file, which is only valid for project group deployment.
// Think template engine tag library settings
'Taglib _ begin' => '<', // tag library label start marking
'Taglib _ end' => ', // tag END tag of the tag library
'Taglib _ load' => true, // whether to use a tag library other than the built-in tag library. it is automatically detected by default.
'Taglib _ BUILD_IN '=> 'cx', // The name of the built-in tag library (tag names are separated by commas (,).
'Taglib _ PRE_LOAD '=> '', // The Tag library to be loaded (the name of the tag library must be specified), separated by commas
'Tag _ NESTED_LEVEL '=> 3, // TAG nesting level
'Tag _ EXTEND_PARSE '=> '', // specify the name of the function that extends the definition and resolves the common TAG.
/* Form token verification */
'Token _ on' => true, // enable TOKEN verification
'Token _ name' => '_ hash _', // NAME of the hidden field in the form for TOKEN verification
'Token _ type' => 'md5', // TOKEN verification hash rule
/* URL setting */
'URL _ CASE_INSENSITIVE '=> false, // whether the URL address is case insensitive
'URL _ ROUTER_ON '=> false, // whether to enable URL routing
'URL _ ROUTE_RULES '=> array (), // default routing rule. note: The group configuration cannot be replaced.
// 'URL _ DISPATCH_ON '=> true, // whether to enable Dispatcher.
'URL _ model' => 1, // URL access mode. optional parameters: 0, 1, 2, and 3, which represent the following four modes:
// 0 (normal mode); 1 (PATHINFO mode); 2 (REWRITE mode); 3 (compatible mode) PATHINFO mode by default, providing the best user experience and SEO support
'URL _ PATHINFO_MODEL '=> 2, // PATHINFO mode. numbers 1, 2, and 3 represent the following three modes:
// 1 Normal mode (parameters have no order, for example,/m/module/a/action/id/1 );
// 2 intelligent mode (the default mode used by the system, which can automatically identify the module and operation/module/action/id/1 // or/module, action, id, 1 /...);
// 3 compatibility mode (pass PATHINFO to dispather through a GET variable. the default value is s index. php? S =/module/action/id/1)
'URL _ PATHINFO_DEPR '=>'/', // The delimiter between parameters in PATHINFO mode.
'URL _ HTML_SUFFIX '=> '', // URL pseudo-static suffix settings
// 'URL _ AUTO_REDIRECT '=> true, // automatic redirection to a standard URL does not take effect
/* Set the system variable name */
'Var _ group' => 'G', // Get the variable by default GROUP
'Var _ module' => 'm', // The default MODULE obtains the variable.
'Var _ action' => 'A', // Get the variable by default
'Var _ ROUTER '=> 'R', // Obtain the variable from the default route
'Var _ page' => 'P', // Default paging jump variable
'Var _ template' => 'T', // Default TEMPLATE switch variable
'Var _ language' => 'L', // Default LANGUAGE switch variable
'Var _ AJAX_SUBMIT '=> 'Ajax', // Default ajax submission variable
'Var _ pathinfo' =>'s ', // Obtain the variable in the PATHINFO compatibility mode, for example? The parameters after s =/module/action/id/1 depend on URL_PATHINFO_MODEL and URL_PATHINFO_DEPR.
);