#!/usr/bin/env php
<?php

$composer_sources = array(
  __DIR__ . '/../../autoload.php',
  __DIR__ . '/../vendor/autoload.php',
  __DIR__ . '/vendor/autoload.php',
);

foreach ($composer_sources as $file) {
  if (file_exists($file)) {
    define('COMPOSER_INSTALL', $file);
    break;
  }
}

if (!defined('COMPOSER_INSTALL')) {
  fwrite(
    STDERR,
    'You need to set up the project dependencies using Composer:' . PHP_EOL . PHP_EOL .
    '    composer install' . PHP_EOL . PHP_EOL .
    'You can learn all about Composer on https://getcomposer.org/.' . PHP_EOL
  );

  die(1);
}

require COMPOSER_INSTALL;

use EdisonLabs\PolicyVerification\Command\PolicyVerificationCommand;
use Symfony\Component\Console\Application;

// Register and run command.
$application = new Application();
$application->add(new PolicyVerificationCommand());
$application->setDefaultCommand('edisonlabs:policy-verification', TRUE);
$application->run();
