Files
luos/gulliver/bin/gulliver.php

39 lines
1.1 KiB
PHP
Raw Normal View History

2010-12-02 23:34:41 +00:00
<?php
2017-08-14 15:58:34 -04:00
use Illuminate\Foundation\Console\Kernel;
2011-01-17 15:09:57 +00:00
2017-08-14 15:58:34 -04:00
// Because laravel has a __ helper function, it's important we include the class.g file to ensure our __ is used.
require_once __DIR__ . '/../../bootstrap/autoload.php';
require_once __DIR__ . '/../../bootstrap/app.php';
$app->make(Kernel::class)->bootstrap();
error_reporting(error_reporting() & ~E_DEPRECATED & ~E_STRICT);
2017-08-10 18:51:28 -04:00
if (!PATH_THIRDPARTY) {
2010-12-02 23:34:41 +00:00
die("You must launch gulliver command line with the gulliver script\n");
2017-08-10 18:51:28 -04:00
}
require_once(PATH_CORE . 'config' . PATH_SEP . 'environments.php');
// trap -V before pake
if (in_array('-V', $argv) || in_array('--version', $argv)) {
printf("Gulliver version %s\n", pakeColor::colorize(trim(file_get_contents(PATH_GULLIVER . 'VERSION')), 'INFO'));
2010-12-02 23:34:41 +00:00
exit(0);
2017-08-10 18:51:28 -04:00
}
2010-12-02 23:34:41 +00:00
2017-08-10 18:51:28 -04:00
if (count($argv) <= 1) {
2010-12-02 23:34:41 +00:00
$argv[] = '-T';
2017-08-10 18:51:28 -04:00
}
2010-12-02 23:34:41 +00:00
2017-08-10 18:51:28 -04:00
// register tasks
$dir = PATH_GULLIVER_HOME . 'bin' . PATH_SEP . 'tasks';
$tasks = pakeFinder::type('file')->name('pake*.php')->in($dir);
2010-12-02 23:34:41 +00:00
2017-08-10 18:51:28 -04:00
foreach ($tasks as $task) {
2010-12-02 23:34:41 +00:00
include_once($task);
2017-08-10 18:51:28 -04:00
}
2010-12-02 23:34:41 +00:00
2017-08-10 18:51:28 -04:00
// run task
pakeApp::get_instance()->run(null, null, false);
2010-12-02 23:34:41 +00:00
2017-08-10 18:51:28 -04:00
exit(0);