pictcode / app / Config / bootstrap.php @ 0b1b8047
履歴 | 表示 | アノテート | ダウンロード (5.226 KB)
| 1 | 635eef61 | spyder1211 | <?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 | * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||
| 12 | * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||
| 13 | *
|
||
| 14 | * Licensed under The MIT License
|
||
| 15 | * For full copyright and license information, please see the LICENSE.txt
|
||
| 16 | * Redistributions of files must retain the above copyright notice.
|
||
| 17 | *
|
||
| 18 | * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||
| 19 | * @link http://cakephp.org CakePHP(tm) Project
|
||
| 20 | * @package app.Config
|
||
| 21 | * @since CakePHP(tm) v 0.10.8.2117
|
||
| 22 | * @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||
| 23 | */
|
||
| 24 | |||
| 25 | // Setup a 'default' cache configuration for use in the application.
|
||
| 26 | Cache::config('default', array('engine' => 'File')); |
||
| 27 | |||
| 28 | /**
|
||
| 29 | * The settings below can be used to set additional paths to models, views and controllers.
|
||
| 30 | *
|
||
| 31 | * App::build(array(
|
||
| 32 | * 'Model' => array('/path/to/models/', '/next/path/to/models/'),
|
||
| 33 | * 'Model/Behavior' => array('/path/to/behaviors/', '/next/path/to/behaviors/'),
|
||
| 34 | * 'Model/Datasource' => array('/path/to/datasources/', '/next/path/to/datasources/'),
|
||
| 35 | * 'Model/Datasource/Database' => array('/path/to/databases/', '/next/path/to/database/'),
|
||
| 36 | * 'Model/Datasource/Session' => array('/path/to/sessions/', '/next/path/to/sessions/'),
|
||
| 37 | * 'Controller' => array('/path/to/controllers/', '/next/path/to/controllers/'),
|
||
| 38 | * 'Controller/Component' => array('/path/to/components/', '/next/path/to/components/'),
|
||
| 39 | * 'Controller/Component/Auth' => array('/path/to/auths/', '/next/path/to/auths/'),
|
||
| 40 | * 'Controller/Component/Acl' => array('/path/to/acls/', '/next/path/to/acls/'),
|
||
| 41 | * 'View' => array('/path/to/views/', '/next/path/to/views/'),
|
||
| 42 | * 'View/Helper' => array('/path/to/helpers/', '/next/path/to/helpers/'),
|
||
| 43 | * 'Console' => array('/path/to/consoles/', '/next/path/to/consoles/'),
|
||
| 44 | * 'Console/Command' => array('/path/to/commands/', '/next/path/to/commands/'),
|
||
| 45 | * 'Console/Command/Task' => array('/path/to/tasks/', '/next/path/to/tasks/'),
|
||
| 46 | * 'Lib' => array('/path/to/libs/', '/next/path/to/libs/'),
|
||
| 47 | * 'Locale' => array('/path/to/locales/', '/next/path/to/locales/'),
|
||
| 48 | * 'Vendor' => array('/path/to/vendors/', '/next/path/to/vendors/'),
|
||
| 49 | * 'Plugin' => array('/path/to/plugins/', '/next/path/to/plugins/'),
|
||
| 50 | * ));
|
||
| 51 | */
|
||
| 52 | |||
| 53 | /**
|
||
| 54 | * Custom Inflector rules can be set to correctly pluralize or singularize table, model, controller names or whatever other
|
||
| 55 | * string is passed to the inflection functions
|
||
| 56 | *
|
||
| 57 | * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
|
||
| 58 | * Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
|
||
| 59 | */
|
||
| 60 | |||
| 61 | /**
|
||
| 62 | * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call
|
||
| 63 | * Uncomment one of the lines below, as you need. Make sure you read the documentation on CakePlugin to use more
|
||
| 64 | * advanced ways of loading plugins
|
||
| 65 | *
|
||
| 66 | */
|
||
| 67 | 3bf0e002 | admin | |
| 68 | b821d57d | root | CakePlugin::loadAll(); // Loads all plugins at once |
| 69 | 635eef61 | spyder1211 | |
| 70 | /**
|
||
| 71 | * To prefer app translation over plugin translation, you can set
|
||
| 72 | *
|
||
| 73 | * Configure::write('I18n.preferApp', true);
|
||
| 74 | */
|
||
| 75 | |||
| 76 | /**
|
||
| 77 | * You can attach event listeners to the request lifecycle as Dispatcher Filter. By default CakePHP bundles two filters:
|
||
| 78 | *
|
||
| 79 | * - AssetDispatcher filter will serve your asset files (css, images, js, etc) from your themes and plugins
|
||
| 80 | * - CacheDispatcher filter will read the Cache.check configure variable and try to serve cached content generated from controllers
|
||
| 81 | *
|
||
| 82 | * Feel free to remove or add filters as you see fit for your application. A few examples:
|
||
| 83 | *
|
||
| 84 | * Configure::write('Dispatcher.filters', array(
|
||
| 85 | * 'MyCacheFilter', // will use MyCacheFilter class from the Routing/Filter package in your app.
|
||
| 86 | * 'MyCacheFilter' => array('prefix' => 'my_cache_'), // will use MyCacheFilter class from the Routing/Filter package in your app with settings array.
|
||
| 87 | * 'MyPlugin.MyFilter', // will use MyFilter class from the Routing/Filter package in MyPlugin plugin.
|
||
| 88 | * array('callable' => $aFunction, 'on' => 'before', 'priority' => 9), // A valid PHP callback type to be called on beforeDispatch
|
||
| 89 | * array('callable' => $anotherMethod, 'on' => 'after'), // A valid PHP callback type to be called on afterDispatch
|
||
| 90 | *
|
||
| 91 | * ));
|
||
| 92 | */
|
||
| 93 | Configure::write('Dispatcher.filters', array( |
||
| 94 | 'AssetDispatcher',
|
||
| 95 | 'CacheDispatcher'
|
||
| 96 | )); |
||
| 97 | |||
| 98 | /**
|
||
| 99 | * Configures default file logging options
|
||
| 100 | */
|
||
| 101 | App::uses('CakeLog', 'Log'); |
||
| 102 | CakeLog::config('debug', array( |
||
| 103 | 'engine' => 'File', |
||
| 104 | 'types' => array('notice', 'info', 'debug'), |
||
| 105 | 'file' => 'debug', |
||
| 106 | )); |
||
| 107 | CakeLog::config('error', array( |
||
| 108 | 'engine' => 'File', |
||
| 109 | 'types' => array('warning', 'error', 'critical', 'alert', 'emergency'), |
||
| 110 | 'file' => 'error', |
||
| 111 | )); |