1
0
php-extension-check/bin/extension-check
2021-05-08 23:09:48 +02:00

21 linhas
841 B
PHP
Ficheiro executável

#!/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));