bootstrap.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. // Setup a 'default' cache configuration for use in the application.
  26. Cache::config('default', array('engine' => 'File'));
  27. /**
  28. * The settings below can be used to set additional paths to models, views and controllers.
  29. *
  30. * App::build(array(
  31. * 'Model' => array('/path/to/models', '/next/path/to/models'),
  32. * 'Model/Behavior' => array('/path/to/behaviors', '/next/path/to/behaviors'),
  33. * 'Model/Datasource' => array('/path/to/datasources', '/next/path/to/datasources'),
  34. * 'Model/Datasource/Database' => array('/path/to/databases', '/next/path/to/database'),
  35. * 'Model/Datasource/Session' => array('/path/to/sessions', '/next/path/to/sessions'),
  36. * 'Controller' => array('/path/to/controllers', '/next/path/to/controllers'),
  37. * 'Controller/Component' => array('/path/to/components', '/next/path/to/components'),
  38. * 'Controller/Component/Auth' => array('/path/to/auths', '/next/path/to/auths'),
  39. * 'Controller/Component/Acl' => array('/path/to/acls', '/next/path/to/acls'),
  40. * 'View' => array('/path/to/views', '/next/path/to/views'),
  41. * 'View/Helper' => array('/path/to/helpers', '/next/path/to/helpers'),
  42. * 'Console' => array('/path/to/consoles', '/next/path/to/consoles'),
  43. * 'Console/Command' => array('/path/to/commands', '/next/path/to/commands'),
  44. * 'Console/Command/Task' => array('/path/to/tasks', '/next/path/to/tasks'),
  45. * 'Lib' => array('/path/to/libs', '/next/path/to/libs'),
  46. * 'Locale' => array('/path/to/locales', '/next/path/to/locales'),
  47. * 'Vendor' => array('/path/to/vendors', '/next/path/to/vendors'),
  48. * 'Plugin' => array('/path/to/plugins', '/next/path/to/plugins'),
  49. * ));
  50. *
  51. */
  52. /**
  53. * Custom Inflector rules, can be set to correctly pluralize or singularize table, model, controller names or whatever other
  54. * string is passed to the inflection functions
  55. *
  56. * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
  57. * Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
  58. *
  59. */
  60. /**
  61. * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call
  62. * Uncomment one of the lines below, as you need. make sure you read the documentation on CakePlugin to use more
  63. * advanced ways of loading plugins
  64. *
  65. * CakePlugin::loadAll(); // Loads all plugins at once
  66. * CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit
  67. *
  68. */
  69. /**
  70. * You can attach event listeners to the request lifecyle as Dispatcher Filter . By Default CakePHP bundles two filters:
  71. *
  72. * - AssetDispatcher filter will serve your asset files (css, images, js, etc) from your themes and plugins
  73. * - CacheDispatcher filter will read the Cache.check configure variable and try to serve cached content generated from controllers
  74. *
  75. * Feel free to remove or add filters as you see fit for your application. A few examples:
  76. *
  77. * Configure::write('Dispatcher.filters', array(
  78. * 'MyCacheFilter', // will use MyCacheFilter class from the Routing/Filter package in your app.
  79. * 'MyPlugin.MyFilter', // will use MyFilter class from the Routing/Filter package in MyPlugin plugin.
  80. * array('callbale' => $aFunction, 'on' => 'before', 'priority' => 9), // A valid PHP callback type to be called on beforeDispatch
  81. * array('callbale' => $anotherMethod, 'on' => 'after'), // A valid PHP callback type to be called on afterDispatch
  82. *
  83. * ));
  84. */
  85. Configure::write('Dispatcher.filters', array(
  86. 'AssetDispatcher',
  87. 'CacheDispatcher'
  88. ));
  89. /**
  90. * Configures default file logging options
  91. */
  92. App::uses('CakeLog', 'Log');
  93. CakeLog::config('debug', array(
  94. 'engine' => 'FileLog',
  95. 'types' => array('notice', 'info', 'debug'),
  96. 'file' => 'debug',
  97. ));
  98. CakeLog::config('error', array(
  99. 'engine' => 'FileLog',
  100. 'types' => array('warning', 'error', 'critical', 'alert', 'emergency'),
  101. 'file' => 'error',
  102. ));