PageRenderTime 44ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/app/Config/core.php

https://bitbucket.org/tlorens/cakefoundation
PHP | 289 lines | 52 code | 27 blank | 210 comment | 5 complexity | 8c96bca2ff7d606a89277a8f090255d0 MD5 | raw file
  1. <?php
  2. date_default_timezone_set('America/New_York');
  3. $HOSTNAME = php_uname('n');
  4. define('CAKE_ENV', isset($_SERVER['CAKE_ENV']) ? $_SERVER['CAKE_ENV'] : 'production');
  5. define('DATE_FORMAT', 'M dS, Y');
  6. define('SHORT_DATE_FORMAT', 'm-d-Y');
  7. define('DATE_TIME_FORMAT', 'm-d-Y h:i:s a');
  8. define('MAX_RESULTS', 25);
  9. /**
  10. * This is core configuration file.
  11. *
  12. * Use it to configure core behavior of Cake.
  13. *
  14. * PHP 5
  15. *
  16. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  17. * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
  18. *
  19. * Licensed under The MIT License
  20. * Redistributions of files must retain the above copyright notice.
  21. *
  22. * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
  23. * @link http://cakephp.org CakePHP(tm) Project
  24. * @package app.Config
  25. * @since CakePHP(tm) v 0.2.9
  26. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  27. */
  28. /**
  29. * CakePHP Debug Level:
  30. *
  31. * Production Mode:
  32. * 0: No error messages, errors, or warnings shown. Flash messages redirect.
  33. *
  34. * Development Mode:
  35. * 1: Errors and warnings shown, model caches refreshed, flash messages halted.
  36. * 2: As in 1, but also with full debug messages and SQL output.
  37. *
  38. * In production mode, flash messages redirect after a time interval.
  39. * In development mode, you need to click the flash message to continue.
  40. */
  41. Configure::write('debug', 2);
  42. /**
  43. * Configure the Error handler used to handle errors for your application. By default
  44. * ErrorHandler::handleError() is used. It will display errors using Debugger, when debug > 0
  45. * and log errors with CakeLog when debug = 0.
  46. *
  47. * Options:
  48. *
  49. * - `handler` - callback - The callback to handle errors. You can set this to any callable type,
  50. * including anonymous functions.
  51. * - `level` - int - The level of errors you are interested in capturing.
  52. * - `trace` - boolean - Include stack traces for errors in log files.
  53. *
  54. * @see ErrorHandler for more information on error handling and configuration.
  55. */
  56. Configure::write('Error', array(
  57. 'handler' => 'ErrorHandler::handleError',
  58. 'level' => E_ALL & ~E_DEPRECATED,
  59. 'trace' => true
  60. ));
  61. /**
  62. * Configure the Exception handler used for uncaught exceptions. By default,
  63. * ErrorHandler::handleException() is used. It will display a HTML page for the exception, and
  64. * while debug > 0, framework errors like Missing Controller will be displayed. When debug = 0,
  65. * framework errors will be coerced into generic HTTP errors.
  66. *
  67. * Options:
  68. *
  69. * - `handler` - callback - The callback to handle exceptions. You can set this to any callback type,
  70. * including anonymous functions.
  71. * - `renderer` - string - The class responsible for rendering uncaught exceptions. If you choose a custom class you
  72. * should place the file for that class in app/Lib/Error. This class needs to implement a render method.
  73. * - `log` - boolean - Should Exceptions be logged?
  74. *
  75. * @see ErrorHandler for more information on exception handling and configuration.
  76. */
  77. Configure::write('Exception', array(
  78. 'handler' => 'ErrorHandler::handleException',
  79. 'renderer' => 'ExceptionRenderer',
  80. 'log' => true
  81. ));
  82. /**
  83. * Application wide charset encoding
  84. */
  85. Configure::write('App.encoding', 'UTF-8');
  86. /**
  87. * To configure CakePHP *not* to use mod_rewrite and to
  88. * use CakePHP pretty URLs, remove these .htaccess
  89. * files:
  90. *
  91. * /.htaccess
  92. * /app/.htaccess
  93. * /app/webroot/.htaccess
  94. *
  95. * And uncomment the App.baseUrl below:
  96. */
  97. //Configure::write('App.baseUrl', env('SCRIPT_NAME'));
  98. /**
  99. * Uncomment the define below to use CakePHP prefix routes.
  100. *
  101. * The value of the define determines the names of the routes
  102. * and their associated controller actions:
  103. *
  104. * Set to an array of prefixes you want to use in your application. Use for
  105. * admin or other prefixed routes.
  106. *
  107. * Routing.prefixes = array('admin', 'manager');
  108. *
  109. * Enables:
  110. * `admin_index()` and `/admin/controller/index`
  111. * `manager_index()` and `/manager/controller/index`
  112. *
  113. */
  114. //Configure::write('Routing.prefixes', array('admin'));
  115. /**
  116. * Turn off all caching application-wide.
  117. *
  118. */
  119. //Configure::write('Cache.disable', true);
  120. /**
  121. * Enable cache checking.
  122. *
  123. * If set to true, for view caching you must still use the controller
  124. * public $cacheAction inside your controllers to define caching settings.
  125. * You can either set it controller-wide by setting public $cacheAction = true,
  126. * or in each action using $this->cacheAction = true.
  127. *
  128. */
  129. //Configure::write('Cache.check', true);
  130. /**
  131. * Defines the default error type when using the log() function. Used for
  132. * differentiating error logging and debugging. Currently PHP supports LOG_DEBUG.
  133. */
  134. define('LOG_ERROR', LOG_ERR);
  135. /**
  136. * Session configuration.
  137. *
  138. * Contains an array of settings to use for session configuration. The defaults key is
  139. * used to define a default preset to use for sessions, any settings declared here will override
  140. * the settings of the default config.
  141. *
  142. * ## Options
  143. *
  144. * - `Session.cookie` - The name of the cookie to use. Defaults to 'CAKEPHP'
  145. * - `Session.timeout` - The number of minutes you want sessions to live for. This timeout is handled by CakePHP
  146. * - `Session.cookieTimeout` - The number of minutes you want session cookies to live for.
  147. * - `Session.checkAgent` - Do you want the user agent to be checked when starting sessions? You might want to set the
  148. * value to false, when dealing with older versions of IE, Chrome Frame or certain web-browsing devices and AJAX
  149. * - `Session.defaults` - The default configuration set to use as a basis for your session.
  150. * There are four builtins: php, cake, cache, database.
  151. * - `Session.handler` - Can be used to enable a custom session handler. Expects an array of of callables,
  152. * that can be used with `session_save_handler`. Using this option will automatically add `session.save_handler`
  153. * to the ini array.
  154. * - `Session.autoRegenerate` - Enabling this setting, turns on automatic renewal of sessions, and
  155. * sessionids that change frequently. See CakeSession::$requestCountdown.
  156. * - `Session.ini` - An associative array of additional ini values to set.
  157. *
  158. * The built in defaults are:
  159. *
  160. * - 'php' - Uses settings defined in your php.ini.
  161. * - 'cake' - Saves session files in CakePHP's /tmp directory.
  162. * - 'database' - Uses CakePHP's database sessions.
  163. * - 'cache' - Use the Cache class to save sessions.
  164. *
  165. * To define a custom session handler, save it at /app/Model/Datasource/Session/<name>.php.
  166. * Make sure the class implements `CakeSessionHandlerInterface` and set Session.handler to <name>
  167. *
  168. * To use database sessions, run the app/Config/Schema/sessions.php schema using
  169. * the cake shell command: cake schema create Sessions
  170. *
  171. */
  172. Configure::write('Session', array(
  173. 'defaults' => 'php'
  174. ));
  175. /**
  176. * The level of CakePHP security.
  177. */
  178. Configure::write('Security.level', 'medium');
  179. /**
  180. * A random string used in security hashing methods.
  181. */
  182. Configure::write('Security.salt', 'DonLulfxKRzcS9t2i5HGv47KnhjfqtgCdSNWOAi0');
  183. /**
  184. * A random numeric string (digits only) used to encrypt/decrypt strings.
  185. */
  186. Configure::write('Security.cipherSeed', '5911236438515787517595355849559366824355400623339406045387571898');
  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. * Pick the caching engine to use. If APC is enabled use it.
  224. * If running via cli - apc is disabled by default. ensure it's available and enabled in this case
  225. *
  226. * Note: 'default' and other application caches should be configured in app/Config/bootstrap.php.
  227. * Please check the comments in boostrap.php for more info on the cache engines available
  228. * and their setttings.
  229. */
  230. $engine = 'File';
  231. if (extension_loaded('apc') && function_exists('apc_dec') && (php_sapi_name() !== 'cli' || ini_get('apc.enable_cli'))) {
  232. $engine = 'Apc';
  233. }
  234. // In development mode, caches should expire quickly.
  235. $duration = '+999 days';
  236. if (Configure::read('debug') >= 1) {
  237. $duration = '+10 seconds';
  238. }
  239. // Prefix each application on the same server with a different string, to avoid Memcache and APC conflicts.
  240. $prefix = 'myapp_';
  241. /**
  242. * Configure the cache used for general framework caching. Path information,
  243. * object listings, and translation cache files are stored with this configuration.
  244. */
  245. Cache::config('_cake_core_', array(
  246. 'engine' => $engine,
  247. 'prefix' => $prefix . 'cake_core_',
  248. 'path' => CACHE . 'persistent' . DS,
  249. 'serialize' => ($engine === 'File'),
  250. 'duration' => $duration
  251. ));
  252. /**
  253. * Configure the cache for model and datasource caches. This cache configuration
  254. * is used to store schema descriptions, and table listings in connections.
  255. */
  256. Cache::config('_cake_model_', array(
  257. 'engine' => $engine,
  258. 'prefix' => $prefix . 'cake_model_',
  259. 'path' => CACHE . 'models' . DS,
  260. 'serialize' => ($engine === 'File'),
  261. 'duration' => $duration
  262. ));