-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
cubex
35 lines (26 loc) · 968 Bytes
/
cubex
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
#!/usr/bin/env php
<?php
/**
* Cubex Console Application
*/
//Defining PHP_START will allow cubex to add an execution time header
define('PHP_START', microtime(true));
//These values are set for support within HHVM
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
defined('STDOUT') or define('STDOUT', fopen('php://stdout', 'w'));
defined('STDERR') or define('STDERR', fopen('php://stderr', 'w'));
//Include the composer autoloader
require_once __DIR__ . '/vendor/autoload.php';
//Create an instance of cubex, with the bin root defined
$app = new \Cubex\Cubex(__DIR__ . DIRECTORY_SEPARATOR . 'public/');
//Boot Cubex
$app->boot();
//Create a request object
$request = \Cubex\Http\Request::createConsoleRequest();
$app->instance('request', $request);
//Create a new console application
$console = \Cubex\Console\Console::withCubex($app);
//Execute the command and retrieve the exit code
$exit = $console->run();
$app->shutdown();
exit($exit);