-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathusher.php
executable file
·50 lines (42 loc) · 1.05 KB
/
usher.php
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* Usher.php
*
* PHP Version 5
*
* Main runner - loads configuration, finds and executes tasks
*
* @category Build
* @package Usher
* @author Chris Cornutt <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://github.com/enygma/usher
*/
namespace Usher;
require_once 'Lib/Loader.php';
ob_start();
try {
Lib\Loader::init();
Lib\Console::init();
Lib\Config::load();
}catch(\Exception $e){
Lib\Console\Output::msg('Error on setup: '.$e->getMessage());
die();
}
$projectName = Lib\Config::getOption('project.name');
Lib\Console\Output::msg('Executing project "'.$projectName.'"');
// get and execute our tasks
try {
$app = new Lib\Application();
$app->execute();
}catch(\Exception $e){
Lib\Console\Output::error('Error on build! ('.$e->getMessage().')');
}
if (Lib\Console::getOption('logFile') !== null) {
$output = ob_get_contents();
Lib\Utility\Logger::write($output);
}
if (Lib\Console::getOption('runQuiet') == true) {
ob_end_clean();
}
?>