~artur-barczynski/azsystem/trunk

« back to all changes in this revision

Viewing changes to app/Config/core.php

  • Committer: Artur Barczynski
  • Date: 2012-09-20 16:31:07 UTC
  • Revision ID: artur@arturkb.pl-20120920163107-oakeg1a4h9e6d37f
Init

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
 * This is core configuration file.
 
4
 *
 
5
 * Use it to configure core behavior of Cake.
 
6
 *
 
7
 * PHP 5
 
8
 *
 
9
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 
10
 * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 
11
 *
 
12
 * Licensed under The MIT License
 
13
 * Redistributions of files must retain the above copyright notice.
 
14
 *
 
15
 * @copyright     Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 
16
 * @link          http://cakephp.org CakePHP(tm) Project
 
17
 * @package       app.Config
 
18
 * @since         CakePHP(tm) v 0.2.9
 
19
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 
20
 */
 
21
 
 
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
/**
 
38
 * Configure the Error handler used to handle errors for your application.  By default
 
39
 * ErrorHandler::handleError() is used.  It will display errors using Debugger, when debug > 0
 
40
 * and log errors with CakeLog when debug = 0.
 
41
 *
 
42
 * Options:
 
43
 *
 
44
 * - `handler` - callback - The callback to handle errors. You can set this to any callable type,
 
45
 *    including anonymous functions.
 
46
 * - `level` - int - 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
/**
 
58
 * Configure the Exception handler used for uncaught exceptions.  By default,
 
59
 * ErrorHandler::handleException() is used. It will display a HTML page for the exception, and
 
60
 * while debug > 0, framework errors like Missing Controller will be displayed.  When debug = 0,
 
61
 * framework errors will be coerced into generic HTTP errors.
 
62
 *
 
63
 * Options:
 
64
 *
 
65
 * - `handler` - callback - The callback to handle exceptions. You can set this to any callback type,
 
66
 *   including anonymous functions.
 
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
 *
 
71
 * @see ErrorHandler for more information on exception handling and configuration.
 
72
 */
 
73
        Configure::write('Exception', array(
 
74
                'handler' => 'ErrorHandler::handleException',
 
75
                'renderer' => 'ExceptionRenderer',
 
76
                'log' => true
 
77
        ));
 
78
 
 
79
/**
 
80
 * Application wide charset encoding
 
81
 */
 
82
        Configure::write('App.encoding', 'UTF-8');
 
83
 
 
84
/**
 
85
 * To configure CakePHP *not* to use mod_rewrite and to
 
86
 * use CakePHP pretty URLs, remove these .htaccess
 
87
 * files:
 
88
 *
 
89
 * /.htaccess
 
90
 * /app/.htaccess
 
91
 * /app/webroot/.htaccess
 
92
 *
 
93
 * And uncomment the App.baseUrl below:
 
94
 */
 
95
        //Configure::write('App.baseUrl', env('SCRIPT_NAME'));
 
96
 
 
97
/**
 
98
 * Uncomment the define below to use CakePHP prefix routes.
 
99
 *
 
100
 * The value of the define determines the names of the routes
 
101
 * and their associated controller actions:
 
102
 *
 
103
 * Set to an array of prefixes you want to use in your application. Use for
 
104
 * admin or other prefixed routes.
 
105
 *
 
106
 *      Routing.prefixes = array('admin', 'manager');
 
107
 *
 
108
 * Enables:
 
109
 *      `admin_index()` and `/admin/controller/index`
 
110
 *      `manager_index()` and `/manager/controller/index`
 
111
 *
 
112
 */
 
113
        //Configure::write('Routing.prefixes', array('admin'));
 
114
 
 
115
/**
 
116
 * Turn off all caching application-wide.
 
117
 *
 
118
 */
 
119
        //Configure::write('Cache.disable', true);
 
120
 
 
121
/**
 
122
 * Enable cache checking.
 
123
 *
 
124
 * If set to true, for view caching you must still use the controller
 
125
 * public $cacheAction inside your controllers to define caching settings.
 
126
 * You can either set it controller-wide by setting public $cacheAction = true,
 
127
 * or in each action using $this->cacheAction = true.
 
128
 *
 
129
 */
 
130
        //Configure::write('Cache.check', true);
 
131
 
 
132
/**
 
133
 * Defines the default error type when using the log() function. Used for
 
134
 * differentiating error logging and debugging. Currently PHP supports LOG_DEBUG.
 
135
 */
 
136
        define('LOG_ERROR', LOG_ERR);
 
137
 
 
138
/**
 
139
 * Session configuration.
 
140
 *
 
141
 * Contains an array of settings to use for session configuration. The defaults key is
 
142
 * used to define a default preset to use for sessions, any settings declared here will override
 
143
 * the settings of the default config.
 
144
 *
 
145
 * ## Options
 
146
 *
 
147
 * - `Session.cookie` - The name of the cookie to use. Defaults to 'CAKEPHP'
 
148
 * - `Session.timeout` - The number of minutes you want sessions to live for. This timeout is handled by CakePHP
 
149
 * - `Session.cookieTimeout` - The number of minutes you want session cookies to live for.
 
150
 * - `Session.checkAgent` - Do you want the user agent to be checked when starting sessions? You might want to set the
 
151
 *    value to false, when dealing with older versions of IE, Chrome Frame or certain web-browsing devices and AJAX
 
152
 * - `Session.defaults` - The default configuration set to use as a basis for your session.
 
153
 *    There are four builtins: php, cake, cache, database.
 
154
 * - `Session.handler` - Can be used to enable a custom session handler.  Expects an array of of callables,
 
155
 *    that can be used with `session_save_handler`.  Using this option will automatically add `session.save_handler`
 
156
 *    to the ini array.
 
157
 * - `Session.autoRegenerate` - Enabling this setting, turns on automatic renewal of sessions, and
 
158
 *    sessionids that change frequently. See CakeSession::$requestCountdown.
 
159
 * - `Session.ini` - An associative array of additional ini values to set.
 
160
 *
 
161
 * The built in defaults are:
 
162
 *
 
163
 * - 'php' - Uses settings defined in your php.ini.
 
164
 * - 'cake' - Saves session files in CakePHP's /tmp directory.
 
165
 * - 'database' - Uses CakePHP's database sessions.
 
166
 * - 'cache' - Use the Cache class to save sessions.
 
167
 *
 
168
 * To define a custom session handler, save it at /app/Model/Datasource/Session/<name>.php.
 
169
 * Make sure the class implements `CakeSessionHandlerInterface` and set Session.handler to <name>
 
170
 *
 
171
 * To use database sessions, run the app/Config/Schema/sessions.php schema using
 
172
 * the cake shell command: cake schema create Sessions
 
173
 *
 
174
 */
 
