core.php 10 KB

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