close
呃...無聊了一下,所以將Cake PHP中core.php設定檔註解的部分翻譯,開頭的SVN資訊就不翻了。如果第一次接觸cake PHP的使用者對於設定檔的內容想瞭解一下的話,不妨可以大致的看一下,若有其它cake PHP專業玩家看翻譯的內容有問題,請不吝指教,留個言給我^_^ 如果你的版本是cake_1.2.0.7125-rc1,你可以直接複製,將他複蓋貼上你原本的core.php,但是注意你必需留意你原本的設定,甚至先將異動的部分抄錄起來,再做變更
/* SVN FILE: $Id: core.php 7118 2008-06-04 20:49:29Z gwoo $ */
/**
* This is core configuration file.
*
* Use it to configure core behavior of Cake.
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework - http://www.cakephp.org
* Copyright 2005-2008, Cake Software Foundation, Inc.
* 785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config
* @since CakePHP(tm) v 0.2.9
* @version $Revision: 7118 $
* @modifiedby $LastChangedBy: gwoo $
* @lastmodified $Date: 2008-06-04 13:49:29 -0700 (Wed, 04 Jun 2008) $
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
//################################
// cake_1.2.0.7125-rc1 設定檔中文化
//################################
///////////////////////////////////////////
// CakePHP 除錯模式
//////////////////////////////////////////
// 產品模式
// 0: 無錯誤或警告訊息,快閃訊息重導
//
// 開發模式
// 1: 顯示錯誤或警告訊息,更新快取資料,快閃訊息暫停
// 2: 除了同1一樣的資訊外,追加完整的除錯訊息和SQL語法
// 3: 除了同2一樣的資訊外,再追加 controller的drmp內容
//
// 在產品模式,顯示快閃訊息後會在一段時間倒數後重導網頁
// 在開發模式,顯示快閃訊息後,你必需點擊後才會進行重導網頁
//
Configure::write('debug', 2);
//////////////////////////////////////////
// 應用程式網站的編碼
//////////////////////////////////////////
Configure::write('App.encoding', 'UTF-8');
//////////////////////////////////////////////////////////////
//針對不支援mod_rewrite 設定
/////////////////////////////////////////////////////////////
// 使用CakePHP完美路徑來代替
// 先移除下列的.hataccess檔案
//
// /.htaccess
// /app/.htaccess
// /app/webroot/.htaccess
//
// 接下追加下行程式碼 (將註解符號拿掉)
//Configure::write('App.baseUrl', env('SCRIPT_NAME'));
//////////////////////////////////////////////////////////////
// 定義管理用的路由格式
/////////////////////////////////////////////////////////////
// 下列舉列路由名稱與存取的控制器關係
//
// 'admin' -> admin_index() and /admin/controller/index
// 'superuser' -> superuser_index() and /superuser/controller/index
//Configure::write('Routing.admin', 'admin');
//////////////////////////////////////////////////////////////
//關閉所有快取功能
/////////////////////////////////////////////////////////////
//Configure::write('Cache.disable', true);
//////////////////////////////////////////////////////////////
// 啟動快取檢查
/////////////////////////////////////////////////////////////
//如果你將此設定設為true時,只是准許你使用,系統不會自動幫你進行檢查
//你必需在controller中使用變數$cacheAction來定義要不要進行檢查
//你可以在controller設定var $cacheAction = true,預設對每個action的快取進行檢查
//或是在每個action使用$this->cacheActon = true 進行各別檢查
//Configure::write('Cache.check', true);
//////////////////////////////////////////////////////////////
// 定義使用log()預設的錯誤類型
// 用來區別錯誤登入和除錯
// 目前PHP支援LOG_DEBUG
/////////////////////////////////////////////////////////////
define('LOG_ERROR', 2);
//////////////////////////////////////////////////////////////
// 定義sesson模式
/////////////////////////////////////////////////////////////
// 'php' 使用php.ini設定的方式
// 'cake' 使用CakePHP的/tmp暫存目錄
// 'database' 使用CakePHP的資料庫
//若以上的模式都不是你想要的,要定義一個自訂的session模式,請將自訂的
//建立並將它儲存在 /app/config/.php
//接著你便可以將'Session.save' 設為自訂的
//
// Ex:
// 儲存到 /app/config/myMode.php
// 設定 Configure::write('Session.save', 'myMode');
//
//若你選用的是database,請於資料庫中建立所需session相關table
//預設table的SQL你可以在 /app/config/sql/sessions.sql 找到並匯入
Configure::write('Session.save', 'php');
//////////////////////////////////////////////////////////////
// 定義sesson存取的table名稱
/////////////////////////////////////////////////////////////
//若你選用的是database模式的session,而預設的table名稱不是你想要的
//那麼你可能在要此手動設定你自訂的table名稱
//Configure::write('Session.table', 'cake_sessions');
///////////////////////////////////////////////////////////////////////
// 定義session是使用哪一個資料庫連線設定變數
//////////////////////////////////////////////////////////////////////
// 'Session.save' 必需定義為 'database' 模式
// 資料庫連線設定變數在 /app/config/database.php 被定義
//Configure::write('Session.database', 'default');
///////////////////////////////////////////////////////////////////////
// CakePHP的session的cookie名稱
//////////////////////////////////////////////////////////////////////
Configure::write('Session.cookie', 'CAKEPHP');
///////////////////////////////////////////////////////////////////////
// session的預設存活時間
//////////////////////////////////////////////////////////////////////
Configure::write('Session.timeout', '120');
///////////////////////////////////////////////////////////////////////
// 自動啟動session功能
//////////////////////////////////////////////////////////////////////
Configure::write('Session.start', true);
///////////////////////////////////////////////////////////////////////
// 檢查session中的HTTP_USER_AGENT代理
//////////////////////////////////////////////////////////////////////
Configure::write('Session.checkAgent', true);
///////////////////////////////////////////////////////////////////////
// 設定session的模式
//////////////////////////////////////////////////////////////////////
//
// 'high' 存活時間延長為 'Session.timeout' x 10
// 'medium' 存活時間延長為 'Session.timeout' x 100
// 'low' 存活時間延長為 'Session.timeout' x 300
//
// 若模式設為'high',CakePHP的session IDs將會在每次要頁時重新產生
Configure::write('Security.level', 'high');
///////////////////////////////////////////////////////////////////////
// 一個自訂亂數的字串安全編碼雜湊
//////////////////////////////////////////////////////////////////////
Configure::write('Security.salt', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi');
/////////////////////////////////////////////////////////////////////////////
// 使用壓縮CSS技術去除文件中的空白、註解等
/////////////////////////////////////////////////////////////////////////////
//若要啟動此功能,必需有 /var/cache 此資料夾,並且為可寫入
//並且使用 /vendors/csspp/csspp.php 第三方的類別
//在CSS link 使用 /ccss/ 替代 /css/ 或是使用 HtmlHelper::css() 函式載入
//Configure::write('Asset.filter.css', 'css.php');
/////////////////////////////////////////////////////////////////////////////
// 插入自訂Javascript壓縮程式
/////////////////////////////////////////////////////////////////////////////
//在Javascript link 使用 /cjs/ 替代 /js/
//或是使用 JavaScriptHelper::link()函式載入
//Configure::write('Asset.filter.js', 'custom_javascript_output_filter.php');
/////////////////////////////////////////////////////////////////////////////
// 存取控制清單(Acl))
// 定義Acl的類別名稱及資料庫連線設定
/////////////////////////////////////////////////////////////////////////////
Configure::write('Acl.classname', 'DbAcl');
Configure::write('Acl.database', 'default');
/////////////////////////////////////////////////////////////////////////////
// 快取引擎設定,file為預設值
/////////////////////////////////////////////////////////////////////////////
/*
* 有下例幾種模式可選擇
* 請將欲使用的模式註解移除
*
* File storage engine.
*
* Cache::config('default', array(
* 'engine' => 'File' //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'path' => CACHE, //[optional] use system tmp directory - remember to use absolute path
* 'prefix' => 'cake_', //[optional] prefix every cache file with this string
* 'lock' => false, //[optional] use file locking
* 'serialize' => true, [optional]
* ));
*
*
* APC (http://pecl.php.net/package/APC)
*
* Cache::config('default', array(
* 'engine' => 'Apc' //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* ));
*
* Xcache (http://xcache.lighttpd.net/)
*
* Cache::config('default', array(
* 'engine' => 'Xcache' //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* 'user' => 'user', //user from xcache.admin.user settings
* 'password' => 'password', //plaintext password (xcache.admin.pass)
* ));
*
*
* Memcache (http://www.danga.com/memcached/)
*
* Cache::config('default', array(
* 'engine' => 'Memcache' //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* 'servers' => array(
* '127.0.0.1:11211' // localhost, default port 11211
* ), //[optional]
* 'compress' => false, // [optional] compress data in Memcache (slower, but uses less memory)
* ));
*
*/
Cache::config('default', array('engine' => 'File'));
全站熱搜
留言列表