#!/usr/bin/env php
<?php

require __DIR__ . '/vendor/autoload.php';

defined("STDIN") or define("STDIN", fopen("php://stdin", "r"));

define("APP_DIR", __DIR__ . '/App');
define("SYSTEM_DIR", __DIR__ . '/System');
define("PUBLIC_DIR", __DIR__ . '/public');
define("TEMPLATE_DIR", __DIR__ . '/Console/template');

/**
|
|	IceTea PHP Framework by Ammar Faizi
|
*/
if (count($argv) === 1) {
	print shell_exec("php ".realpath("vendor/ammarfaizi2/icetea-framework/src/Console/bin/fixer")." fix .");
	$prettyjson = json_encode(json_decode(file_get_contents(".php_cs.cache")), 128);
	file_put_contents(".php_cs.cache", $prettyjson);
	die;
}

$app	= new Console\IceTea();
$input  = new Console\Input\ArgvInput();
$loader = new Console\ConsoleLoader($input);


$app->run($input, $loader);
die($app->status);