#!/usr/bin/env php
<?php
#require_once("vendor/autoload.php");
(@include_once __DIR__ . '/../vendor/autoload.php') || @include_once __DIR__ . '/../../../autoload.php';


set_time_limit(0);

$app = \Eccube\Application::getInstance();
$app->initialize();

// Console
$app->register(
    new \Knp\Provider\ConsoleServiceProvider(),
    array(
        'console.name' => 'EC-CUBE',
        'console.version' => \Eccube\Common\Constant::VERSION,
        'console.project_directory' => __DIR__ . "/.."
    )
);

// Migration
$app->register(new \Dbtlr\MigrationProvider\Provider\MigrationServiceProvider(), array(
    'db.migrations.path' => __DIR__ . '/../src/Eccube/Resource/doctrine/migration',
));

$app->boot();

$console = $app["console"];
$console->add(new Eccube\Command\RouterCommand($app));
$console->add(new Eccube\Command\CacheClearCommand($app));
$console->add(new Eccube\Command\PluginCommand($app));

$console->run();
