#!/usr/bin/env php
<?php
/**
 * Yii console bootstrap file.
 *
 * @link http://www.yiiframework.com/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_PROJECT_BASE_PATH') or define('YII_PROJECT_BASE_PATH', dirname(dirname(dirname(__DIR__))));
defined('YII_APP_BASE_PATH') or define('YII_APP_BASE_PATH', YII_PROJECT_BASE_PATH);

require_once __DIR__ . '/../../autoload.php';

//require(__DIR__ . '/bootstrap.php');
\ant\base\Bootstrap::run(\ant\base\Bootstrap::INIT, YII_PROJECT_BASE_PATH, YII_APP_BASE_PATH);

$config = [
	'id' => 'init', 
	'basePath' => YII_PROJECT_BASE_PATH,
	'aliases' => [
		'@ant' => YII_APP_BASE_PATH,
		'@root' => YII_APP_BASE_PATH,
	],
    'controllerNamespace' => 'ant\console\controllers',
    'controllerMap' => [
        'init' => [
            'class' => 'ant\console\controllers\InitController',
        ],
	],
];

$application = new yii\console\Application($config);
$exitCode = $application->runAction('init/install', \ant\helpers\Console::getArguments());
exit($exitCode);