#!/usr/bin/php
<?php
/**
 * Axo - Console Micro-Framework
 *
 * @author Adam Prickett <adam.prickett@ampersa.co.uk>
 * @license MIT
 * @copyright © Copyright Ampersa Ltd 2017.
 */

require 'vendor/autoload.php';

define('AXO_PATH', rtrim(dirname(__FILE__), '/').'/');

// Load DotEnv configuration from the root directory
$dotenv = new Dotenv\Dotenv(AXO_PATH);
$dotenv->load();

// Instantiate a new instance of the Axo Application. Apply the required Command
// directories for enumeration of Commands, including system commands if option
// is set within the configuration. Once enumerated, run the Application
$app = new System\Axo;

if (is_true(env('LOAD_SYSTEM_COMMANDS'))) {
    $app->addSystemCommands();
}

$app->addCommandDirectory('./commands', 'Commands');
$app->run();

return;
