-
Notifications
You must be signed in to change notification settings - Fork 2
/
hatchet
30 lines (22 loc) · 962 Bytes
/
hatchet
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
<?php
// Prevent from running over HTTP
if( php_sapi_name() !== 'cli' ) {
die('Meant to be run from command line');
}
// Autoload dependencies and load environment variables
$basePath = __DIR__ . '/../../../../';
require_once($basePath . '/vendor/autoload.php');
require_once($basePath . '/config/application.php');
// This is a little gross but it does prevent the functions.php file from being loaded
// No idea if it has any other knock on impact?
define('WP_INSTALLING', true);
// Boot WordPress without attempting to load the theme template
define('WP_USE_THEMES', false);
require_once(ABSPATH . 'wp-load.php');
// Bootstrap Hatchet from the Container
$app = require_once('bootstrap/app.php');
$app->bind(Rareloop\Lumberjack\Exceptions\HandlerInterface::class, $app->make(Rareloop\Hatchet\Exceptions\Handler::class));
$hatchet = $app->make(Rareloop\Hatchet\Hatchet::class);
$hatchet->bootstrap();
// Execute the current command
$hatchet->run();