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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











To run the ThinkPHP project, you need to: install Composer; use Composer to create the project; enter the project directory and execute php bin/console serve; visit http://localhost:8000 to view the welcome page.

ThinkPHP has multiple versions designed for different PHP versions. Major versions include 3.2, 5.0, 5.1, and 6.0, while minor versions are used to fix bugs and provide new features. The latest stable version is ThinkPHP 6.0.16. When choosing a version, consider the PHP version, feature requirements, and community support. It is recommended to use the latest stable version for best performance and support.

Steps to run ThinkPHP Framework locally: Download and unzip ThinkPHP Framework to a local directory. Create a virtual host (optional) pointing to the ThinkPHP root directory. Configure database connection parameters. Start the web server. Initialize the ThinkPHP application. Access the ThinkPHP application URL and run it.

Performance comparison of Laravel and ThinkPHP frameworks: ThinkPHP generally performs better than Laravel, focusing on optimization and caching. Laravel performs well, but for complex applications, ThinkPHP may be a better fit.

ThinkPHP installation steps: Prepare PHP, Composer, and MySQL environments. Create projects using Composer. Install the ThinkPHP framework and dependencies. Configure database connection. Generate application code. Launch the application and visit http://localhost:8000.

"Development Suggestions: How to Use the ThinkPHP Framework to Implement Asynchronous Tasks" With the rapid development of Internet technology, Web applications have increasingly higher requirements for handling a large number of concurrent requests and complex business logic. In order to improve system performance and user experience, developers often consider using asynchronous tasks to perform some time-consuming operations, such as sending emails, processing file uploads, generating reports, etc. In the field of PHP, the ThinkPHP framework, as a popular development framework, provides some convenient ways to implement asynchronous tasks.

ThinkPHP is a high-performance PHP framework with advantages such as caching mechanism, code optimization, parallel processing and database optimization. Official performance tests show that it can handle more than 10,000 requests per second and is widely used in large-scale websites and enterprise systems such as JD.com and Ctrip in actual applications.

Development suggestions: How to use the ThinkPHP framework for API development. With the continuous development of the Internet, the importance of API (Application Programming Interface) has become increasingly prominent. API is a bridge for communication between different applications. It can realize data sharing, function calling and other operations, and provides developers with a relatively simple and fast development method. As an excellent PHP development framework, the ThinkPHP framework is efficient, scalable and easy to use.
