Configuration issues of THINKPHP config.php_PHP tutorial

WBOY
Release: 2016-07-15 13:21:30
Original
822 people have browsed it

ThinkPHP’s config.php detailed configuration file introduction
THINKPHP config.php configuration problem

return array(
//------------------------------------------------ ---------------------------------------
//Template configuration
//------------------------------------------------ ---------------------------------------
"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_PARSE_STRING" => '', //The string that the template engine wants to automatically replace must be in the form of an array. For example array('__MYPATH__'=>Lib_PATH,...)
"TMPL_ACTION_ERROR" =>'Public:error', //Error jump template file
"TMPL_ACTION_SUCCESS" =>'Public:success', //Successful jump to template file
"TMPL_TRACE_FILE" =>THINK_PATH.'/Tpl/PageTrace.tpl.php', //Template file for page Trace
"TMPL_EXCEPTION_FILE" =>THINK_PATH.'/Tpl/ThinkException.tpl.php', //Template file for exception page
"TMPL_ENGINE_TYPE" => 'Think', //Default template engine
//The following settings are only valid when using the Think template engine
"TMPL_DENY_FUNC_LIST" =>'echo,exit', //Template engine disable function
"TMPL_L_DELIM" =>'{', //Template engine normal tag start tag
"TMPL_R_DELIM" =>'}', //Template engine normal tag end tag
"TMPL_VAR_IDENTIFY" =>'array', //Template variable identification Leave blank for self-understanding judgment array array obj object
"TMPL_FILE_DEPR" =>'/', //The separator between template file MODULE_NAME and ACTION_NAME, only valid for project group deployment
"TMPL_STRIP_SPACE" =>false, //Whether to remove the html spaces in the template file without line breaks
"TMPL_CACHE_ON" =>true, //Template compilation cache is enabled by default. If false, the template will be recompiled every time
"TMPL_CACHE_TIME" => -1, //Template cache validity period -1 permanent in seconds
"TAGLIB_BEGIN" =>'<', //Tag library tag start tag
"TAGLIB_END" =>'>', //Tag library tag end tag
"TAGLIB_BUILD_IN" =>'cx', //The name of the built-in tag library. You can add your own tag library. Use commas to separate multiple ones
"TAGLIB_PRE_LOAD" =>'', //Pre-loaded tag library, no need to use taglib tag loading in each template, multiple separated by commas
"TAG_NESTED_LEVEL" =>3 //Tag nesting level

//--------------------------------------------- ------------------------------------------
//Application configuration
//------------------------------------------------ ---------------------------------------
"APP_GROUP_DEPR" =>'.', //Separator between module groups
"APP_GROUP_LIST" =>'', //Project module grouping list, separate multiple groups with commas, such as 'Admin,Home'
"APP_CONFIG_LIST" =>array('taglibs','routes','tags','htmls','modules','actions'), //Project extension configuration file list
"APP_DOMAIN_DEPLOY" =>false, //Whether to use an independent domain name to deploy the project, it can only be enabled when the project directory itself is the website root directory

//--------------------------------------------- ------------------------------------------
//URL configuration
//------------------------------------------------ ---------------------------------------
"URL_MODEL" =>1, //URL mode: 0 normal mode 1 PATHINFO 2 REWRITE 3 compatibility 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, smart mode is used by default
//Normal mode 1 parameters are not in order/m/module/a/action/id/1
//Smart mode 2 brake identification module and operation /module/action/id/1/ or /module,action,id,1/...

"URL_PATHINFO_DEPR" =>'/', //Separation number between PATHINFO parameters
"URL_ROUTER_ON" =>true, //Whether to enable URL routing
"URL_HTML_SUFFIX" =>'.av', //Pseudo-static suffix setting, such as .shtml
"URL_CASE_INSENSITIVE" =>false, //Whether URL is case-insensitive, the default is case-sensitive


//------------------------------------------------ ---------------------------------------
//Log configuration
//------------------------------------------------ ---------------------------------------
"LOG_RECORD" =>false, //Whether to record website logs, the default is not to record logs
"LOG_RECORD_LEVEL" =>array('EMERG','ALERT','CRIT','ERR'), //The log level allowed to be recorded
"LOG_FILE_SIZE" =>2097152, //Log file size limit, for file-based logging, if exceeded, a backup file will be automatically generated


//------------------------------------------------ ---------------------------------------
//Error configuration
//------------------------------------------------ ---------------------------------------
"ERROR_MESSAGE" =>'There is a temporary error in the page you are browsing! Please try again later~', //Error display information is valid in non-debugging mode
"ERROR_PAGE" =>'', //Error redirection page, the complete URL address needs to be filled in


//------------------------------------------------ ---------------------------------------
//Database configuration
//------------------------------------------------ ---------------------------------------
"DB_CHARSET" =>'utf8', //Database encoding, the default is utf8
"DB_DEPLOY_TYPE" =>0, //Database deployment method: 0 centralized (single server) 1 distributed (master-slave server)
"DB_RW_SEPARATE" =>false, //Whether database reading and writing are separated, valid in distributed database mode
"DB_FIELDS_CACHE" =>true, //Enable data table field caching
"DB_TYPE" =>'mysql', //Database type
"DB_HOST" =>'localhost', //Database server address
"DB_NAME" =>'', //Database name
"DB_USER" =>'root', //Database user name
"DB_PWD" =>'', //Database password
"DB_PORT" =>3306, //Port used by the database
"DB_PREFIX" =>'think_', //Database table prefix
"DB_SUFFIX" =>'', //Database table suffix
"DB_FIELDTYPE_CHECK" =>false, //Whether to perform field type checking


//------------------------------------------------ ---------------------------------------
//Static cache configuration
//------------------------------------------------ ---------------------------------------
"HTML_FILE_SUFFIX" =>'.shtml', //Default static file suffix
"HTML_CACHE_ON" =>false, //Static caching is turned off by default
"HTML_CACHE_TIME" =>60, //Static cache validity period
"HTML_READ_TYPE" =>1, //Static cache reading method 0 readfile 1 redirect


//------------------------------------------------ ---------------------------------------
//Data cache configuration
//------------------------------------------------ ---------------------------------------
"DATA_CACHE_TYPE" =>'File', //Data cache type supports File Db Apc Memcache Shmop Sqlite Xcache Apachenote Eaccelerator
"DATA_CACHE_PATH" =>TEMP_PATH //Cache path setting (only valid for File mode cache)
"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 verifies the cache
"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


//------------------------------------------------ ---------------------------------------
//Run time configuration
//------------------------------------------------ ---------------------------------------
"SHOW_RUN_TIME" =>false, //Running time display
"SHOW_ADV_TIME" =>false, //Show detailed running time, valid after SHOW_RUN_TIME is turned on
"SHOW_DB_TIMES" =>false, //Display the number of database reads and writes
"SHOW_CACHE_TIMES" =>false, //Display cache read and write times
"SHOW_USE_MEM" =>false, //Show memory overhead
"SHOW_PAGE_TRACE" =>false, //Display page Trace information defined by Trace file and assigned by Action operation
"SHOW_ERROR_MSG" =>true, //Display error message when an error occurs


//------------------------------------------------ ---------------------------------------
//Cookie settings
//------------------------------------------------ ---------------------------------------
"COOKIE_EXPIRE" =>3600, //Coodie expiration date
"COOKIE_DOMAIN" =>'', //Cookie valid domain name
"COOKIE_PATH" =>'/', //Cookie path
"COOKIE_PREFIX" =>'', //Cookie prefix to avoid conflicts


//------------------------------------------------ ---------------------------------------
//Token verification configuration
//------------------------------------------------ ---------------------------------------
"TOKEN_ON" =>true, //Whether to enable token verification
"TOKEN_NAME" =>'__hash__', //Token verification form hidden field name
"TOKEN_TYPE" =>'md5', //Token verification hash rules


//------------------------------------------------ ---------------------------------------
//Default value configuration
//------------------------------------------------ ---------------------------------------
"DEFAULT_APP" =>'@', //The name of the project where the default model class is located @ represents the current project
"DEFAULT_GROUP" =>'Home', //Default group
"DEFAULT_MODULE" =>'Index', //Default module name
"DEFAULT_ACTION" =>'index', //Default operation name
"DEFAULT_THEME" =>'default',//Default template theme name
"DEFAULT_LANG" =>'zh-cn', //Default language
"DEFAULT_TIMEZONE" =>'PRC', //Default time zone
"DEFAULT_AJAX_RETURN" =>'JSON', //AJAX data return format JSON XML ...
"DEFAULT_CHARSET" =>'utf-8', //Default page output encoding


//------------------------------------------------ ---------------------------------------
//System variable configuration
//------------------------------------------------ ---------------------------------------
//The following variable configurations are mainly used for special value transmission of URLs. Try not to conflict with the URLs and form parameters in the project, otherwise it is easy to cause errors.
"VAR_PATHINFO" =>'s', //PATHINFO compatibility mode to obtain variables such as ?s=/module/action/id/1
"VAR_GROUP" =>'g', //Default group sending volume
"VAR_ROUTE" =>'r', //Default route acquisition variable
"VAR_MODULE" =>'m', //Default module gets variables
"VAR_ACTION" =>'a', //Default operation to obtain variables
"VAR_PAGE" =>'p', //Default paging jump variable
"VAR_TEMPLATE" =>'t', //Default template switching variable
"VAR_LANGUAGE" =>'l', //Default language switching variable
"VAR_AJAX_SUBMIT" =>'ajax', //Default AJAX submission variable


//------------------------------------------------ ---------------------------------------
//Language and time zone
//------------------------------------------------ ---------------------------------------
"LANG_SWITCH_ON" => false //Whether to enable multi-language function, it is turned off by default

);
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/477160.htmlTechArticleThinkPHP’s config.php detailed configuration file introduction THINKPHP config.php configuration problem?php return array( //- -------------------------------------------------- --------------------------...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template