Home  >  Article  >  Backend Development  >  Thinkphp common system configuration list

Thinkphp common system configuration list

山海
山海forward
2019-09-19 16:33:192320browse

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.

Thinkphp common system configuration list


# 'APP_DEBUG' => false, // Whether to enable debugging mode 'APP_DOMAIN_DEPLOY' => false, // Whether to use an independent domain name to deploy the project
'APP_PLUGIN_ON' => false, // Whether to enable the plug-in mechanism
'APP_FILE_CASE' => false, // Whether to check the case of the file Yes Valid on Windows platform
'APP_GROUP_DEPR' => '.', // Separator between module groups
'APP_GROUP_LIST' => '', // Project group setting, used between multiple groups Comma separated, for example, 'Home,Admin'
'APP_AUTOLOAD_REG' => false, // Whether to enable SPL_AUTOLOAD_REGISTER
'APP_AUTOLOAD_PATH' => 'Think.Util.', // __autoLoad Mechanism additional detection path settings , pay attention to the search order
'APP_CONFIG_LIST' => array('taglibs','routes','tags','htmls','modules','actions'),//
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
'COOKIE_DOMAIN' => '', // Cookie valid domain name
'COOKIE_PATH' = > '/', // Cookie path
'COOKIE_PREFIX' => '', // Cookie prefix to avoid conflicts
/* Default settings */
'DEFAULT_APP' => '@', //Default item Name, @ represents the current project
'DEFAULT_GROUP'                                                     . '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 theme name
'DEFAULT_LANG' = > 'zh-cn', //Default Language

/* Database Settings */
'DB_TYPE'                                                          'mysql ',                                                                                           'mysql '                                          . 'localhost', // Server address 'DB_NAME' => '', 'DB_USER' // User name
'DB_ PWD'                            => '', // password
'db_port' = & gt; 3306, port
'db_prefix' = & gt; 'think_', // database table prefix
'db_suffix' = & gt; '', '', '', // Database table suffix
'DB_FIELDTYPE_CHECK' => false, // Whether to perform field type checking
'DB_FIELDS_CACHE' => true, // Enable field caching
'DB_CHARSET' => 'utf8 ', //The database encoding defaults to utf8
'DB_DEPLOY_TYPE' => 0, // Database deployment mode: 0 centralized (single server), 1 distributed (master-slave server)
'DB_RW_SEPARATE' => false, // Whether database reading and writing are separated master-slave The formula is valid

'DATA_CACHE_TIME' => -1, // Data cache validity period
'DATA_CACHE_COMPRESS' => false, // Whether the data cache is compressed or not
'DATA_CACHE_CHECK' = > false, // Whether the data cache is verified to be cached
'DATA_CACHE_TYPE' => 'File', // Data cache type

'DATA_CACHE_PATH' => TEMP_PATH, // Cache path setting (only valid for File mode caching)
'DATA_CACHE_SUBDIR' => false, // Use subdirectory cache (automatically based on cache identification) Hash to create a subdirectory)
'DATA_PATH_LEVEL' => 1, // Subdirectory cache level

/* Error settings */
'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
'ERROR_PAGE' => '', // Error directed page

/* Static cache settings */
'HTML_CACHE_ON' => false, // Turn off static cache by default
'HTML_CACHE_TIME' => 60, // Static cache validity period
'HTML_READ_TYPE' => 0, // Static cache reading method 0 readfile 1 redirect
'HTML_FILE_SUFFIX' => '.shtml',//Default static file suffix

/* Language settings */
'LANG_SWITCH_ON' => false, //Default closed Multi-language package function
'LANG_AUTO_DETECT' => true, // Automatic detection of language is valid after turning on the multi-language function

/* Log settings */
'LOG_RECORD' => false, // No logging by default
'LOG_FILE_SIZE' => 2097152, // Log file size limit
'LOG_RECORD_LEVEL' => array('EMERG','ALERT','CRIT','ERR') , // Allowed log level

/* Paging settings */
'PAGE_ROLLPAGE' => 5, // Number of pages displayed in paging
'PAGE_LISTROWS' => 20, // Paging displays the number of records per page

/* SESSION settings */
'SESSION_AUTO_START' => true, // Whether to automatically open the Session
// Available parameters of the built-in SESSION class
// 'SESSION_NAME' => '', // Session name
//'SESSION_PATH' => '', // Session save path
//'SESSION_CALLBACK' => '', //Session object Callback function during deserialization

