/
app.php
137 lines (124 loc) · 3.94 KB
/
app.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
/**
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.Config
* @since CakePHP(tm) v3.0.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
namespace App\Config;
use Cake\Core\Configure;
/**
* CakePHP Debug Level:
*
* Production Mode:
* 0: No error messages, errors, or warnings shown. Flash messages redirect.
*
* Development Mode:
* 1: Errors and warnings shown, model caches refreshed, flash messages halted.
* 2: As in 1, but also with full debug messages and SQL output.
*
* In production mode, flash messages redirect after a time interval.
* In development mode, you need to click the flash message to continue.
*/
Configure::write('debug', 2);
/**
* The root namespace your application uses. This should match
* the top level directory.
*/
$namespace = 'App';
/**
* Configure basic information about the application.
*
* - namespace - The namespace to find app classes under.
* - encoding - The encoding used for HTML + database connections.
* - baseUrl - To configure CakePHP *not* to use mod_rewrite and to
* use CakePHP pretty URLs, remove these .htaccess
* files:
* /.htaccess
* /app/.htaccess
* /app/webroot/.htaccess
* And uncomment the baseUrl key below.
* - base - The base directory the app resides in. If false this
* will be auto detected.
* - webroot - The webroot directory.
* - www_root - The file path to webroot.
*/
Configure::write('App', [
'namespace' => $namespace,
'encoding' => 'UTF-8',
'base' => false,
'baseUrl' => false,
//'baseUrl' => env('SCRIPT_NAME'),
'dir' => APP_DIR,
'webroot' => WEBROOT_DIR,
'www_root' => WWW_ROOT,
]);
/**
* Uncomment this line and correct your server timezone to fix
* any date & time related errors.
*/
//date_default_timezone_set('UTC');
/**
* Setup Security and hashing related values.
* The level of CakePHP security.
*
* - salt - A random string used in security hashing methods.
* - cipherSeed - A random numeric string (digits only) used to seed
* the xor cipher functions in Security.
*/
Configure::write('Security', [
'salt' => 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi',
'cipherSeed' => '76859309657453542496749683645',
]);
/**
* Apply timestamps with the last modified time to static assets (js, css, images).
* Will append a querystring parameter containing the time the file was modified. This is
* useful for invalidating browser caches.
*
* Set to `true` to apply timestamps when debug > 0. Set to 'force' to always enable
* timestamping regardless of debug value.
*/
//Configure::write('Asset.timestamp', true);
/**
* The classname and database used in CakePHP's
* access control lists.
*/
Configure::write('Acl', [
'database' => 'default',
'classname', 'DbAcl',
]);
/**
* Configure an autoloader for the App namespace.
*
* Use App\Controller\AppController as a test to see if composer
* support is being used.
*/
if (!class_exists('App\Controller\AppController')) {
(new \Cake\Core\ClassLoader($namespace, dirname(APP)))->register();
}
/**
* Define the FULL_BASE_URL used for link generation.
* In most cases the code below will generate the correct hostname.
* However, you can manually define the hostname to resolve any issues.
*/
$s = null;
if (env('HTTPS')) {
$s = 's';
}
$httpHost = env('HTTP_HOST');
if (isset($httpHost)) {
define('FULL_BASE_URL', 'http' . $s . '://' . $httpHost);
}
/**
* Configure the mbstring extension to use the correct encoding.
*/
$encoding = Configure::read('App.encoding');
mb_internal_encoding($encoding);
unset($httpHost, $s, $namespace, $encoding);