|
35 | 35 |
|
36 | 36 | // You can remove this if you are confident you have intl installed.
|
37 | 37 | if (!extension_loaded('intl')) {
|
38 |
| - trigger_error('You must enable the intl extension to use CakePHP.', E_USER_ERROR); |
| 38 | + trigger_error('You must enable the intl extension to use CakePHP.', E_USER_ERROR); |
39 | 39 | }
|
40 | 40 |
|
41 | 41 | use Cake\Cache\Cache;
|
|
63 | 63 | * that changes from configuration that does not. This makes deployment simpler.
|
64 | 64 | */
|
65 | 65 | try {
|
66 |
| - Configure::config('default', new PhpConfig()); |
67 |
| - Configure::load('app', 'default', false); |
| 66 | + Configure::config('default', new PhpConfig()); |
| 67 | + Configure::load('app', 'default', false); |
68 | 68 | } catch (\Exception $e) {
|
69 |
| - exit($e->getMessage() . "\n"); |
| 69 | + exit($e->getMessage() . "\n"); |
70 | 70 | }
|
71 | 71 |
|
72 | 72 | // Load an environment local configuration file.
|
|
78 | 78 | // for a very very long time, as we don't want
|
79 | 79 | // to refresh the cache while users are doing requests.
|
80 | 80 | if (!Configure::read('debug')) {
|
81 |
| - Configure::write('Cache._cake_model_.duration', '+1 years'); |
82 |
| - Configure::write('Cache._cake_core_.duration', '+1 years'); |
| 81 | + Configure::write('Cache._cake_model_.duration', '+1 years'); |
| 82 | + Configure::write('Cache._cake_core_.duration', '+1 years'); |
83 | 83 | }
|
84 | 84 |
|
85 | 85 | /**
|
|
104 | 104 | */
|
105 | 105 | $isCli = PHP_SAPI === 'cli';
|
106 | 106 | if ($isCli) {
|
107 |
| - (new ConsoleErrorHandler(Configure::read('Error')))->register(); |
| 107 | + (new ConsoleErrorHandler(Configure::read('Error')))->register(); |
108 | 108 | } else {
|
109 |
| - (new ErrorHandler(Configure::read('Error')))->register(); |
| 109 | + (new ErrorHandler(Configure::read('Error')))->register(); |
110 | 110 | }
|
111 | 111 |
|
112 | 112 | // Include the CLI bootstrap overrides.
|
113 | 113 | if ($isCli) {
|
114 |
| - require __DIR__ . '/bootstrap_cli.php'; |
| 114 | + require __DIR__ . '/bootstrap_cli.php'; |
115 | 115 | }
|
116 | 116 |
|
117 | 117 | /**
|
|
121 | 121 | * If you define fullBaseUrl in your config file you can remove this.
|
122 | 122 | */
|
123 | 123 | if (!Configure::read('App.fullBaseUrl')) {
|
124 |
| - $s = null; |
125 |
| - if (env('HTTPS')) { |
126 |
| - $s = 's'; |
127 |
| - } |
128 |
| - |
129 |
| - $httpHost = env('HTTP_HOST'); |
130 |
| - if (isset($httpHost)) { |
131 |
| - Configure::write('App.fullBaseUrl', 'http' . $s . '://' . $httpHost); |
132 |
| - } |
133 |
| - unset($httpHost, $s); |
| 124 | + $s = null; |
| 125 | + if (env('HTTPS')) { |
| 126 | + $s = 's'; |
| 127 | + } |
| 128 | + |
| 129 | + $httpHost = env('HTTP_HOST'); |
| 130 | + if (isset($httpHost)) { |
| 131 | + Configure::write('App.fullBaseUrl', 'http' . $s . '://' . $httpHost); |
| 132 | + } |
| 133 | + unset($httpHost, $s); |
134 | 134 | }
|
135 | 135 |
|
136 | 136 | Cache::config(Configure::consume('Cache'));
|
|
151 | 151 | * Setup detectors for mobile and tablet.
|
152 | 152 | */
|
153 | 153 | Request::addDetector('mobile', function ($request) {
|
154 |
| - $detector = new \Detection\MobileDetect(); |
155 |
| - return $detector->isMobile(); |
| 154 | + $detector = new \Detection\MobileDetect(); |
| 155 | + return $detector->isMobile(); |
156 | 156 | });
|
157 | 157 | Request::addDetector('tablet', function ($request) {
|
158 |
| - $detector = new \Detection\MobileDetect(); |
159 |
| - return $detector->isTablet(); |
| 158 | + $detector = new \Detection\MobileDetect(); |
| 159 | + return $detector->isTablet(); |
160 | 160 | });
|
161 | 161 |
|
162 | 162 | /**
|
|
189 | 189 | // Only try to load DebugKit in development mode
|
190 | 190 | // Debug Kit should not be installed on a production system
|
191 | 191 | if (Configure::read('debug')) {
|
192 |
| - Plugin::load('DebugKit', ['bootstrap' => true]); |
| 192 | + Plugin::load('DebugKit', ['bootstrap' => true]); |
193 | 193 | }
|
194 | 194 |
|
195 | 195 | /**
|
|
206 | 206 | * Also enable immutable time objects in the ORM.
|
207 | 207 | */
|
208 | 208 | Type::build('time')
|
209 |
| - ->useImmutable() |
210 |
| - ->useLocaleParser(); |
| 209 | + ->useImmutable() |
| 210 | + ->useLocaleParser(); |
211 | 211 | Type::build('date')
|
212 |
| - ->useImmutable() |
213 |
| - ->useLocaleParser(); |
| 212 | + ->useImmutable() |
| 213 | + ->useLocaleParser(); |
214 | 214 | Type::build('datetime')
|
215 |
| - ->useImmutable() |
216 |
| - ->useLocaleParser(); |
| 215 | + ->useImmutable() |
| 216 | + ->useLocaleParser(); |
0 commit comments