23 lines
767 B
Plaintext
23 lines
767 B
Plaintext
|
|
#!/usr/bin/php
|
||
|
|
<?php
|
||
|
|
|
||
|
|
require __DIR__ . '/../vendor/autoload.php';
|
||
|
|
|
||
|
|
use Interop\Container\ContainerInterface;
|
||
|
|
use Symfony\Component\Console\Application;
|
||
|
|
use Symfony\Component\Console\CommandLoader\ContainerCommandLoader;
|
||
|
|
|
||
|
|
/** @var ContainerInterface $container */
|
||
|
|
$container = require __DIR__ . '/../config/container.php';
|
||
|
|
/** @var Application $application */
|
||
|
|
$application = $container->get(Application::class);
|
||
|
|
|
||
|
|
$commands = $container->get('config')['console']['commands'];
|
||
|
|
foreach ($commands as $command) {
|
||
|
|
$application->add($container->get($command));
|
||
|
|
}
|
||
|
|
$lazyCommands = $container->get('config')['console']['lazy_commands'];
|
||
|
|
$lazyLoader = new ContainerCommandLoader($container, $lazyCommands);
|
||
|
|
$application->setCommandLoader($lazyLoader);
|
||
|
|
$application->run();
|