-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
172 lines (144 loc) · 5.25 KB
/
index.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?php
/*
|--------------------------------------------------------------------------
| Path to the `statamic` folder
|--------------------------------------------------------------------------
|
| We know you love Statamic. That's why you're here. But you might not
| like putting folders where we've suggested. That's okay. Just do us
| a favor and let us know where you'd like them.
|
*/
$statamic = './statamic';
/*
|--------------------------------------------------------------------------
| Site Root
|--------------------------------------------------------------------------
|
| The site root is where your website is being served from. Most of the
| time it'll likely be in the webroot, so you can leave it as "/". But
| sometimes you need to move it. Maybe you're just using Statamic for
| a blog, or you're setting up locale subdirectories. Whatever the
| case, just specify it below.
|
*/
$site_root = '/';
/*
|--------------------------------------------------------------------------
| Rewrite URLs
|--------------------------------------------------------------------------
|
| If you're unable to use any kind of URL rewriting such as Apache htaccess
| or nginx rewrite rules, you can force the "index.php" into your URLs to
| tell Statamic to handle the request. This behavior is off by default.
|
*/
$rewrite_urls = true;
/*
|--------------------------------------------------------------------------
| Control Panel
|--------------------------------------------------------------------------
|
| The URL where you'll access the Control Panel. It's usually "cp"
| like http://statamic.com/cp, But if you want to change it, do
| it here. You may also disable the CP by setting to false.
|
*/
$control_panel = 'boss';
/*
|--------------------------------------------------------------------------
| Locale
|--------------------------------------------------------------------------
|
| We speak English, but not everyone does. Let us know which locale
| you'd like to be serving here.
|
*/
$locale = 'fr';
/*
|--------------------------------------------------------------------------
| Resources
|--------------------------------------------------------------------------
|
| Statamic routes its own assets (css, js, etc) and any addons' assets
| from a variable location. Depending on your setup, they might be
| below webroot, so this route lets us serve them from a public
| location. If you need to use the word `_resources` in your
| own URLs, you may go ahead and modify this setting.
|
*/
$resources = '_resources';
/*
|--------------------------------------------------------------------------
| Default Environment
|--------------------------------------------------------------------------
|
| Unless specified in your .env file using the APP_ENV key,
| this will be the name of your default environment.
|
*/
$environment = 'production';
/*
|--------------------------------------------------------------------------
| DANGER!$#@
|--------------------------------------------------------------------------
|
| Don't edit anything below here.
| Things might happen. Bad things.
|
*/
define('STATAMIC_ROOT', __DIR__);
define('RELATIVE_APP', $statamic);
define('APP', realpath(STATAMIC_ROOT . '/' . rtrim($statamic, '/')));
$bootstrap = APP . '/bootstrap/start.php';
if (! is_file($bootstrap)) {
if (function_exists('http_response_code')) {
http_response_code(503);
}
$msg = "<style>body{font:normal 16px/2 arial, sans-serif;}code{font:bold 14px/2 consolas,monospace;
background:#eee;padding:3px 5px;}</style>";
$msg .= "Uh oh. We couldn't find your <code>statamic</code> folder.<br>
Check that it's set correctly in <code>" . __FILE__ . "</code>";
exit($msg);
}
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| our application. We just need to utilize it! We'll simply require it
| into the script here so that we don't have to worry about manual
| loading any of our classes later on. It feels nice to relax.
|
*/
require APP . '/bootstrap/autoload.php';
/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/
$app = require_once $bootstrap;
/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/
$kernel = $app->make('Illuminate\Contracts\Http\Kernel');
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);