Base for a static organization website

core.php 13KB

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