Skip to content

Commit b7e099b

Browse files
committed
Add config/app.php
1 parent 4f7724d commit b7e099b

File tree

1 file changed

+342
-0
lines changed

1 file changed

+342
-0
lines changed

cake-3.2/config/app.php

+342
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,342 @@
1+
<?php
2+
return [
3+
/**
4+
* Debug Level:
5+
*
6+
* Production Mode:
7+
* false: No error messages, errors, or warnings shown.
8+
*
9+
* Development Mode:
10+
* true: Errors and warnings shown.
11+
*/
12+
'debug' => false,
13+
14+
/**
15+
* Configure basic information about the application.
16+
*
17+
* - namespace - The namespace to find app classes under.
18+
* - encoding - The encoding used for HTML + database connections.
19+
* - base - The base directory the app resides in. If false this
20+
* will be auto detected.
21+
* - dir - Name of app directory.
22+
* - webroot - The webroot directory.
23+
* - wwwRoot - The file path to webroot.
24+
* - baseUrl - To configure CakePHP to *not* use mod_rewrite and to
25+
* use CakePHP pretty URLs, remove these .htaccess
26+
* files:
27+
* /.htaccess
28+
* /webroot/.htaccess
29+
* And uncomment the baseUrl key below.
30+
* - fullBaseUrl - A base URL to use for absolute links.
31+
* - imageBaseUrl - Web path to the public images directory under webroot.
32+
* - cssBaseUrl - Web path to the public css directory under webroot.
33+
* - jsBaseUrl - Web path to the public js directory under webroot.
34+
* - paths - Configure paths for non class based resources. Supports the
35+
* `plugins`, `templates`, `locales` subkeys, which allow the definition of
36+
* paths for plugins, view templates and locale files respectively.
37+
*/
38+
'App' => [
39+
'namespace' => 'App',
40+
'encoding' => env('APP_ENCODING', 'UTF-8'),
41+
'defaultLocale' => env('APP_DEFAULT_LOCALE', 'en_US'),
42+
'base' => false,
43+
'dir' => 'src',
44+
'webroot' => 'webroot',
45+
'wwwRoot' => WWW_ROOT,
46+
// 'baseUrl' => env('SCRIPT_NAME'),
47+
'fullBaseUrl' => false,
48+
'imageBaseUrl' => 'img/',
49+
'cssBaseUrl' => 'css/',
50+
'jsBaseUrl' => 'js/',
51+
'paths' => [
52+
'plugins' => [ROOT . DS . 'plugins' . DS],
53+
'templates' => [APP . 'Template' . DS],
54+
'locales' => [APP . 'Locale' . DS],
55+
],
56+
],
57+
58+
/**
59+
* Security and encryption configuration
60+
*
61+
* - salt - A random string used in security hashing methods.
62+
* The salt value is also used as the encryption key.
63+
* You should treat it as extremely sensitive data.
64+
*/
65+
'Security' => [
66+
'salt' => env('SECURITY_SALT', '6110aab18271edb4f0ed1157133ca7a9cd0a547186ff01114a9970a3cc13f2c8'),
67+
],
68+
69+
/**
70+
* Apply timestamps with the last modified time to static assets (js, css, images).
71+
* Will append a querystring parameter containing the time the file was modified.
72+
* This is useful for busting browser caches.
73+
*
74+
* Set to true to apply timestamps when debug is true. Set to 'force' to always
75+
* enable timestamping regardless of debug value.
76+
*/
77+
'Asset' => [
78+
// 'timestamp' => true,
79+
],
80+
81+
/**
82+
* Configure the cache adapters.
83+
*/
84+
'Cache' => [
85+
'default' => [
86+
'className' => 'File',
87+
'path' => CACHE,
88+
'url' => env('CACHE_DEFAULT_URL', null),
89+
],
90+
91+
/**
92+
* Configure the cache used for general framework caching.
93+
* Translation cache files are stored with this configuration.
94+
* Duration will be set to '+1 year' in bootstrap.php when debug = false
95+
*/
96+
'_cake_core_' => [
97+
'className' => 'File',
98+
'prefix' => 'myapp_cake_core_',
99+
'path' => CACHE . 'persistent/',
100+
'serialize' => true,
101+
'duration' => '+2 minutes',
102+
'url' => env('CACHE_CAKECORE_URL', null),
103+
],
104+
105+
/**
106+
* Configure the cache for model and datasource caches. This cache
107+
* configuration is used to store schema descriptions, and table listings
108+
* in connections.
109+
* Duration will be set to '+1 year' in bootstrap.php when debug = false
110+
*/
111+
'_cake_model_' => [
112+
'className' => 'File',
113+
'prefix' => 'myapp_cake_model_',
114+
'path' => CACHE . 'models/',
115+
'serialize' => true,
116+
'duration' => '+2 minutes',
117+
'url' => env('CACHE_CAKEMODEL_URL', null),
118+
],
119+
],
120+
121+
/**
122+
* Configure the Error and Exception handlers used by your application.
123+
*
124+
* By default errors are displayed using Debugger, when debug is true and logged
125+
* by Cake\Log\Log when debug is false.
126+
*
127+
* In CLI environments exceptions will be printed to stderr with a backtrace.
128+
* In web environments an HTML page will be displayed for the exception.
129+
* With debug true, framework errors like Missing Controller will be displayed.
130+
* When debug is false, framework errors will be coerced into generic HTTP errors.
131+
*
132+
* Options:
133+
*
134+
* - `errorLevel` - int - The level of errors you are interested in capturing.
135+
* - `trace` - boolean - Whether or not backtraces should be included in
136+
* logged errors/exceptions.
137+
* - `log` - boolean - Whether or not you want exceptions logged.
138+
* - `exceptionRenderer` - string - The class responsible for rendering
139+
* uncaught exceptions. If you choose a custom class you should place
140+
* the file for that class in src/Error. This class needs to implement a
141+
* render method.
142+
* - `skipLog` - array - List of exceptions to skip for logging. Exceptions that
143+
* extend one of the listed exceptions will also be skipped for logging.
144+
* E.g.:
145+
* `'skipLog' => ['Cake\Network\Exception\NotFoundException', 'Cake\Network\Exception\UnauthorizedException']`
146+
* - `extraFatalErrorMemory` - int - The number of megabytes to increase
147+
* the memory limit by when a fatal error is encountered. This allows
148+
* breathing room to complete logging or error handling.
149+
*/
150+
'Error' => [
151+
'errorLevel' => E_ALL & ~E_DEPRECATED,
152+
'exceptionRenderer' => 'Cake\Error\ExceptionRenderer',
153+
'skipLog' => [],
154+
'log' => true,
155+
'trace' => true,
156+
],
157+
158+
/**
159+
* Email configuration.
160+
*
161+
* By defining transports separately from delivery profiles you can easily
162+
* re-use transport configuration across multiple profiles.
163+
*
164+
* You can specify multiple configurations for production, development and
165+
* testing.
166+
*
167+
* Each transport needs a `className`. Valid options are as follows:
168+
*
169+
* Mail - Send using PHP mail function
170+
* Smtp - Send using SMTP
171+
* Debug - Do not send the email, just return the result
172+
*
173+
* You can add custom transports (or override existing transports) by adding the
174+
* appropriate file to src/Mailer/Transport. Transports should be named
175+
* 'YourTransport.php', where 'Your' is the name of the transport.
176+
*/
177+
'EmailTransport' => [
178+
'default' => [
179+
'className' => 'Mail',
180+
// The following keys are used in SMTP transports
181+
'host' => 'localhost',
182+
'port' => 25,
183+
'timeout' => 30,
184+
'username' => 'user',
185+
'password' => 'secret',
186+
'client' => null,
187+
'tls' => null,
188+
'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),
189+
],
190+
],
191+
192+
/**
193+
* Email delivery profiles
194+
*
195+
* Delivery profiles allow you to predefine various properties about email
196+
* messages from your application and give the settings a name. This saves
197+
* duplication across your application and makes maintenance and development
198+
* easier. Each profile accepts a number of keys. See `Cake\Mailer\Email`
199+
* for more information.
200+
*/
201+
'Email' => [
202+
'default' => [
203+
'transport' => 'default',
204+
'from' => 'you@localhost',
205+
//'charset' => 'utf-8',
206+
//'headerCharset' => 'utf-8',
207+
],
208+
],
209+
210+
/**
211+
* Connection information used by the ORM to connect
212+
* to your application's datastores.
213+
* Drivers include Mysql Postgres Sqlite Sqlserver
214+
* See vendor\cakephp\cakephp\src\Database\Driver for complete list
215+
*/
216+
'Datasources' => [
217+
'default' => [
218+
'className' => 'Cake\Database\Connection',
219+
'driver' => 'Cake\Database\Driver\Mysql',
220+
'persistent' => false,
221+
'host' => 'localhost',
222+
/**
223+
* CakePHP will use the default DB port based on the driver selected
224+
* MySQL on MAMP uses port 8889, MAMP users will want to uncomment
225+
* the following line and set the port accordingly
226+
*/
227+
//'port' => 'non_standard_port_number',
228+
'username' => 'my_app',
229+
'password' => 'secret',
230+
'database' => 'my_app',
231+
'encoding' => 'utf8',
232+
'timezone' => 'UTC',
233+
'flags' => [],
234+
'cacheMetadata' => true,
235+
'log' => false,
236+
237+
/**
238+
* Set identifier quoting to true if you are using reserved words or
239+
* special characters in your table or column names. Enabling this
240+
* setting will result in queries built using the Query Builder having
241+
* identifiers quoted when creating SQL. It should be noted that this
242+
* decreases performance because each query needs to be traversed and
243+
* manipulated before being executed.
244+
*/
245+
'quoteIdentifiers' => false,
246+
247+
/**
248+
* During development, if using MySQL < 5.6, uncommenting the
249+
* following line could boost the speed at which schema metadata is
250+
* fetched from the database. It can also be set directly with the
251+
* mysql configuration directive 'innodb_stats_on_metadata = 0'
252+
* which is the recommended value in production environments
253+
*/
254+
//'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
255+
256+
'url' => env('DATABASE_URL', null),
257+
],
258+
259+
/**
260+
* The test connection is used during the test suite.
261+
*/
262+
'test' => [
263+
'className' => 'Cake\Database\Connection',
264+
'driver' => 'Cake\Database\Driver\Mysql',
265+
'persistent' => false,
266+
'host' => 'localhost',
267+
//'port' => 'non_standard_port_number',
268+
'username' => 'my_app',
269+
'password' => 'secret',
270+
'database' => 'test_myapp',
271+
'encoding' => 'utf8',
272+
'timezone' => 'UTC',
273+
'cacheMetadata' => true,
274+
'quoteIdentifiers' => false,
275+
'log' => false,
276+
//'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
277+
'url' => env('DATABASE_TEST_URL', null),
278+
],
279+
],
280+
281+
/**
282+
* Configures logging options
283+
*/
284+
'Log' => [
285+
'debug' => [
286+
'className' => 'Cake\Log\Engine\FileLog',
287+
'path' => LOGS,
288+
'file' => 'debug',
289+
'levels' => ['notice', 'info', 'debug'],
290+
'url' => env('LOG_DEBUG_URL', null),
291+
],
292+
'error' => [
293+
'className' => 'Cake\Log\Engine\FileLog',
294+
'path' => LOGS,
295+
'file' => 'error',
296+
'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'],
297+
'url' => env('LOG_ERROR_URL', null),
298+
],
299+
],
300+
301+
/**
302+
* Session configuration.
303+
*
304+
* Contains an array of settings to use for session configuration. The
305+
* `defaults` key is used to define a default preset to use for sessions, any
306+
* settings declared here will override the settings of the default config.
307+
*
308+
* ## Options
309+
*
310+
* - `cookie` - The name of the cookie to use. Defaults to 'CAKEPHP'.
311+
* - `cookiePath` - The url path for which session cookie is set. Maps to the
312+
* `session.cookie_path` php.ini config. Defaults to base path of app.
313+
* - `timeout` - The time in minutes the session should be valid for.
314+
* Pass 0 to disable checking timeout.
315+
* Please note that php.ini's session.gc_maxlifetime must be equal to or greater
316+
* than the largest Session['timeout'] in all served websites for it to have the
317+
* desired effect.
318+
* - `defaults` - The default configuration set to use as a basis for your session.
319+
* There are four built-in options: php, cake, cache, database.
320+
* - `handler` - Can be used to enable a custom session handler. Expects an
321+
* array with at least the `engine` key, being the name of the Session engine
322+
* class to use for managing the session. CakePHP bundles the `CacheSession`
323+
* and `DatabaseSession` engines.
324+
* - `ini` - An associative array of additional ini values to set.
325+
*
326+
* The built-in `defaults` options are:
327+
*
328+
* - 'php' - Uses settings defined in your php.ini.
329+
* - 'cake' - Saves session files in CakePHP's /tmp directory.
330+
* - 'database' - Uses CakePHP's database sessions.
331+
* - 'cache' - Use the Cache class to save sessions.
332+
*
333+
* To define a custom session handler, save it at src/Network/Session/<name>.php.
334+
* Make sure the class implements PHP's `SessionHandlerInterface` and set
335+
* Session.handler to <name>
336+
*
337+
* To use database sessions, load the SQL file located at config/Schema/sessions.sql
338+
*/
339+
'Session' => [
340+
'defaults' => 'php',
341+
],
342+
];

0 commit comments

Comments
 (0)