/app/Config/core.php

https://github.com/decapattack/fishbox · PHP · 388 lines · 40 code · 28 blank · 320 comment · 1 complexity · 09f68a74fd4a0fc292adf703ccf08525 MD5 · raw file

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