21 lines
841 B
Plaintext
21 lines
841 B
Plaintext
|
#!/usr/bin/env php
|
||
|
<?php
|
||
|
require __DIR__.'/../vendor/autoload.php';
|
||
|
|
||
|
use Fbrinker\ExtensionCheck\Command\CheckCommand;
|
||
|
use Laminas\ServiceManager\ServiceManager;
|
||
|
use Symfony\Component\Console\Application;
|
||
|
use Symfony\Component\Console\Input\ArgvInput;
|
||
|
|
||
|
$serviceManager = new ServiceManager(require("config/serviceManager.php"));
|
||
|
$application = new Application();
|
||
|
|
||
|
$command = $serviceManager->get(CheckCommand::class);
|
||
|
$application->add($command);
|
||
|
|
||
|
// Prepend the command as default command to accept arguments and options if necessary
|
||
|
// Workaround, since the Symfony $application->setDefaultCommand() can't accept arguments or options
|
||
|
if (!isset($argv[1]) || $argv[1] !== CheckCommand::getDefaultName()) {
|
||
|
$argv = array_merge([$argv[0], CheckCommand::getDefaultName()], array_slice($argv, 1));
|
||
|
}
|
||
|
$application->run(new ArgvInput($argv));
|