#!/usr/bin/env php
<?php
/**
 * Created by PhpStorm.
 * User: janhuang
 * Date: 16/5/3
 * Time: 下午10:43
 * Github: https://www.github.com/janhuang
 * Coding: https://www.coding.net/janhuang
 * SegmentFault: http://segmentfault.com/u/janhuang
 * Blog: http://segmentfault.com/blog/janhuang
 * Gmail: bboyjanhuang@gmail.com
 * WebSite: http://www.janhuang.me
 */

$loader = null;

foreach ([__DIR__ . '/vendor/autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/../../../vendor/autoload.php'] as $autoload) {
    if (file_exists($autoload)) {
        $loader = include $autoload;
        break;
    }
}

if (null === $loader) {
    throw new RuntimeException("Composer in not install. Please reinstall composer in your env.");
}

$action = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : null;

$path = '.';

\FastD\BundleX\Bundle::init($path, $action);
