bin/clover_reporter
#!/usr/bin/env php
<?php
$files = [
__DIR__ . '/../../../autoload.php',
__DIR__ . '/../../autoload.php',
__DIR__ . '/../vendor/autoload.php',
__DIR__ . '/vendor/autoload.php',
];
foreach ($files as $file) {
if (file_exists($file)) {
define('CLOVER_REPORTER_AUTOLOAD', $file);
break;
}
}
if (!defined('CLOVER_REPORTER_AUTOLOAD')) {
fwrite(
STDERR,
'You need to set up the project dependencies using Composer:'
. PHP_EOL . PHP_EOL
. ' curl -s http://getcomposer.org/installer | php'
. PHP_EOL
. ' composer install'
. PHP_EOL . PHP_EOL
. 'You can learn all about Composer on https://getcomposer.org/.'
. PHP_EOL . PHP_EOL
);
exit(1);
}
require CLOVER_REPORTER_AUTOLOAD;
use Symfony\Component\Console\Application;
use CloverReporter\Console\Commands;
$composer = json_decode(
file_get_contents(__DIR__ . '/../composer.json')
);
$command = new Commands;
$application = new Application;
$application->setName($composer->description);
$application->setVersion($composer->version);
$application->add($command);
$application->setDefaultCommand($command->getName(), true);
$application->run();