#!/usr/bin/env php
<?php
/*
 * This file is part of the protoc-gen-php package.
 *
 * (c) Shuhei Tanuma <shuhei.tanuma@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

define("PROTOC_GEN_PHP_CLI_VERSION", "0.1.x-dev");

if (is_dir($vendor = getcwd() . '/vendor')) {
    require $vendor . '/autoload.php';
}

if (is_dir($vendor = __DIR__ . '/../vendor')) {
    require($vendor . '/autoload.php');
} elseif (is_dir($vendor = __DIR__ . '/../../..')) {
    require($vendor . '/autoload.php');
} else {
    die(
        'You must set up the project dependencies, run the following commands:' . PHP_EOL .
        'curl -s http://getcomposer.org/installer | php' . PHP_EOL .
        'php composer.phar install' . PHP_EOL
    );
}

$app = new protocolbuffers\console\Application(PROTOC_GEN_PHP_CLI_VERSION);
$app->run();
