PHP config.php的配置问题
ThinkPHP之config.php详细配置文件介绍 THINKPHP config.php的配置问题 return array( //--------------------------------------------------------------------------------------- //模版配置 //-------------------------------------------------------
ThinkPHP之config.php详细配置文件介绍
THINKPHP config.php的配置问题
return array(
//---------------------------------------------------------------------------------------
//模版配置
//---------------------------------------------------------------------------------------
"TMPL_DETECT_THEME" => false , //自动侦测模板主题
"TMPL_TEMPLATE_SUFFIX"=>'.html', //默认模板文件后缀
"TMPL_CACHFILE_SUFFIX"=>'.php', //默认模板缓存后缀
"TMPL_PARSE_STRING" => '', //模板引擎要自动替换的字符串,必须是数组形式。例如 array('__MYPATH__'=>Lib_PATH,...)
"TMPL_ACTION_ERROR" =>'Public:error', //错误跳转模板文件
"TMPL_ACTION_SUCCESS" =>'Public:success', //成功跳转模板文件
"TMPL_TRACE_FILE" =>THINK_PATH.'/Tpl/PageTrace.tpl.php', //页面Trace的模板文件
"TMPL_EXCEPTION_FILE" =>THINK_PATH.'/Tpl/ThinkException.tpl.php', //异常页面的模板文件
"TMPL_ENGINE_TYPE" => 'Think', //默认模板引擎
//以下设置仅对使用Think模板引擎有效
"TMPL_DENY_FUNC_LIST" =>'echo,exit', //模板引擎禁用函数
"TMPL_VAR_IDENTIFY" =>'array', //模板变量识别 留空自懂判断 array 数组 obj 对象
"TMPL_FILE_DEPR" =>'/', //模板文件MODULE_NAME不ACTION_NAME之间的分割符,只对项目分组部署有效
"TMPL_STRIP_SPACE" =>false, //是否去除模板文件里面?html空格不换行
"TMPL_CACHE_ON" =>true, //默认开启模板编译缓存 false 的话每次都重新编译模板
"TMPL_CACHE_TIME" => -1, //模板缓存有效期 -1 永久 单位为秒
//---------------------------------------------------------------------------------------
//应用配置
//---------------------------------------------------------------------------------------
"APP_GROUP_DEPR" =>'.', //模块分组之间的分割符
"APP_GROUP_LIST" =>'', //项目模块分组列表,多个组之间用逗号分?,例如 'Admin,Home'
"APP_CONFIG_LIST" =>array('taglibs','routes','tags','htmls','modules','actions'), //项目扩展配置文件列表
"APP_DOMAIN_DEPLOY" =>false, //是否使用独立域名部署项目,只有在项目目录本身就是网站根目录的情况下开启
//---------------------------------------------------------------------------------------
//URL配置
//---------------------------------------------------------------------------------------
"URL_MODEL" =>1, //URL模式: 0 普通模式 1 PATHINFO 2 REWRITE 3 兼容模式 当URL_DISPATCH_ON开启后有效
//默认为PATHINFO 模式,提供最好的用户体验和 SEO支持
"URL_PATHINFO_MODEL" =>2, //PATHINFO 模式,默认采用智能模式
//普通模式1 参数没有顺序/m/module/a/action/id/1
//智能模式2 制动识别模块和操作/module/action/id/1/ 或者 /module,action,id,1/...
"URL_PATHINFO_DEPR" =>'/', //PATHINFO参数之间分割号
"URL_ROUTER_ON" =>true, //是否开启URL路由
"URL_HTML_SUFFIX" =>'.av', //伪静态后缀设置,例如 .shtml
"URL_CASE_INSENSITIVE" =>false, //URL是否不区分大小写,默认区分大小写
//---------------------------------------------------------------------------------------
//日志配置
//---------------------------------------------------------------------------------------
"LOG_RECORD" =>false, //是否记录网站日志,默认不记录日志
"LOG_RECORD_LEVEL" =>array('EMERG','ALERT','CRIT','ERR'), //允许记录的日志级别
"LOG_FILE_SIZE" =>2097152, //日志文件大小限制, 针对文件方式的日志记录,超过会自动生成备份文件
//---------------------------------------------------------------------------------------
//错误配置
//---------------------------------------------------------------------------------------
"ERROR_MESSAGE" =>'您浏览的页面暂时发生了错误!请稍后再试~', //错误显示信息 非调试模式有效
"ERROR_PAGE" =>'', //错误定向页面,需要填写完整的URL地址
//---------------------------------------------------------------------------------------
//数据库配置
//---------------------------------------------------------------------------------------
"DB_CHARSET" =>'utf8', //数据库编码,默认采用 utf8
"DB_DEPLOY_TYPE" =>0, //数据库部署方式 :0 集中式(单一朋务器) 1 分布式(主从朋务器)
"DB_RW_SEPARATE" =>false, //数据库读写是否分离,分布式数据库方式下面有效
"DB_FIELDS_CACHE" =>true, //开启数据表字段缓存
"DB_TYPE" =>'mysql', //数据库类型
"DB_HOST" =>'localhost', //数据库服务器地址
"DB_NAME" =>'', //数据库名称
"DB_USER" =>'root', //数据库用户名
"DB_PWD" =>'', //数据库 密码
"DB_PORT" =>3306, //数据库使用的端口
"DB_PREFIX" =>'think_', //数据库?表前缀
"DB_SUFFIX" =>'', //数据库的表后缀
"DB_FIELDTYPE_CHECK" =>false, //是否迕行字段类型检查
//---------------------------------------------------------------------------------------
//静态缓存配置
//---------------------------------------------------------------------------------------
"HTML_FILE_SUFFIX" =>'.shtml', //默认静态文件后缀
"HTML_CACHE_ON" =>false, //默认关闭静态缓存
"HTML_CACHE_TIME" =>60, //静态缓存有效期
"HTML_READ_TYPE" =>1, //静态缓存读取方式 0 readfile 1 redirect
//---------------------------------------------------------------------------------------
//数据缓存配置
//---------------------------------------------------------------------------------------
"DATA_CACHE_TYPE" =>'File', //数据缓存类型 支持 File Db Apc Memcache Shmop Sqlite Xcache Apachenote Eaccelerator
"DATA_CACHE_PATH" =>TEMP_PATH //缓存路径设置 (仅对File方式缓存有效)
"DATA_CACHE_TIME" =>-1, //数据缓存有效期
"DATA_CACHE_COMPRESS" =>false, //数据缓存是否压缩缓存
"DATA_CACHE_CHECK" =>false, //数据缓存是否校验缓存
"DATA_CACHE_SUBDIR" =>false, //使用子目录缓存 (自动根据缓存标识的哈希创建子目录)
"DATA_PATH_LEVEL" =>1, //子目录缓存级别
//---------------------------------------------------------------------------------------
//运行时间配置
//---------------------------------------------------------------------------------------
"SHOW_RUN_TIME" =>false, //运行时间显示
"SHOW_ADV_TIME" =>false, //显示详细的运行?间,SHOW_RUN_TIME开启后有效
"SHOW_DB_TIMES" =>false, //显示数据库读写次数
"SHOW_CACHE_TIMES" =>false, //显示缓存读写次数
"SHOW_USE_MEM" =>false, //显示内存开销
"SHOW_PAGE_TRACE" =>false, //显示页面Trace信息 由 Trace文件定义和Action操作赋值
"SHOW_ERROR_MSG" =>true, //发生错误时显示错误信息
//---------------------------------------------------------------------------------------
//Cookie设置
//---------------------------------------------------------------------------------------
"COOKIE_EXPIRE" =>3600, //Coodie有效期
"COOKIE_DOMAIN" =>'', //Cookie有效域名
"COOKIE_PATH" =>'/', //Cookie路径
"COOKIE_PREFIX" =>'', //Cookie前缀 避免冲突
//---------------------------------------------------------------------------------------
//令牌验证配置
//---------------------------------------------------------------------------------------
"TOKEN_ON" =>true, //是否开启令牌验证
"TOKEN_NAME" =>'__hash__', //令牌验证的表单隐藏字段名称
"TOKEN_TYPE" =>'md5', //令牌验证哈希规则
//---------------------------------------------------------------------------------------
//默认值配置
//---------------------------------------------------------------------------------------
"DEFAULT_APP" =>'@', //默认模型类所在的项目名称 @ 表示当前项目
"DEFAULT_GROUP" =>'Home', //默认分组
"DEFAULT_MODULE" =>'Index', //默认模块名称
"DEFAULT_ACTION" =>'index', //默认操作名称
"DEFAULT_THEME" =>'default',//默认模板主题名称
"DEFAULT_LANG" =>'zh-cn', //默认语言
"DEFAULT_TIMEZONE" =>'PRC', //默认时区
"DEFAULT_AJAX_RETURN" =>'JSON', //AJAX 数据返回格式 JSON XML ...
"DEFAULT_CHARSET" =>'utf-8', //默认页面输出编码
//---------------------------------------------------------------------------------------
//系统变量配置
//---------------------------------------------------------------------------------------
//下面这些变量配置主要用于URL的特殊传值,在项目中的URL和表单参数尽量不要与之冲突,否则容易造成错误。
"VAR_PATHINFO" =>'s', //PATHINFO 兼容模式获取变量例如 ?s=/module/action/id/1
"VAR_GROUP" =>'g', //默认分组发量
"VAR_ROUTE" =>'r', //默认路由获取变量
"VAR_MODULE" =>'m', //默认模块获取变量
"VAR_ACTION" =>'a', //默认操作获取变量
"VAR_PAGE" =>'p', //默认分页跳转变量
"VAR_TEMPLATE" =>'t', //默认模板切换变量
"VAR_LANGUAGE" =>'l', //默认语言切换变量
"VAR_AJAX_SUBMIT" =>'ajax', //默认的AJAX提交变量
//---------------------------------------------------------------------------------------
//语言和时区
//---------------------------------------------------------------------------------------
"LANG_SWITCH_ON" => false //是否开启多语言功能,默认关闭
);
?>

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

AI Hentai Generator
Generate AI Hentai for free.

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



PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

If you are an experienced PHP developer, you might have the feeling that you’ve been there and done that already.You have developed a significant number of applications, debugged millions of lines of code, and tweaked a bunch of scripts to achieve op

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.