175
        Configure::write('Session', array(
 
176
                'defaults' => 'php'
 
177
        ));
 
178
 
 
179
/**
 
180
 * The level of CakePHP security.
 
181
 */
 
182
        Configure::write('Security.level', 'medium');
 
183
 
 
184
/**
 
185
 * A random string used in security hashing methods.
 
186
 */
 
187
        Configure::write('Security.salt', 'DYartzone1920dsdadasd3333feffef');
 
188
 
 
189
/**
 
190
 * A random numeric string (digits only) used to encrypt/decrypt strings.
 
191
 */
 
192
        Configure::write('Security.cipherSeed', '7685artzone11997654kluska20111212');
 
193
 
 
194
/**
 
195
 * Apply timestamps with the last modified time to static assets (js, css, images).
 
196
 * Will append a querystring parameter containing the time the file was modified. This is
 
197
 * useful for invalidating browser caches.
 
198
 *
 
199
 * Set to `true` to apply timestamps when debug > 0. Set to 'force' to always enable
 
200
 * timestamping regardless of debug value.
 
201
 */
 
202
        //Configure::write('Asset.timestamp', true);
 
203
 
 
204
/**
 
205
 * Compress CSS output by removing comments, whitespace, repeating tags, etc.
 
206
 * This requires a/var/cache directory to be writable by the web server for caching.
 
207
 * and /vendors/csspp/csspp.php
 
208
 *
 
209
 * To use, prefix the CSS link URL with '/ccss/' instead of '/css/' or use HtmlHelper::css().
 
210
 */
 
211
        //Configure::write('Asset.filter.css', 'css.php');
 
212
 
 
213
/**
 
214
 * Plug in your own custom JavaScript compressor by dropping a script in your webroot to handle the
 
215
 * output, and setting the config below to the name of the script.
 
216
 *
 
217
 * To use, prefix your JavaScript link URLs with '/cjs/' instead of '/js/' or use JavaScriptHelper::link().
 
218
 */
 
219
        //Configure::write('Asset.filter.js', 'custom_javascript_output_filter.php');
 
220
 
 
221
/**
 
222
 * The classname and database used in CakePHP's
 
223
 * access control lists.
 
224
 */
 
225
        Configure::write('Acl.classname', 'DbAcl');
 
226
        Configure::write('Acl.database', 'default');
 
227
 
 
228
/**
 
229
 * Uncomment this line and correct your server timezone to fix 
 
230
 * any date & time related errors.
 
231
 */
 
232
        //date_default_timezone_set('UTC');
 
233
 
 
234
/**
 
235
 * Pick the caching engine to use.  If APC is enabled use it.
 
236
 * If running via cli - apc is disabled by default. ensure it's available and enabled in this case
 
237
 *
 
238
 * Note: 'default' and other application caches should be configured in app/Config/bootstrap.php.
 
239
 *       Please check the comments in boostrap.php for more info on the cache engines available 
 
240
 *       and their setttings.
 
241
 */
 
242
$engine = 'File';
 
243
if (extension_loaded('apc') && function_exists('apc_dec') && (php_sapi_name() !== 'cli' || ini_get('apc.enable_cli'))) {
 
244
        $engine = 'Apc';
 
245
}
 
246
 
 
247
// In development mode, caches should expire quickly.
 
248
$duration = '+999 days';
 
249
if (Configure::read('debug') >= 1) {
 
250
        $duration = '+10 seconds';
 
251
}
 
252
 
 
253
// Prefix each application on the same server with a different string, to avoid Memcache and APC conflicts.
 
254
$prefix = 'myapp_';
 
255
 
 
256
/**
 
257
 * Configure the cache used for general framework caching.  Path information,
 
258
 * object listings, and translation cache files are stored with this configuration.
 
259
 */
 
260
Cache::config('_cake_core_', array(
 
261
        'engine' => $engine,
 
262
        'prefix' => $prefix . 'cake_core_',
 
263
        'path' => CACHE . 'persistent' . DS,
 
264
        'serialize' => ($engine === 'File'),
 
265
        'duration' => $duration
 
266
));
 
267
 
 
268
/**
 
269
 * Configure the cache for model and datasource caches.  This cache configuration
 
270
 * is used to store schema descriptions, and table listings in connections.
 
271
 */
 
272
Cache::config('_cake_model_', array(
 
273
        'engine' => $engine,
 
274
        'prefix' => $prefix . 'cake_model_',
 
275
        'path' => CACHE . 'models' . DS,
 
276
        'serialize' => ($engine === 'File'),
 
277
        'duration' => $duration
 
278
));