Summary of common ThinkPHP configuration options and thinkphp configuration options

Source: Internet
Author: User

Summary of common ThinkPHP configuration options and thinkphp configuration options

This example describes common ThinkPHP configuration options. We will share this with you for your reference. The details are as follows:

Return array (/* Dispatch settings */'dispatch _ on' => true, // whether to enable the Dispatcher // URL mode: 0 Normal Mode 1 PATHINFO 2 REWRITE 3 compatibility mode when DISPATCH_ON is enabled, 'url _ model' => 1 is valid, // PATHINFO mode is used by default, provide the best user experience and SEO support // PATHINFO mode // Normal Mode 1 parameter no order/m/module/a/action/id/1 // intelligent mode 2 automatic recognition module and Operation/module/action/id/1 // or/module, action, id, 1 /... // compatibility mode 3: Pass PATHINFO to dispather through a GET variable. The default value is s index. php? S =/module/action/id/1 'path _ model' => 2, // The Smart mode 'path _ demo' => '/' is used by default '/', // 'router _ on' => false, which is the delimiter between PATHINFO parameters, // whether to enable the URL routing 'check _ FILE_CASE '=> false, // check whether the file's case sensitivity is valid for Windows 'tag _ PLUGIN_ON '=> false, // whether to enable the plug-in mechanism 'session _ AUTO_START' => true, // whether to automatically enable Session/* LOG settings */'web _ LOG_RECORD '=> false, // by default, logs are not logged 'Log _ RECORD_LEVEL' => array ('emer ', 'alert ', 'crit', 'err'), // The LOG level that can be recorded 'Log _ FILE_SIZ E '=> 2097152, // log file size limit/* error setting */'debug _ mode' => false, // In debug mode, 'error _ message' => 'is disabled by default. The page you are browsing has an ERROR! Please try again later ~ ', // The ERROR display information is valid in non-debug mode 'error _ page' => '', // The ERROR orientation PAGE 'show _ ERROR_MSG' => true, /* Set system variables */'var _ pathinfo' =>'s ', // obtain variables in PATHINFO compatibility mode, for example? The parameters after s =/module/action/id/1 depend on PATH_MODEL and PATH_DEPR 'var _ module' => 'M ', // The default module obtains the variable 'var _ action' => 'A'. // The default operation obtains the 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 submission variable/* MODULE and operation setting */'default _ module' => 'index ', // DEFAULT Module name 'default _ action' => 'index', // DEFAULT operation name/* template setting */'tmpl _ CACHE_ON '=> true, // enable the template by default If the compile cache is false, the template 'tmpl _ CACHE_TIME '=>-1, // template cache validity period-1 permanent unit: 'tmpl _ SWITCH_ON' => true, // enable multi-TEMPLATE support for 'Auto _ DETECT_THEME '=> false, // automatically detects the TEMPLATE topic 'default _ template' => 'default ', // default TEMPLATE Name 'template _ SUFFIX '=> '.html', // default TEMPLATE file SUFFIX 'cachfile _ SUFFIX '=> '. php ', // default template cache suffix 'output _ charset' => 'utf-8', // default OUTPUT code 'tmpl _ VAR_IDENTIFY' => 'array ', // template variable identification left blank automatic judgment array obj object/* PAGE setting */'page _ NUMB ERS '=> 5, // page display page number 'list _ NUMBERS' => 20, // number of records displayed on each page/* Model Setting */'Auto _ NAME_IDENTIFY '=> true, // UserType => user_type 'default _ MODEL_APP '=> '@', // The project name of the default model class @ indicates the current project/* Static cache settings */'html _ FILE_SUFFIX '=> '.shtml ', // The default static file suffix 'html _ CACHE_ON '=> false, // The default static file suffix 'html _ CACHE_TIME' => 60, // static cache validity period: 'html _ READ_TYPE '=> 1, // static cache read mode: 0 readfile 1 redirect 'html _ URL_SUFFIX' =>'', // Pseudo-static suffix setting/* language time zone setting */'time _ region' => 'prc', // Default time zone 'lang _ SWITCH_ON '=> false, // by DEFAULT, the multi-LANGUAGE Package function 'default _ language' => 'zh-cn' is disabled. // The default language 'Auto _ DETECT_LANG '=> false, // Automatic Detection language/* database settings */'db _ charset' => 'utf8', // The database encoding uses utf8'db _ DEPLOY_TYPE '=> 0 by default, // database deployment method 0 centralized (Single Server) 1 distributed (Master/Slave server) 'db _ rw_separate' => false, 'db _ FIELDS_CACHE '=> true, /* DATA cache settings */'data _ CACHE_TIME '=>-1, // DATA cache validity period 'data _ CAC HE_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 supports File Db Apc Memcache Shmop Sqlite Xcache Apachenote Eaccelerator 'data _ CACHE_PATH '=> TEMP_PATH, // cache path setting (only effective for File Cache) 'Data _ cache_subdir' => false, // use the subdirectory cache (automatically create the subdirectory Based on the hash of the cache ID) 'Data _ PATH_LEVEL '=> 1, // subdirectory CACHE level 'cache _ SERIAL_HEADER '=> "<? Php \ n // ", // The File CACHE begins to mark 'cache _ SERIAL_FOOTER '=>" \ n? ". ">", // File Cache end mark/* running time setting */'show _ RUN_TIME '=> false, // the running time is displayed as '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 the page Trace information, which is defined by the Trace file and assigned values by Action operations/* template engine settings */'tmpl _ ENGINE_TYPE '=> 'think ', // default template engine the following settings are only valid for the Think template engine 'tmpl _ DENY_FUNC_LIST '=> 'echo, exit ', // The template engine disables the function 'tmpl _ L_DELIM '=>' {', // The General tag of the template engine starts to mark 'tmpl _ R_DELIM' => '}', // tag 'taglib _ begin' => '<', // tag library tag start tag 'taglib _ end' => ', // TAG library TAG end TAG 'tag _ NESTED_LEVEL '=> 3, // TAG library 'taglib _ list' => 'cx, html ', // built-in tag library name/* Cookie setting */'cookie _ EXPIRE '=> 3600, // Coodie validity period 'cookie _ DOMAIN' => '', // Cookie valid domain name 'cookie _ path' => '/', // cookie path 'cookie _ prefix' => '', // avoid Cookie prefix conflict/* data format setting */'ajax _ RETURN_TYPE '=> 'json', // json xml format returned by AJAX data... /* Other settings */'Auto _ LOAD_PATH '=> 'think. util. ', // _ autoLoad path setting the Model and Action class of the current project will be automatically loaded, without the need to set the search order 'Action _ JUMP_TMPL' => 'public: success ', // The template file 'Action _ 404_TMPL '=> 'public: 000000', // The template file 'app _ DOMAIN_DEPLOY' => false, // use an independent domain name to deploy the project/* external configuration file to be loaded */'extend _ CONFIG_LIST '=> array ('taglibs', 'routes', 'tags ', & apos; htmls', & apos; modules & apos; actions & apos;), // optional built-in configurations include: taglibs label library definition routes route definition tags label definition htmls static cache definition modules extension module actions extension operation );

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.