bootstrap.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <?php
  2. /**
  3. * This file is loaded automatically by the app/webroot/index.php file after core.php
  4. *
  5. * This file should load/create any application wide configuration settings, such as
  6. * Caching, Logging, loading additional configuration files.
  7. *
  8. * You should also use this file to include any files that provide global functions/constants
  9. * that your application uses.
  10. *
  11. * PHP 5
  12. *
  13. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  14. * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
  15. *
  16. * Licensed under The MIT License
  17. * Redistributions of files must retain the above copyright notice.
  18. *
  19. * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
  20. * @link http://cakephp.org CakePHP(tm) Project
  21. * @package app.Config
  22. * @since CakePHP(tm) v 0.10.8.2117
  23. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  24. */
  25. namespace App\Config;
  26. use Cake\Core\App,
  27. Cake\Core\Configure,
  28. Cake\Core\Plugin,
  29. Cake\Cache\Cache,
  30. Cake\Log\Log,
  31. Cake\Utility\Inflector;
  32. /**
  33. * Cache Engine Configuration
  34. * Default settings provided below
  35. *
  36. * File storage engine.
  37. *
  38. * Cache::config('default', array(
  39. * 'engine' => 'File', //[required]
  40. * 'duration'=> 3600, //[optional]
  41. * 'probability'=> 100, //[optional]
  42. * 'path' => CACHE, //[optional] use system tmp directory - remember to use absolute path
  43. * 'prefix' => 'cake_', //[optional] prefix every cache file with this string
  44. * 'lock' => false, //[optional] use file locking
  45. * 'serialize' => true, // [optional]
  46. * 'mask' => 0666, // [optional] permission mask to use when creating cache files
  47. * ));
  48. *
  49. * APC (http://pecl.php.net/package/APC)
  50. *
  51. * Cache::config('default', array(
  52. * 'engine' => 'Apc', //[required]
  53. * 'duration'=> 3600, //[optional]
  54. * 'probability'=> 100, //[optional]
  55. * 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
  56. * ));
  57. *
  58. * Xcache (http://xcache.lighttpd.net/)
  59. *
  60. * Cache::config('default', array(
  61. * 'engine' => 'Xcache', //[required]
  62. * 'duration'=> 3600, //[optional]
  63. * 'probability'=> 100, //[optional]
  64. * 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
  65. * 'user' => 'user', //user from xcache.admin.user settings
  66. * 'password' => 'password', //plaintext password (xcache.admin.pass)
  67. * ));
  68. *
  69. * Memcache (http://memcached.org/)
  70. *
  71. * Cache::config('default', array(
  72. * 'engine' => 'Memcache', //[required]
  73. * 'duration'=> 3600, //[optional]
  74. * 'probability'=> 100, //[optional]
  75. * 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
  76. * 'servers' => array(
  77. * '127.0.0.1:11211' // localhost, default port 11211
  78. * ), //[optional]
  79. * 'persistent' => true, // [optional] set this to false for non-persistent connections
  80. * 'compress' => false, // [optional] compress data in Memcache (slower, but uses less memory)
  81. * ));
  82. *
  83. * Wincache (http://php.net/wincache)
  84. *
  85. * Cache::config('default', array(
  86. * 'engine' => 'Wincache', //[required]
  87. * 'duration'=> 3600, //[optional]
  88. * 'probability'=> 100, //[optional]
  89. * 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
  90. * ));
  91. */
  92. Cache::config('default', array('engine' => 'File'));
  93. /**
  94. * The settings below can be used to set additional paths to models, views and controllers.
  95. *
  96. * App::build(array(
  97. * 'Model' => array('/path/to/models', '/next/path/to/models'),
  98. * 'Model/Behavior' => array('/path/to/behaviors', '/next/path/to/behaviors'),
  99. * 'Model/Datasource' => array('/path/to/datasources', '/next/path/to/datasources'),
  100. * 'Model/Datasource/Database' => array('/path/to/databases', '/next/path/to/database'),
  101. * 'Model/Datasource/Session' => array('/path/to/sessions', '/next/path/to/sessions'),
  102. * 'Controller' => array('/path/to/controllers', '/next/path/to/controllers'),
  103. * 'Controller/Component' => array('/path/to/components', '/next/path/to/components'),
  104. * 'Controller/Component/Auth' => array('/path/to/auths', '/next/path/to/auths'),
  105. * 'Controller/Component/Acl' => array('/path/to/acls', '/next/path/to/acls'),
  106. * 'View' => array('/path/to/views', '/next/path/to/views'),
  107. * 'View/Helper' => array('/path/to/helpers', '/next/path/to/helpers'),
  108. * 'Console' => array('/path/to/consoles', '/next/path/to/consoles'),
  109. * 'Console/Command' => array('/path/to/commands', '/next/path/to/commands'),
  110. * 'Console/Command/Task' => array('/path/to/tasks', '/next/path/to/tasks'),
  111. * 'Lib' => array('/path/to/libs', '/next/path/to/libs'),
  112. * 'Locale' => array('/path/to/locales', '/next/path/to/locales'),
  113. * 'Vendor' => array('/path/to/vendors', '/next/path/to/vendors'),
  114. * 'Plugin' => array('/path/to/plugins', '/next/path/to/plugins'),
  115. * ));
  116. *
  117. */
  118. /**
  119. * Custom Inflector rules, can be set to correctly pluralize or singularize table, model, controller names or whatever other
  120. * string is passed to the inflection functions
  121. *
  122. * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
  123. * Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
  124. *
  125. */
  126. /**
  127. * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call
  128. * Uncomment one of the lines below, as you need. make sure you read the documentation on Plugin to use more
  129. * advanced ways of loading plugins
  130. *
  131. * Plugin::loadAll(); // Loads all plugins at once
  132. * Plugin::load('DebugKit'); //Loads a single plugin named DebugKit
  133. *
  134. */
  135. /**
  136. * You can attach event listeners to the request lifecyle as Dispatcher Filter . By Default CakePHP bundles two filters:
  137. *
  138. * - AssetDispatcher filter will serve your asset files (css, images, js, etc) from your themes and plugins
  139. * - CacheDispatcher filter will read the Cache.check configure variable and try to serve cached content generated from controllers
  140. *
  141. * Feel free to remove or add filters as you see fit for your application. A few examples:
  142. *
  143. * Configure::write('Dispatcher.filters', array(
  144. * 'MyCacheFilter', // will use MyCacheFilter class from the Routing/Filter package in your app.
  145. * 'MyPlugin.MyFilter', // will use MyFilter class from the Routing/Filter package in MyPlugin plugin.
  146. * array('callable' => $aFunction, 'on' => 'before', 'priority' => 9), // A valid PHP callback type to be called on beforeDispatch
  147. * array('callable' => $anotherMethod, 'on' => 'after'), // A valid PHP callback type to be called on afterDispatch
  148. *
  149. * ));
  150. */
  151. Configure::write('Dispatcher.filters', array(
  152. 'AssetDispatcher',
  153. 'CacheDispatcher'
  154. ));
  155. /**
  156. * Configures default file logging options
  157. */
  158. Log::config('debug', array(
  159. 'engine' => 'Cake\Log\Engine\FileLog',
  160. 'types' => array('notice', 'info', 'debug'),
  161. 'file' => 'debug',
  162. ));
  163. Log::config('error', array(
  164. 'engine' => 'Cake\Log\Engine\FileLog',
  165. 'types' => array('warning', 'error', 'critical', 'alert', 'emergency'),
  166. 'file' => 'error',
  167. ));