forked from Andycko/craft-cms-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcraft
executable file
·28 lines (23 loc) · 770 Bytes
/
craft
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
#!/usr/bin/env php
<?php
/**
* Craft console bootstrap file
*/
// Define path constants
define('CRAFT_BASE_PATH', __DIR__);
define('CRAFT_VENDOR_PATH', CRAFT_BASE_PATH . '/vendor');
// Load Composer's autoloader
require_once CRAFT_VENDOR_PATH . '/autoload.php';
// Load dotenv?
if (class_exists('Dotenv\Dotenv') && file_exists(CRAFT_BASE_PATH . '/.env')) {
Dotenv\Dotenv::create(CRAFT_BASE_PATH)->load();
}
// Define additional PHP constants
// (see https://craftcms.com/docs/3.x/config/#php-constants)
define('CRAFT_ENVIRONMENT', getenv('ENVIRONMENT') ?: 'production');
// ...
// Load and run Craft
/** @var craft\console\Application $app */
$app = require CRAFT_VENDOR_PATH . '/craftcms/cms/bootstrap/console.php';
$exitCode = $app->run();
exit($exitCode);