/* Run time setting */
'SHOW_RUN_TIME' => false, // Run time display
'SHOW_ADV_TIME' => false, // Display 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 memory overhead
'SHOW_PAGE_TRACE' => false, // Display page Trace information is defined by Trace file and assigned by Action operation
'SHOW_ERROR_MSG' => true, // Display error message
/* Template engine settings * /
'TMPL_ENGINE_TYPE' => 'Think', // Default template engine The following settings are only valid for using the Think template engine
'TMPL_DETECT_THEME' => false, // Automatically detect template themes
' 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 that the template engine wants to automatically replace must be in the form of an array.
'TMPL_L_DELIM' => '{', // Template engine ordinary tag start tag
'TMPL_R_DELIM' => '}', // Template engine ordinary tag end tag
'TMPL_VAR_IDENTIFY' =& gt ; 'array', // Template variable identification. Leave it blank to automatically judge. If the parameter is 'obj', it means the object
'TMPL_STRIP_SPACE' => false, // Whether to remove html spaces and line breaks in the template file
'TMPL_CACHE_ON' => true, // Whether Turn on the template compilation cache. If set to false, it will be recompiled every time.
'TMPL_CACHE_TIME' => -1, ' TMPL_ACTION_ERROR' => 'Public:success', // The default error jumps to the corresponding template file
'TMPL_ACTION_SUCCESS' => 'Public:success', // The default success jumps to the corresponding template file
' TMPL_TRACE_FILE' => THINK_PATH.'/Tpl/PageTrace.tpl.php', // Page Trace template file
'TMPL_EXCEPTION_FILE' => THINK_PATH.'/Tpl/ThinkException.tpl.php',// Exception The template file of the page
'TMPL_FILE_DEPR'=>'/', //The separator between the template file MODULE_NAME and ACTION_NAME is only valid for project group deployment
//Think template engine tag library related settings
'TAGLIB_BEGIN' => '<', // Tag library tag start tag
'TAGLIB_END' => '>', // Tag library tag end tag
'TAGLIB_LOAD' => ; true, // Whether to use other tag libraries other than the built-in tag library, automatically detected by default
'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
'TAGLIB_PRE_LOAD' => '', // Tag libraries that need to be additionally loaded (the tag library name must be specified), multiple ones separated by commas
'TAG_NESTED_LEVEL' => 3, // Tag nesting level
'TAG_EXTEND_PARSE' => '', // Specify the function name for extended definition and parsing of ordinary tags.

/*Form token verification*/
'token_on' = & GT; True, // Open the token verification
'token_name' = & gt; '__hash__', // token verification verification verification Form hidden field name
'TOKEN_TYPE' => 'md5', // Token verification hash rules

/* URL settings */
'URL_CASE_INSENSITIVE' => false, // Is the URL address case insensitive? , // URL access mode, optional parameters 0, 1, 2, 3, representing the following four modes:
// 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
'URL_PATHINFO_MODEL' => 2, // PATHINFO mode, using the numbers 1, 2, and 3 to represent the following three modes :
// 1 Normal mode (parameters are not in order, such as /m/module/a/action/id/1);
// 2 Smart mode (the mode used by the system by default, which can automatically identify modules and operations )
// 3 Compatibility mode (pass PATHINFO to dispather through a GET variable, the default is s index.php?s=/module/action/id/1)
'URL_PATHINFO_DEPR' => '/' , // In PATHINFO mode, the delimiter between each parameter
'URL_HTML_SUFFIX' => '', // URL pseudo-static suffix setting

/* System variable name setting */
'Var_group' = & gt; 'g', // The default group obtain variables
'var_module' = & gt; // The default module obtain variables
'var_action' = & gt; 'a', // The default operation obtain variable
'var_router' = & gt; 'r', // default route to obtain variables
'var_page' = & gt; 'p', // default paging jump transition volume
'var_template' = > 't', //Default template switching variable
'VAR_LANGUAGE' => 'l', //Default language switching variable
'VAR_AJAX_SUBMIT' => 'ajax', //Default AJAX submission Variable
'VAR_PATHINFO' => 's', // PATHINFO compatibility mode acquisition variable

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!

Statement:
This article is reproduced at:thinkphp开源社区. If there is any infringement, please contact admin@php.cn delete