TPF框架中使用的到配置文件说明
一、基础配置文件说明
注:基础配置文件除configfile字段外,其他所有配置可在用户基本配置文件(一般为conf/basic.php,可自行调整成其他),进行更改配置,系统会以应用配置文件为准
'configfile' => array(//应用配置文件路径
'config' => 'basic', //应用基础配置文件名
'router' => 'router', //路由器配置文件名
'database' => 'db', //数据库配置文件名
'session' => 'session', //session配置文件名
'cookie' => 'cookie', //cookie配置文件名
'cache' => 'cache'), //缓存配置文件名
'environment' => 'dev', //环境dev开发环境test测试环境prd正式环境,挂钩数据库配置文件
'controller' => 'index', //默认控制器
'action' => 'index', //默认动作
'versionshow' => 1, //覆盖X-Powered-By显示版本否则会显示PHP版本,若要关闭PHP版本显示更改php.ini项expose_php = On到Off
'charset' => 'utf-8', //默认编码
'errorpage' => '', //404页面,存放用户views目录中的文件
'submitmethod' => '_method', //获取提交方式表单中隐含域的控件名,值支持POST,GET,PUT,DELETE
'layoutcontext' => '__CONTEXT__', //使用布局输出模版时替换的上下文
'language' => 'zh-cn', //所用语言包,对应lang/编码/提示是文件包
'timezone' => 'Asia/Shanghai', //默认时区
'localtime' => 0, //与服务器设置时间的时间差 8|-2
'pagesize' => 20, //默认分页数
'rollpage' => 5, //分页显示页数
'passwdseek' => 'tynt', //密码加密种子
'loglevel' => 3, //日志记录等级Fetal ERROR,具体数值见Log类说明
'logfilesize' => 5242880, //单个日志文件大小,默认5M,单位字节
'fieldcache' => 0, //模型字段缓存,当模型中不手动设置字段类型时系统自动获取数据库字段类型,设置成1如果改动数据字段则需删除缓存,设置成0无缓存但相对效率较低
'mobile' => array(//精确检测手机号码使用,用于Validator::isMobile方法
'chinamobile' => array(134,135,136,137,138,139,147,150,151,152,157,158,159,182,187,188),
'chinaunicom' => array(130,131,132,145,155,156,185,186),
'chinanet' => array(133,153,180,181,189)),
'router' => array(//路由相关配置
/**
* 标准路由格式,module在没定义的情况下默认为空
* module/controller/action/page-keyword.html?id=1
* index.php/module/controller/action/page-keyword.html?id=1(允许入口页访问)
* ?module/controller/action/page-keyword.html?id=1
* ?m=module&c=controller&do=action&id=1
*/
'module' => 'tbsms', //模块,多个模块名用“,”分隔
'defaultmodule' => 'www', //默认模块
'subdomain' => FALSE, //是否启用泛二级域名
'submodule' => 'module', //泛二级域名启用后默认处理的模块
'controller_key' => 'c', //控制器键名
'module_key' => 'm', //模块键名
'action_key' => 'do', //动作键名
'entry' => 'index.php', //入口默认页
'suffix' => array(), //扩展名转换eg:array('html'=>'','jsp'=>'html','do'=>'')
'entryenable' => TRUE, //入口默认页是否允许访问
'enable' => TRUE, //是否启用自定义路由
'mapper' => array(//自定义路由设置,支持正则表达式
'' => '' //路由转换支持article/([0-9]+)=> news/detail/$1
)
),
'template' => array(
'auto' => 1, //使用系统模板
'ext' => 'phtml', //模板扩展名
),
'session' => array( //session的相关配置
'name' => 'TSESSION', //session名称
'storage' => 'FILE', //session存储类型FILE/APC/DB/MEMCACHE/EACCELERATOR/XCACHE
'lifetime' => 3600, //session有效时间
'cookiepath' => '/', //cookie作用路径
'cookiedomain' => '', //cookie作用域
'path' => '', //session文件保存路径
'probability' => 1, //session文件存储时过期文件的销毁概率,默认1%,范围(0.01-100)
'dbconfig' => 'session', //使用session的db配置文件来连接数据库
'table' => 'tbs_session', //数据表名
'memcachehost' => array('127.0.0.1'), //memcache服务器地址
'memcacheport' => array(11211), //memcache服务器端口,与服务器地址对应
),
//session设置
'cookie' => array(//cookie的相关配置
'perfix' => '', //cookie前缀
'expire' => 3600, //cookie存活时间
'domain' => '', //有效域名
'path' => '/', //有效路径
),
'cache' => array(//缓存的相关配置
'storage' => 'FILE', //缓存存储类型FILE/APC/MEMCACHE/XCACHE
'timeout' => 3600, //缓存时间
'prefix' => '~T', //缓存参数名前缀,避免与其他存储冲突
'memcachehost' => array('127.0.0.1'), //memcache服务器地址
'memcacheport' => array(11211), //memcache服务器端口,与服务器地址对应
),
'tools' => array( //工具箱配置
'username' => 'tynt', //工具箱登录用户名
'password' => 'tynt' //工具箱登录密码
)
二、路径配置文件说明
在使用脚手架生成应用时,如果要更改应用程序相关文件的存储目录,那么优先更改框架使用的目录再执行安装,那么系统会自动根据你的配置生成应用程序目录
'model_dir' => 'models', //模型目录
'controller_dir' => 'controllers', //默认控制器目录
'view_dir' => 'views', //默认视图目录
'config_dir' => 'conf', //默认配置文件目录
'data_dir' => 'data', //网站运行时目录
'vendors_dir' => 'vendors', //扩展程序目录
'images_dir' => 'images', //网站图片目录框架中
'css_dir' => 'css', //网站样式目录框架中
'js_dir' => 'js', //网站js目录框架中
'controller_sub' => array(
'module_dir' => 'modules', //默认模块目录,为控制器子目录
'component_dir' => 'components', //组件目录,为控制器子目录
'widget_dir' => 'widgets' //挂件目录
),
'view_sub' => array(
'layout_dir' => 'layouts', //试图布局目录,为view子目录
'helper_dir' => 'helpers', //助手类目录
'widget_dir'=> 'widgets', //挂件视图
),
'data_sub' => array(
'cache_dir' => 'cache', //文件缓存则指定缓存路径,为data子目录
'template_dir' => 'tpl', //模板缓存目录,为data子目录
'log_dir' => 'logs', //日志输出目录,为data子目录
'tmp_dir' => 'tmp', //临时目录
'upfile_dir' => 'upfile', //上传文件目录
'session_dir' => 'session' //session文件保存路径
)