forked from marionnewlevant/craftcom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.php
58 lines (50 loc) · 1.55 KB
/
bootstrap.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
<?php
/**
* Craft web bootstrap file
*/
use craft\helpers\App;
switch ($_SERVER['HTTP_HOST']) {
case 'api.craftcms.com':
case 'api.craftcms.test':
case 'api.craftcms.nitro':
case 'api.craftcms.next':
case 'staging.api.craftcms.com':
case 'craftcmsapi.com':
define('CRAFT_SITE', 'api');
break;
case 'composer.craftcms.com':
case 'composer.craftcms.test':
case 'composer.craftcms.nitro':
define('CRAFT_SITE', 'composer');
break;
case 'id.craftcms.com':
case 'id.craftcms.test':
case 'id.craftcms.nitro':
case 'id.craftcms.next':
case 'staging.id.craftcms.com':
define('CRAFT_SITE', 'craftId');
break;
case 'plugins.craftcms.com':
case 'staging.plugins.craftcms.com':
case 'plugins.craftcms.test':
case 'plugins.craftcms.nitro':
case 'plugins.craftcms.next':
define('CRAFT_SITE', 'plugins');
break;
}
define('CRAFT_BASE_PATH', __DIR__);
define('CRAFT_VENDOR_PATH', CRAFT_BASE_PATH . '/vendor');
// Composer autoloader
require_once CRAFT_VENDOR_PATH . '/autoload.php';
// dotenv
if (class_exists('Dotenv\Dotenv') && file_exists(CRAFT_BASE_PATH.'/.env')) {
Dotenv\Dotenv::create(CRAFT_BASE_PATH)->load();
}
if ($storagePath = App::env('CRAFT_STORAGE_PATH')) {
define('CRAFT_STORAGE_PATH', $storagePath);
}
if ($keyPath = App::env('LICENSE_KEY_PATH')) {
define('CRAFT_LICENSE_KEY_PATH', $keyPath);
}
define('CRAFT_ENVIRONMENT', App::env('CRAFT_ENV') ?: 'prod');
return require CRAFT_VENDOR_PATH . '/craftcms/cms/bootstrap/web.php';