search
HomeBackend DevelopmentPHP TutorialThinkphp common system configuration list

Thinkphp common system configuration list

Sep 19, 2019 pm 04:33 PM
thinkphpSystem settings

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<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' => ' 'TAGLIB_END' => '>', // Tag library tag end tag<br> 'TAGLIB_LOAD' =&gt ; 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!

Statement
This article is reproduced at:thinkphp开源社区. If there is any infringement, please contact admin@php.cn delete
PHP Dependency Injection Container: A Quick StartPHP Dependency Injection Container: A Quick StartMay 13, 2025 am 12:11 AM

APHPDependencyInjectionContainerisatoolthatmanagesclassdependencies,enhancingcodemodularity,testability,andmaintainability.Itactsasacentralhubforcreatingandinjectingdependencies,thusreducingtightcouplingandeasingunittesting.

Dependency Injection vs. Service Locator in PHPDependency Injection vs. Service Locator in PHPMay 13, 2025 am 12:10 AM

Select DependencyInjection (DI) for large applications, ServiceLocator is suitable for small projects or prototypes. 1) DI improves the testability and modularity of the code through constructor injection. 2) ServiceLocator obtains services through center registration, which is convenient but may lead to an increase in code coupling.

PHP performance optimization strategies.PHP performance optimization strategies.May 13, 2025 am 12:06 AM

PHPapplicationscanbeoptimizedforspeedandefficiencyby:1)enablingopcacheinphp.ini,2)usingpreparedstatementswithPDOfordatabasequeries,3)replacingloopswitharray_filterandarray_mapfordataprocessing,4)configuringNginxasareverseproxy,5)implementingcachingwi

PHP Email Validation: Ensuring Emails Are Sent CorrectlyPHP Email Validation: Ensuring Emails Are Sent CorrectlyMay 13, 2025 am 12:06 AM

PHPemailvalidationinvolvesthreesteps:1)Formatvalidationusingregularexpressionstochecktheemailformat;2)DNSvalidationtoensurethedomainhasavalidMXrecord;3)SMTPvalidation,themostthoroughmethod,whichchecksifthemailboxexistsbyconnectingtotheSMTPserver.Impl

How to make PHP applications fasterHow to make PHP applications fasterMay 12, 2025 am 12:12 AM

TomakePHPapplicationsfaster,followthesesteps:1)UseOpcodeCachinglikeOPcachetostoreprecompiledscriptbytecode.2)MinimizeDatabaseQueriesbyusingquerycachingandefficientindexing.3)LeveragePHP7 Featuresforbettercodeefficiency.4)ImplementCachingStrategiessuc

PHP Performance Optimization Checklist: Improve Speed NowPHP Performance Optimization Checklist: Improve Speed NowMay 12, 2025 am 12:07 AM

ToimprovePHPapplicationspeed,followthesesteps:1)EnableopcodecachingwithAPCutoreducescriptexecutiontime.2)ImplementdatabasequerycachingusingPDOtominimizedatabasehits.3)UseHTTP/2tomultiplexrequestsandreduceconnectionoverhead.4)Limitsessionusagebyclosin

PHP Dependency Injection: Improve Code TestabilityPHP Dependency Injection: Improve Code TestabilityMay 12, 2025 am 12:03 AM

Dependency injection (DI) significantly improves the testability of PHP code by explicitly transitive dependencies. 1) DI decoupling classes and specific implementations make testing and maintenance more flexible. 2) Among the three types, the constructor injects explicit expression dependencies to keep the state consistent. 3) Use DI containers to manage complex dependencies to improve code quality and development efficiency.

PHP Performance Optimization: Database Query OptimizationPHP Performance Optimization: Database Query OptimizationMay 12, 2025 am 12:02 AM

DatabasequeryoptimizationinPHPinvolvesseveralstrategiestoenhanceperformance.1)Selectonlynecessarycolumnstoreducedatatransfer.2)Useindexingtospeedupdataretrieval.3)Implementquerycachingtostoreresultsoffrequentqueries.4)Utilizepreparedstatementsforeffi

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Article

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.