share happiness, simple learning

TPF框架中使用的到配置文件說(shuō)明

一(yī)、基礎配置文件說(shuō)明


注:基礎配置文件除configfile字段外,其他所有配置可在用戶基本配置文件(一(yī)般為(wèi)conf/basic.php,可自行調整成其他),進行更改配置,系統會以應用配置文件為(wèi)準

'configfile' => array(//應用配置文件路(lù)徑
'config' => 'basic', //應用基礎配置文件名
'router' => 'router', //路(lù)由器(qì)配置文件名
'database' => 'db', //數據庫配置文件名
'session' => 'session', //session配置文件名
'cookie' => 'cookie', //cookie配置文件名
'cache' => 'cache'), //緩存配置文件名

'environment' => 'dev', //環境dev開發環境test測試環境prd正式環境,挂鈎數據庫配置文件
'controller' => 'index', //默認控制器(qì)
'action' => 'index', //默認動作(zuò)
'versionshow' => 1, //覆蓋X-Powered-By顯示版本否則會顯示PHP版本,若要關(guān)閉PHP版本顯示更改php.ini項expose_php = On到Off
'charset' => 'utf-8', //默認編碼
'errorpage' => '', //404頁面,存放(fàng)用戶views目錄中的文件
'submitmethod' => '_method', //獲取提交方式表單中隐含域的控件名,值支持POST,GET,PUT,DELETE
'layoutcontext' => '__CONTEXT__', //使用布局輸出模版時(shí)替換的上(shàng)下(xià)文
'language' => 'zh-cn', //所用語言包,對應lang/編碼/提示是文件包
'timezone' => 'Asia/Shanghai', //默認時(shí)區
'localtime' => 0, //與服務(wù)器(qì)設置時(shí)間(jiān)的時(shí)間(jiān)差 8|-2
'pagesize' => 20, //默認分(fēn)頁數
'rollpage' => 5, //分(fēn)頁顯示頁數
'passwdseek' => 'tynt', //密碼加密種子(zǐ)
'loglevel' => 3, //日志記錄等級Fetal ERROR,具體(tǐ)數值見Log類說(shuō)明
'logfilesize' => 5242880, //單個(gè)日志文件大小,默認5M,單位字節
'fieldcache' => 0, //模型字段緩存,當模型中不手動設置字段類型時(shí)系統自動獲取數據庫字段類型,設置成1如(rú)果改動數據字段則需删除緩存,設置成0無緩存但(dàn)相對效率較低(dī)

'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(//路(lù)由相關(guān)配置
/**
* 标準路(lù)由格式,module在沒定義的情況下(xià)默認為(wèi)空
* 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', //模塊,多個(gè)模塊名用“,”分(fēn)隔
'defaultmodule' => 'www', //默認模塊
'subdomain' => FALSE, //是否啓用泛二級域名
'submodule' => 'module', //泛二級域名啓用後默認處理(lǐ)的模塊
'controller_key' => 'c', //控制器(qì)鍵名
'module_key' => 'm', //模塊鍵名
'action_key' => 'do', //動作(zuò)鍵名
'entry' => 'index.php', //入口默認頁
'suffix' => array(), //擴展名轉換eg:array('html'=>'','jsp'=>'html','do'=>'')
'entryenable' => TRUE, //入口默認頁是否允許訪問
'enable' => TRUE, //是否啓用自定義路(lù)由
'mapper' => array(//自定義路(lù)由設置,支持正則表達式
'' => '' //路(lù)由轉換支持article/([0-9]+)=> news/detail/$1
)
),

'template' => array(
'auto' => 1, //使用系統模闆
'ext' => 'phtml', //模闆擴展名
),

'session' => array( //session的相關(guān)配置
'name' => 'TSESSION', //session名稱
'storage' => 'FILE', //session存儲類型FILE/APC/DB/MEMCACHE/EACCELERATOR/XCACHE
'lifetime' => 3600, //session有效時(shí)間(jiān)
'cookiepath' => '/', //cookie作(zuò)用路(lù)徑
'cookiedomain' => '', //cookie作(zuò)用域
'path' => '', //session文件保存路(lù)徑
'probability' => 1, //session文件存儲時(shí)過期文件的銷毀概率,默認1%,範圍(0.01-100)
'dbconfig' => 'session', //使用session的db配置文件來(lái)連接數據庫
'table' => 'tbs_session', //數據表名
'memcachehost' => array('127.0.0.1'), //memcache服務(wù)器(qì)地址
'memcacheport' => array(11211), //memcache服務(wù)器(qì)端口,與服務(wù)器(qì)地址對應
),

//session設置
'cookie' => array(//cookie的相關(guān)配置 'perfix' => '', //cookie前綴
'expire' => 3600, //cookie存活時(shí)間(jiān)
'domain' => '', //有效域名
'path' => '/', //有效路(lù)徑
),

'cache' => array(//緩存的相關(guān)配置
'storage' => 'FILE', //緩存存儲類型FILE/APC/MEMCACHE/XCACHE
'timeout' => 3600, //緩存時(shí)間(jiān)
'prefix' => '~T', //緩存參數名前綴,避免與其他存儲沖突
'memcachehost' => array('127.0.0.1'), //memcache服務(wù)器(qì)地址
'memcacheport' => array(11211), //memcache服務(wù)器(qì)端口,與服務(wù)器(qì)地址對應
),

'tools' => array( //工具箱配置
'username' => 'tynt', //工具箱登錄用戶名
'password' => 'tynt' //工具箱登錄密碼
)


二、路(lù)徑配置文件說(shuō)明

在使用腳手架生(shēng)成應用時(shí),如(rú)果要更改應用程序相關(guān)文件的存儲目錄,那麽優先更改框架使用的目錄再執行安裝,那麽系統會自動根據你的配置生(shēng)成應用程序目錄

'model_dir' => 'models', //模型目錄
'controller_dir' => 'controllers', //默認控制器(qì)目錄
'view_dir' => 'views', //默認視(shì)圖目錄
'config_dir' => 'conf', //默認配置文件目錄
'data_dir' => 'data', //網站(zhàn)運行時(shí)目錄
'vendors_dir' => 'vendors', //擴展程序目錄
'images_dir' => 'images', //網站(zhàn)圖片目錄框架中
'css_dir' => 'css', //網站(zhàn)樣式目錄框架中
'js_dir' => 'js', //網站(zhàn)js目錄框架中

'controller_sub' => array(
'module_dir' => 'modules', //默認模塊目錄,為(wèi)控制器(qì)子(zǐ)目錄
'component_dir' => 'components', //組件目錄,為(wèi)控制器(qì)子(zǐ)目錄
'widget_dir' => 'widgets' //挂件目錄
),

'view_sub' => array(
'layout_dir' => 'layouts', //試圖布局目錄,為(wèi)view子(zǐ)目錄
'helper_dir' => 'helpers', //助手類目錄
'widget_dir'=> 'widgets', //挂件視(shì)圖
),

'data_sub' => array(
'cache_dir' => 'cache', //文件緩存則指定緩存路(lù)徑,為(wèi)data子(zǐ)目錄
'template_dir' => 'tpl', //模闆緩存目錄,為(wèi)data子(zǐ)目錄
'log_dir' => 'logs', //日志輸出目錄,為(wèi)data子(zǐ)目錄
'tmp_dir' => 'tmp', //臨時(shí)目錄
'upfile_dir' => 'upfile', //上(shàng)傳文件目錄
'session_dir' => 'session' //session文件保存路(lù)徑
)


目錄