This repository has been archived by the owner on Apr 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/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)); | ||
|
||
//Include the composer autoloader | ||
require_once __DIR__ . '/vendor/autoload.php'; | ||
|
||
if(!\Packaged\Helpers\System::isWindows()) | ||
{ | ||
//Clear the screen | ||
echo "\033[2J\033[;H"; | ||
} | ||
|
||
//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); |