ThinkPHP Convention configuration file details

Source: Internet
Author: User
This article mainly introduces the ThinkPHP Convention configuration file, which is helpful for further understanding of ThinkPHP attributes configuration. For more information, see

This article mainly introduces the ThinkPHP Convention configuration file, which is helpful for further understanding of ThinkPHP attributes configuration. For more information, see

The ThinkPHP system has a built-in convention configuration file (Conf \ convention. php located under the system directory), which defaults to common parameters according to most usage. This article provides a detailed description of the Convention configuration file for your reference:

<? Php/** + ------------------------------------------------------------------------------ * ThinkPHP Convention configuration file * do not modify this file. to overwrite the Convention configuration value ,, you can set configuration items that do not match the conventions in the project configuration file * the configuration name is case-insensitive, the system converts all configuration parameters to lowercase letters. * all configuration parameters can be changed dynamically before they take effect. + variable * @ category Think * @ package Common * @ version $ Id $ + variable */if (! Defined ('Think _ path') exit (); return array (/* Project setting */'app _ debug' => false, // whether to enable the debug mode 'app _ DOMAIN_DEPLOY '=> false, // whether to deploy the project 'app _ PLUGIN_ON' with an independent domain name => false, // whether to enable the plug-in mechanism 'app _ FILE_CASE '=> false, // whether to check whether the file case is valid for Windows 'app _ GROUP_DEPR' => '. ', // delimiter between module groups: 'app _ GROUP_LIST' => ''. // project group 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 extra detection path settings. Note the search sequence 'app _ CONFIG_LIST' => array ('taglibs', 'routes ', 'tags ', & apos; htmls', & apos; modules & apos;, & apos; actions & apos;), // The configuration list to be loaded for the project. Default options include taglibs (TAG library definition), routes (route definition ), tags (TAG definition), (htmls) Static cache definition, modules (extension module), actions (extension operation)/* Cookie setting */'cookie _ EXPIRE '=> 3600, // Coodie validity period: 'cookie _ DOMAIN '=> '', // COOKIE valid DOMAIN name 'cookie _ path' => '/', // Cookie Path 'cookie _ prefix' => '', // avoid cookie prefix conflict/* DEFAULT setting */'default _ AP P '=>' @ ', // 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 ', // username 'db _ pwd' => '', // password 'db _ port' => 3306, // PORT 'db _ prefix' => 'think _', // database table prefix 'db _ SUFFIX '=> '', // database table SUFFIX 'db _ FIELDTYPE_CHECK' => false, // check whether the field type is 'db _ FIELDS_CACHE '=> true, // enable the field cache 'db _ CHARSET' => 'utf8 ', // The database encoding uses utf8 'db _ DEPLOY_TYPE '=> 0 by default. // The database deployment mode is: 0 centralized (Single Server) and 1 distributed (Master/Slave server) 'db _ RW_SEPARATE '=> false, // whether the read/write operations of the database are separated from the master-slave mode and valid/* Data Delay Storage 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', // The DATA cache type, supported: File | Db | Apc | Memcache | Shmop | Sqlite | Xcache | Apachenote | Eaccelerator 'data _ CACHE_PATH '=> TEMP_PATH, // cache path setting (effective only for File caching) 'Data _ cache_subdir' => false, // use subdirectory cache (automatically create subdirectories Based on the hash of the cache ID) 'Data _ PATH_LEVEL '=> 1, // subdirectory cache level/* ERROR setting */'error _ MESSAGE '=>' An error occurred temporarily on the page you browsed! Please try again later ~ ', // ERROR display information. 'error _ page' => ''is valid in non-debugging mode '', // error targeting page/* Static cache settings */'html _ CACHE_ON '=> false, // disable static cache by default 'html _ CACHE_TIME' => 60, // static cache validity period: 'html _ READ_TYPE '=> 0, // static cache read mode: 0 readfile 1 redirect 'html _ FILE_SUFFIX' => '.shtml ', // default static file suffix/* language setting */'lang _ SWITCH_ON '=> false, // by default, the multi-language Package function 'lang _ AUTO_DETECT' => true, // The Automatic Detection language is valid after the multi-language function is enabled/* LOG settings */'Log _ record' => false, // logs are not logged 'Log _ FILE_SIZE '=> 2097152 by default, // log File Size Limit: 'Log _ RECORD_LEVEL '=> array ('error', 'alert', 'crit', 'err '), // log level that can be recorded/* PAGE setting */'page _ rollpage' => 5, // PAGE display PAGE number 'page _ LISTROWS '=> 20, // display the number of records per page/* SESSION settings */'session _ AUTO_START '=> true, // whether to automatically enable the Session // built-in SESSION class available parameters // 'session _ name' => '', // Session name // 'session _ path' => '', // SESSION storage PATH // 'session _ callback' => '', // callback function for Session Object deserialization/* runtime setting */'show _ RUN_TIME '=> false, // runtime display' SHOW_ADV_TIME '=> false, // display the detailed running time 'show _ DB_TIMES' => false, // display the number of database queries and writes 'show _ CACHE_TIMES '=> false, // display the number of cache operations 'show _ USE_MEM '=> false, // display the memory overhead 'show _ PAGE_TRACE' => false, // display page Trace information. the Trace file definition and Action operation assign 'show _ ERROR_MSG '=> true, // Display error message/* template engine settings */'tmpl _ ENGINE_TYPE '=> 'think ', // 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' => '.html ',/ /Default template file suffix 'tmpl _ CACHFILE_SUFFIX '=> '. php ', // default template cache suffix 'tmpl _ DENY_FUNC_LIST' => 'echo, exit ', // template engine disable function 'tmpl _ PARSE_STRING' => '', // The string to be automatically replaced by the template engine, which must be an array. 'Tmpl _ L_DELIM '=>' {', // The General tag of the template engine starts to mark 'tmpl _ R_DELIM' => '}', // tag 'tmpl _ VAR_IDENTIFY '=> 'array' at the end of a common tag in the template engine. // template variable identification. If this parameter is set to 'obj ', the object 'tmpl _ STRIP_SPACE' is equal to or greater than 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 'tmpl _ CACHE_TIME '=>-1 will be re-compiled every time. // The template cache validity period-1 is permanent (in number value, unit: seconds) 'tmpl _ ACTION_ERROR '=> 'public: success', // default error jump to the corresponding template file 'tmpl _ ACTION_SUCCESS '=> 'public: success ', // The template file 'tmpl _ TRACE_FILE '=> THINK_PATH is successfully redirected by default. '/Tpl/PageTrace. tpl. php ', // template file 'tmpl _ EXCEPTION_FILE' for page Trace => THINK _ PATH. '/Tpl/ThinkException. tpl. php ', // The template file 'tmpl _ FILE_DEPR' => '/' on the abnormal page, // The delimiter between MODULE_NAME and ACTION_NAME in the template file, only effective for Project Group deployment // tag library settings of the Think template engine 'taglib _ begin' => '<', // tag library tag start tag 'taglib _ end' => ', // tag library tag END tag 'taglib _ load' => true, // whether to use a tag library other than the built-in tag library. The default value is 'taglib _ BUILD_IN '=> 'cx ', // The name of the built-in tag Library (you do not need to specify the name of the tag library for the tag to use). Separate 'taglib _ PRE_LOAD '=> ''with commas '', // The TAG library to be loaded (the name of the TAG library must be specified), multiple TAG _ NESTED_LEVEL separated by commas (,) => 3, // TAG nesting level 'T AG_EXTEND_PARSE '=> '', // specify the name of the function for defining and parsing General labels. /* 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 _ DISPATCH_ON '=> true, // whether to enable Dispatcher 'url _ model' => 1, // URL access mode, optional values: 0, 1, 2, and 3, indicating the following four modes: // 0 (normal mode), 1 (PATHINFO mode), and 2 (REWRITE mode ); 3 (compatible mode) valid when URL_DISPATCH_ON is enabled. The default mode is PATHINFO. For the best user experience and SEO support 'url _ PATHINFO_MODEL '=> 2, // PATHINFO mode, use numbers 1, 2, 3 represent the following three modes: // 1 normal mode (the parameters are not ordered, for example,/m/module/a/action/id/1); // 2 intelligent mode (the default mode used by the system, it can automatically identify the module and operation/module/action/id/1/or/module, action, id, 1 /...); // 3 compatibility mode (PATHINFO is passed to dispather through a GET variable. The default value is s index. php? S =/module/action/id/1) 'url _ PATHINFO_DEPR '=>'/', // PATHINFO mode, the delimiter between parameters: 'url _ HTML_SUFFIX '=> '', // URL pseudo-static suffix setting/* system variable name setting */'var _ group' => 'G ', // The default group obtains the variable 'var _ module' => 'M'. // The default MODULE obtains the variable 'var _ action' => 'A ', // The default operation variable 'var _ ROUTER '=> 'R', // The default route variable 'var _ page' => 'P ', // The default paging jump variable 'var _ template' => 'T', // The default TEMPLATE switch variable 'var _ template' => 'l ', // default language switch variable 'var _ AJAX_SUBMIT '=> 'ajax', // default ajax submit variable 'var _ PATHINFO '=>' S', // The PATHINFO compatibility mode to obtain variables such? The parameters after s =/module/action/id/1 depend on URL_PATHINFO_MODEL and URL_PATHINFO_DEPR );

In addition, due to the changes in the new system architecture, some common configuration parameters have been separated and included in the property parameters of the behavior extension. For more information, see the manual.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.