Base for a static organization website

core.php 14KB

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