Home >Backend Development >PHP Tutorial >Thinkphp common system configuration list
Thinkphp is currently one of the most mainstream PHP lightweight frameworks. As a fully functional PHP framework, it has many built-in configurations. By modifying these systems The settings can easily modify some contents of thinkphp. This article summarizes some commonly used system settings for readers' reference.
# 'APP_DEBUG' => false, // Whether to enable debugging mode 'APP_DOMAIN_DEPLOY' => false, // Whether to use an independent domain name to deploy the project<br> 'APP_PLUGIN_ON' => false, // Whether to enable the plug-in mechanism<br> 'APP_FILE_CASE' => false, // Whether to check the case of the file Yes Valid on Windows platform<br> 'APP_GROUP_DEPR' => '.', // Separator between module groups<br> 'APP_GROUP_LIST' => '', // Project group setting, used between multiple groups Comma separated, for example, 'Home,Admin'<br> 'APP_AUTOLOAD_REG' => false, // Whether to enable SPL_AUTOLOAD_REGISTER<br> 'APP_AUTOLOAD_PATH' => 'Think.Util.', // __autoLoad Mechanism additional detection path settings , pay attention to the search order<br> 'APP_CONFIG_LIST' => array('taglibs','routes','tags','htmls','modules','actions'),//<br>
Extra items The configuration list that needs to be loaded, the default includes: taglibs (tag library definition), routes (route definition), tags (tag definition), (htmls) static cache definition, modules (extension module), actions (extension operation) /* Cookie Settings */
'COOKIE_EXPIRE' => 3600, // Coodie validity period<br> 'COOKIE_DOMAIN' => '', // Cookie valid domain name<br> 'COOKIE_PATH' = > '/', // Cookie path<br> 'COOKIE_PREFIX' => '', // Cookie prefix to avoid conflicts
/* Default settings */<br> 'DEFAULT_APP' => '@', //Default item Name, @ represents the current project<br> 'DEFAULT_GROUP' . 'index', //Default operation name<br> 'DEFAULT_CHARSET' => 'utf-8', //Default output encoding<br> 'DEFAULT_TIMEZONE' => 'PRC', //Default time zone<br> ' DEFAULT_AJAX_RETURN' => 'JSON', //Default AJAX data return format, optional JSON XML...<br> 'DEFAULT_THEME' => 'default', //Default template theme name<br> 'DEFAULT_LANG' = > 'zh-cn', //Default Language<br><br>/* Database Settings */
'DB_TYPE' 'mysql ', 'mysql ' . 'localhost', // Server address 'DB_NAME' => '', 'DB_USER' // User name<br> 'DB_ PWD' => '', // password <br> 'db_port' = & gt; 3306, port <br> 'db_prefix' = & gt; 'think_', // database table prefix <br> 'db_suffix' = & gt; '', '', '', // Database table suffix<br> 'DB_FIELDTYPE_CHECK' => false, // Whether to perform field type checking<br> 'DB_FIELDS_CACHE' => true, // Enable field caching<br> 'DB_CHARSET' => 'utf8 ', //The database encoding defaults to utf8<br>'DB_DEPLOY_TYPE' => 0, // Database deployment mode: 0 centralized (single server), 1 distributed (master-slave server)<br> 'DB_RW_SEPARATE' => false, // Whether database reading and writing are separated master-slave The formula is valid
<br> 'DATA_CACHE_TIME' => -1, // Data cache validity period<br> 'DATA_CACHE_COMPRESS' => false, // Whether the data cache is compressed or not <br> 'DATA_CACHE_CHECK' = > false, // Whether the data cache is verified to be cached<br> 'DATA_CACHE_TYPE' => 'File', // Data cache type
'DATA_CACHE_PATH' => TEMP_PATH, // Cache path setting (only valid for File mode caching) <br> 'DATA_CACHE_SUBDIR' => false, // Use subdirectory cache (automatically based on cache identification) Hash to create a subdirectory)<br> 'DATA_PATH_LEVEL' => 1, // Subdirectory cache level<br><br> /* Error settings */<br> 'ERROR_MESSAGE' => 'The page you are browsing is temporarily An error has occurred! Please try again later~', //Error display information, valid in non-debug mode<br> 'ERROR_PAGE' => '', // Error directed page<br><br> /* Static cache settings */<br> 'HTML_CACHE_ON' => false, // Turn off static cache by default <br> 'HTML_CACHE_TIME' => 60, // Static cache validity period <br> 'HTML_READ_TYPE' => 0, // Static cache reading method 0 readfile 1 redirect<br> 'HTML_FILE_SUFFIX' => '.shtml',//Default static file suffix<br><br> /* Language settings */<br> 'LANG_SWITCH_ON' => false, //Default closed Multi-language package function<br> 'LANG_AUTO_DETECT' => true, // Automatic detection of language is valid after turning on the multi-language function<br><br> /* Log settings */<br> 'LOG_RECORD' => false, // No logging by default <br> 'LOG_FILE_SIZE' => 2097152, // Log file size limit <br> 'LOG_RECORD_LEVEL' => array('EMERG','ALERT','CRIT','ERR') , // Allowed log level <br><br> /* Paging settings */<br> 'PAGE_ROLLPAGE' => 5, // Number of pages displayed in paging<br> 'PAGE_LISTROWS' => 20, // Paging displays the number of records per page<br><br> /* SESSION settings */<br> 'SESSION_AUTO_START' => true, // Whether to automatically open the Session<br> // Available parameters of the built-in SESSION class<br> // 'SESSION_NAME' => '', // Session name<br> //'SESSION_PATH' => '', // Session save path<br> //'SESSION_CALLBACK' => '', //Session object Callback function during deserialization<br><br> /* Run time setting */<br> 'SHOW_RUN_TIME' => false, // Run time display<br> 'SHOW_ADV_TIME' => false, // Display Detailed running time<br> 'SHOW_DB_TIMES' => false, // Display the number of database queries and writes<br> 'SHOW_CACHE_TIMES' => false, // Display the number of cache operations<br> 'SHOW_USE_MEM' => false, //Display memory overhead<br>'SHOW_PAGE_TRACE' => false, // Display page Trace information is defined by Trace file and assigned by Action operation<br> 'SHOW_ERROR_MSG' => true, // Display error message
/* Template engine settings * /<br> 'TMPL_ENGINE_TYPE' => 'Think', // Default template engine The following settings are only valid for using the Think template engine<br> 'TMPL_DETECT_THEME' => false, // Automatically detect template themes<br> ' TMPL_TEMPLATE_SUFFIX' => '.html', // Default template file suffix<br> 'TMPL_CACHFILE_SUFFIX' => '.php', // Default template cache suffix<br> 'TMPL_DENY_FUNC_LIST' => 'echo,exit' , // Template engine disable function<br> 'TMPL_PARSE_STRING' => '', // The string that the template engine wants to automatically replace must be in the form of an array. <br> 'TMPL_L_DELIM' => '{', // Template engine ordinary tag start tag<br> 'TMPL_R_DELIM' => '}', // Template engine ordinary tag end tag<br> 'TMPL_VAR_IDENTIFY' =& gt ; 'array', // Template variable identification. Leave it blank to automatically judge. If the parameter is 'obj', it means the object<br> 'TMPL_STRIP_SPACE' => false, // Whether to remove html spaces and line breaks in the template file<br> 'TMPL_CACHE_ON' => true, // Whether Turn on the template compilation cache. If set to false, it will be recompiled every time. <br> 'TMPL_CACHE_TIME' => -1, ' TMPL_ACTION_ERROR' => 'Public:success', // The default error jumps to the corresponding template file<br> 'TMPL_ACTION_SUCCESS' => 'Public:success', // The default success jumps to the corresponding template file<br> ' TMPL_TRACE_FILE' => THINK_PATH.'/Tpl/PageTrace.tpl.php', // Page Trace template file<br> 'TMPL_EXCEPTION_FILE' => THINK_PATH.'/Tpl/ThinkException.tpl.php',// Exception The template file of the page<br> 'TMPL_FILE_DEPR'=>'/', //The separator between the template file MODULE_NAME and ACTION_NAME is only valid for project group deployment<br> //Think template engine tag library related settings<br> 'TAGLIB_BEGIN' => '<', // Tag library tag start tag<br/> 'TAGLIB_END' => '>', // Tag library tag end tag<br> 'TAGLIB_LOAD' => ; true, // Whether to use other tag libraries other than the built-in tag library, automatically detected by default <br> 'TAGLIB_BUILD_IN' => 'cx', // The name of the built-in tag library (it is not necessary to specify the tag library name when using the tag), separated by a comma Separate <br> 'TAGLIB_PRE_LOAD' => '', // Tag libraries that need to be additionally loaded (the tag library name must be specified), multiple ones separated by commas<br> 'TAG_NESTED_LEVEL' => 3, // Tag nesting level<br>'TAG_EXTEND_PARSE' => '', // Specify the function name for extended definition and parsing of ordinary tags. <br><br>/*Form token verification*/<br> 'token_on' = & GT; True, // Open the token verification <br> 'token_name' = & gt; '__hash__', // token verification verification verification Form hidden field name<br> 'TOKEN_TYPE' => 'md5', // Token verification hash rules<br><br> /* URL settings */<br> 'URL_CASE_INSENSITIVE' => false, // Is the URL address case insensitive? , // URL access mode, optional parameters 0, 1, 2, 3, representing the following four modes: <br> // 0 (normal mode); 1 (PATHINFO mode); 2 (REWRITE mode); 3 (compatible Mode) Valid when URL_DISPATCH_ON is turned on; the default is PATHINFO mode, providing the best user experience and SEO support<br> 'URL_PATHINFO_MODEL' => 2, // PATHINFO mode, using the numbers 1, 2, and 3 to represent the following three modes :<br> // 1 Normal mode (parameters are not in order, such as /m/module/a/action/id/1);<br> // 2 Smart mode (the mode used by the system by default, which can automatically identify modules and operations )<br> // 3 Compatibility mode (pass PATHINFO to dispather through a GET variable, the default is s index.php?s=/module/action/id/1)<br> 'URL_PATHINFO_DEPR' => '/' , // In PATHINFO mode, the delimiter between each parameter<br> 'URL_HTML_SUFFIX' => '', // URL pseudo-static suffix setting<br><br> /* System variable name setting */<br> 'Var_group' = & gt; 'g', // The default group obtain variables <br> 'var_module' = & gt; // The default module obtain variables <br> 'var_action' = & gt; 'a', // The default operation obtain variable <br> 'var_router' = & gt; 'r', // default route to obtain variables <br> 'var_page' = & gt; 'p', // default paging jump transition volume <br> 'var_template' = > 't', //Default template switching variable<br> 'VAR_LANGUAGE' => 'l', //Default language switching variable<br> 'VAR_AJAX_SUBMIT' => 'ajax', //Default AJAX submission Variable<br> 'VAR_PATHINFO' => 's', // PATHINFO compatibility mode acquisition variable<br><br>
The above is the detailed content of Thinkphp common system configuration list. For more information, please follow other related articles on the PHP Chinese website!