php-extension-check/bin/extension-check

21 rader
841 B
Plaintext
Normal vy Historik

2021-05-08 21:09:48 +00:00
#!/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));