phug-php/tester

View on GitHub
phug-tester

Summary

Maintainability
Test Coverage
#!/usr/bin/env php
<?php

use Phug\Tester\Cli;

$vendor = 'vendor';
$autoload = 'vendor/autoload.php';
if (!file_exists($autoload)) {
    $vendor = __DIR__.'/..';
    $autoload = __DIR__.'/../autoload.php';
}
if (!file_exists($autoload)) {
    $vendor = __DIR__.'/../..';
    $autoload = __DIR__.'/../../autoload.php';
}
if (!file_exists($autoload)) {
    $vendor = __DIR__.'/vendor';
    $autoload = __DIR__.'/vendor/autoload.php';
}
if (!file_exists($autoload)) {
    throw new \RuntimeException('Autoload not found. Please run: composer install');
}

include $autoload;

$cli = new Cli($vendor);

exit($cli->run($argv) ? 0 : 1);