#!/usr/bin/env php
<?php
/**
 * This file is part of the Rhumsaa\Uuid library
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @copyright Copyright (c) 2013-2014 Ben Ramsey <http://benramsey.com>
 * @license http://opensource.org/licenses/MIT MIT
 */

date_default_timezone_set('UTC');

if (PHP_SAPI !== 'cli') {
    echo 'Warning: uuid should be invoked via the CLI version of PHP, not the ' . PHP_SAPI . ' SAPI' . PHP_EOL;
}

if (!file_exists(__DIR__ . '/../vendor/autoload.php')) {
    echo 'You must set up the project dependencies, run the following commands:' . PHP_EOL .
        'curl -sS https://getcomposer.org/installer | php' . PHP_EOL .
        'php composer.phar install' . PHP_EOL;
    exit(1);
}

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

use Rhumsaa\Uuid\Console\Application;
use Rhumsaa\Uuid\Console\Command;

$app = new Application();
$app->add(new Command\GenerateCommand());
$app->add(new Command\DecodeCommand());
$app->run();
