ThinkPHP convention configuration file details

Source: Internet
Author: User
This article mainly introduces the ThinkPHP convention configuration file. it is helpful for you to learn more about ThinkPHP attributes. For more information, see ThinkPHP.

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' => 'thi Nk. 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 */'defa ULT_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 ', // 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 database read/write is separated from the master/slave mode./* 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', // 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 settings */'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, // The LOG file size limit is '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, // Run Row Time: 'show _ adv_time' => false, // displays 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 the page Trace information. it is defined by the Trace file and assigned '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' => '. ht Ml ', // 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 '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 _ 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 value is PATHINFO. Mode, providing the best user experience and SEO support for 'URL _ PATHINFO_MODEL '=> 2, // PATHINFO mode, using 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 _ P ATHINFO '=>'s', // Obtain the variable in PATHINFO compatibility mode, for example? 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.