PageRenderTime 28ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/app/Config/core.php

https://bitbucket.org/LeThanhDat/firstdummyapp
PHP | 348 lines | 40 code | 23 blank | 285 comment | 1 complexity | b5df3b7ea841af1ef2a6070bd5852aab MD5 | raw file
  1. <?php
  2. /**
  3. * This is core configuration file.
  4. *
  5. * Use it to configure core behavior of Cake.
  6. *
  7. * PHP 5
  8. *
  9. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  10. * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  11. *
  12. * Licensed under The MIT License
  13. * For full copyright and license information, please see the LICENSE.txt
  14. * Redistributions of files must retain the above copyright notice.
  15. *
  16. * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  17. * @link http://cakephp.org CakePHP(tm) Project
  18. * @package app.Config
  19. * @since CakePHP(tm) v 0.2.9
  20. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  21. */
  22. /**
  23. * CakePHP Debug Level:
  24. *
  25. * Production Mode:
  26. * 0: No error messages, errors, or warnings shown. Flash messages redirect.
  27. *
  28. * Development Mode:
  29. * 1: Errors and warnings shown, model caches refreshed, flash messages halted.
  30. * 2: As in 1, but also with full debug messages and SQL output.
  31. *
  32. * In production mode, flash messages redirect after a time interval.
  33. * In development mode, you need to click the flash message to continue.
  34. */
  35. Configure::write('debug', 2);
  36. /**
  37. * Configure the Error handler used to handle errors for your application. By default
  38. * ErrorHandler::handleError() is used. It will display errors using Debugger, when debug > 0
  39. * and log errors with CakeLog when debug = 0.
  40. *
  41. * Options:
  42. *
  43. * - `handler` - callback - The callback to handle errors. You can set this to any callable type,
  44. * including anonymous functions.
  45. * Make sure you add App::uses('MyHandler', 'Error'); when using a custom handler class
  46. * - `level` - int - The level of errors you are interested in capturing.
  47. * - `trace` - boolean - Include stack traces for errors in log files.
  48. *
  49. * @see ErrorHandler for more information on error handling and configuration.
  50. */
  51. Configure::write('Error', array(
  52. 'handler' => 'ErrorHandler::handleError',
  53. 'level' => E_ALL & ~E_DEPRECATED,
  54. 'trace' => true
  55. ));
  56. /**
  57. * Configure the Exception handler used for uncaught exceptions. By default,
  58. * ErrorHandler::handleException() is used. It will display a HTML page for the exception, and
  59. * while debug > 0, framework errors like Missing Controller will be displayed. When debug = 0,
  60. * framework errors will be coerced into generic HTTP errors.
  61. *
  62. * Options:
  63. *
  64. * - `handler` - callback - The callback to handle exceptions. You can set this to any callback type,
  65. * including anonymous functions.
  66. * Make sure you add App::uses('MyHandler', 'Error'); when using a custom handler class
  67. * - `renderer` - string - The class responsible for rendering uncaught exceptions. If you choose a custom class you
  68. * should place the file for that class in app/Lib/Error. This class needs to implement a render method.
  69. * - `log` - boolean - Should Exceptions be logged?
  70. *
  71. * @see ErrorHandler for more information on exception handling and configuration.
  72. */
  73. Configure::write('Exception', array(
  74. 'handler' => 'ErrorHandler::handleException',
  75. 'renderer' => 'ExceptionRenderer',
  76. 'log' => true
  77. ));
  78. /**
  79. * Application wide charset encoding
  80. */
  81. Configure::write('App.encoding', 'UTF-8');
  82. /**
  83. * To configure CakePHP *not* to use mod_rewrite and to
  84. * use CakePHP pretty URLs, remove these .htaccess
  85. * files:
  86. *
  87. * /.htaccess
  88. * /app/.htaccess
  89. * /app/webroot/.htaccess
  90. *
  91. * And uncomment the App.baseUrl below. But keep in mind
  92. * that plugin assets such as images, CSS and Javascript files
  93. * will not work without url rewriting!
  94. * To work around this issue you should either symlink or copy
  95. * the plugin assets into you app's webroot directory. This is
  96. * recommended even when you are using mod_rewrite. Handling static
  97. * assets through the Dispatcher is incredibly inefficient and
  98. * included primarily as a development convenience - and
  99. * thus not recommended for production applications.
  100. */
  101. //Configure::write('App.baseUrl', env('SCRIPT_NAME'));
  102. /**
  103. * Uncomment the define below to use CakePHP prefix routes.
  104. *
  105. * The value of the define determines the names of the routes
  106. * and their associated controller actions:
  107. *
  108. * Set to an array of prefixes you want to use in your application. Use for
  109. * admin or other prefixed routes.
  110. *
  111. * Routing.prefixes = array('admin', 'manager');
  112. *
  113. * Enables:
  114. * `admin_index()` and `/admin/controller/index`
  115. * `manager_index()` and `/manager/controller/index`
  116. *
  117. */
  118. //Configure::write('Routing.prefixes', array('admin'));
  119. /**
  120. * Turn off all caching application-wide.
  121. *
  122. */
  123. //Configure::write('Cache.disable', true);
  124. /**
  125. * Enable cache checking.
  126. *
  127. * If set to true, for view caching you must still use the controller
  128. * public $cacheAction inside your controllers to define caching settings.
  129. * You can either set it controller-wide by setting public $cacheAction = true,
  130. * or in each action using $this->cacheAction = true.
  131. *
  132. */
  133. //Configure::write('Cache.check', true);
  134. /**
  135. * Enable cache view prefixes.
  136. *
  137. * If set it will be prepended to the cache name for view file caching. This is
  138. * helpful if you deploy the same application via multiple subdomains and languages,
  139. * for instance. Each version can then have its own view cache namespace.
  140. * Note: The final cache file name will then be `prefix_cachefilename`.
  141. */
  142. //Configure::write('Cache.viewPrefix', 'prefix');
  143. /**
  144. * Session configuration.
  145. *
  146. * Contains an array of settings to use for session configuration. The defaults key is
  147. * used to define a default preset to use for sessions, any settings declared here will override
  148. * the settings of the default config.
  149. *
  150. * ## Options
  151. *
  152. * - `Session.cookie` - The name of the cookie to use. Defaults to 'CAKEPHP'
  153. * - `Session.timeout` - The number of minutes you want sessions to live for. This timeout is handled by CakePHP
  154. * - `Session.cookieTimeout` - The number of minutes you want session cookies to live for.
  155. * - `Session.checkAgent` - Do you want the user agent to be checked when starting sessions? You might want to set the
  156. * value to false, when dealing with older versions of IE, Chrome Frame or certain web-browsing devices and AJAX
  157. * - `Session.defaults` - The default configuration set to use as a basis for your session.
  158. * There are four builtins: php, cake, cache, database.
  159. * - `Session.handler` - Can be used to enable a custom session handler. Expects an array of callables,
  160. * that can be used with `session_save_handler`. Using this option will automatically add `session.save_handler`
  161. * to the ini array.
  162. * - `Session.autoRegenerate` - Enabling this setting, turns on automatic renewal of sessions, and
  163. * sessionids that change frequently. See CakeSession::$requestCountdown.
  164. * - `Session.ini` - An associative array of additional ini values to set.
  165. *
  166. * The built in defaults are:
  167. *
  168. * - 'php' - Uses settings defined in your php.ini.
  169. * - 'cake' - Saves session files in CakePHP's /tmp directory.
  170. * - 'database' - Uses CakePHP's database sessions.
  171. * - 'cache' - Use the Cache class to save sessions.
  172. *
  173. * To define a custom session handler, save it at /app/Model/Datasource/Session/<name>.php.
  174. * Make sure the class implements `CakeSessionHandlerInterface` and set Session.handler to <name>
  175. *
  176. * To use database sessions, run the app/Config/Schema/sessions.php schema using
  177. * the cake shell command: cake schema create Sessions
  178. *
  179. */
  180. Configure::write('Session', array(
  181. 'defaults' => 'php'
  182. ));
  183. /**
  184. * A random string used in security hashing methods.
  185. */
  186. Configure::write('Security.salt', '123456789');
  187. /**
  188. * A random numeric string (digits only) used to encrypt/decrypt strings.
  189. */
  190. Configure::write('Security.cipherSeed', '123456789');
  191. /**
  192. * Apply timestamps with the last modified time to static assets (js, css, images).
  193. * Will append a query string parameter containing the time the file was modified. This is
  194. * useful for invalidating browser caches.
  195. *
  196. * Set to `true` to apply timestamps when debug > 0. Set to 'force' to always enable
  197. * timestamping regardless of debug value.
  198. */
  199. //Configure::write('Asset.timestamp', true);
  200. /**
  201. * Compress CSS output by removing comments, whitespace, repeating tags, etc.
  202. * This requires a/var/cache directory to be writable by the web server for caching.
  203. * and /vendors/csspp/csspp.php
  204. *
  205. * To use, prefix the CSS link URL with '/ccss/' instead of '/css/' or use HtmlHelper::css().
  206. */
  207. //Configure::write('Asset.filter.css', 'css.php');
  208. /**
  209. * Plug in your own custom JavaScript compressor by dropping a script in your webroot to handle the
  210. * output, and setting the config below to the name of the script.
  211. *
  212. * To use, prefix your JavaScript link URLs with '/cjs/' instead of '/js/' or use JavaScriptHelper::link().
  213. */
  214. //Configure::write('Asset.filter.js', 'custom_javascript_output_filter.php');
  215. /**
  216. * The class name and database used in CakePHP's
  217. * access control lists.
  218. */
  219. Configure::write('Acl.classname', 'DbAcl');
  220. Configure::write('Acl.database', 'default');
  221. /**
  222. * Uncomment this line and correct your server timezone to fix
  223. * any date & time related errors.
  224. */
  225. //date_default_timezone_set('UTC');
  226. /**
  227. *
  228. * Cache Engine Configuration
  229. * Default settings provided below
  230. *
  231. * File storage engine.
  232. *
  233. * Cache::config('default', array(
  234. * 'engine' => 'File', //[required]
  235. * 'duration' => 3600, //[optional]
  236. * 'probability' => 100, //[optional]
  237. * 'path' => CACHE, //[optional] use system tmp directory - remember to use absolute path
  238. * 'prefix' => 'cake_', //[optional] prefix every cache file with this string
  239. * 'lock' => false, //[optional] use file locking
  240. * 'serialize' => true, [optional]
  241. * ));
  242. *
  243. * APC (http://pecl.php.net/package/APC)
  244. *
  245. * Cache::config('default', array(
  246. * 'engine' => 'Apc', //[required]
  247. * 'duration' => 3600, //[optional]
  248. * 'probability' => 100, //[optional]
  249. * 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
  250. * ));
  251. *
  252. * Xcache (http://xcache.lighttpd.net/)
  253. *
  254. * Cache::config('default', array(
  255. * 'engine' => 'Xcache', //[required]
  256. * 'duration' => 3600, //[optional]
  257. * 'probability' => 100, //[optional]
  258. * 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
  259. * 'user' => 'user', //user from xcache.admin.user settings
  260. * 'password' => 'password', //plaintext password (xcache.admin.pass)
  261. * ));
  262. *
  263. * Memcache (http://www.danga.com/memcached/)
  264. *
  265. * Cache::config('default', array(
  266. * 'engine' => 'Memcache', //[required]
  267. * 'duration' => 3600, //[optional]
  268. * 'probability' => 100, //[optional]
  269. * 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
  270. * 'servers' => array(
  271. * '127.0.0.1:11211' // localhost, default port 11211
  272. * ), //[optional]
  273. * 'persistent' => true, // [optional] set this to false for non-persistent connections
  274. * 'compress' => false, // [optional] compress data in Memcache (slower, but uses less memory)
  275. * ));
  276. *
  277. * Wincache (http://php.net/wincache)
  278. *
  279. * Cache::config('default', array(
  280. * 'engine' => 'Wincache', //[required]
  281. * 'duration' => 3600, //[optional]
  282. * 'probability' => 100, //[optional]
  283. * 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
  284. * ));
  285. */
  286. /**
  287. * Configure the cache handlers that CakePHP will use for internal
  288. * metadata like class maps, and model schema.
  289. *
  290. * By default File is used, but for improved performance you should use APC.
  291. *
  292. * Note: 'default' and other application caches should be configured in app/Config/bootstrap.php.
  293. * Please check the comments in bootstrap.php for more info on the cache engines available
  294. * and their settings.
  295. */
  296. $engine = 'File';
  297. // In development mode, caches should expire quickly.
  298. $duration = '+999 days';
  299. if (Configure::read('debug') > 0) {
  300. $duration = '+10 seconds';
  301. }
  302. // Prefix each application on the same server with a different string, to avoid Memcache and APC conflicts.
  303. $prefix = 'myapp_';
  304. /**
  305. * Configure the cache used for general framework caching. Path information,
  306. * object listings, and translation cache files are stored with this configuration.
  307. */
  308. Cache::config('_cake_core_', array(
  309. 'engine' => $engine,
  310. 'prefix' => $prefix . 'cake_core_',
  311. 'path' => CACHE . 'persistent' . DS,
  312. 'serialize' => ($engine === 'File'),
  313. 'duration' => $duration
  314. ));
  315. /**
  316. * Configure the cache for model and datasource caches. This cache configuration
  317. * is used to store schema descriptions, and table listings in connections.
  318. */
  319. Cache::config('_cake_model_', array(
  320. 'engine' => $engine,
  321. 'prefix' => $prefix . 'cake_model_',
  322. 'path' => CACHE . 'models' . DS,
  323. 'serialize' => ($engine === 'File'),
  324. 'duration' => $duration
  325. ));