mirror of
https://github.com/shlinkio/shlink.git
synced 2026-08-13 06:24:44 -05:00
Moved command and app creation logic to a factory for install scripts
This commit is contained in:
+6
-8
@@ -1,16 +1,14 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
use Shlinkio\Shlink\CLI\Command\Install\InstallCommand;
|
||||
use Shlinkio\Shlink\CLI\Factory\InstallApplicationFactory;
|
||||
use Symfony\Component\Console\Application;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
use Zend\Config\Writer\PhpArray;
|
||||
use Zend\ServiceManager\ServiceManager;
|
||||
|
||||
chdir(dirname(__DIR__));
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
$app = new Application();
|
||||
$command = new InstallCommand(new PhpArray(), new Filesystem());
|
||||
$app->add($command);
|
||||
$app->setDefaultCommand($command->getName());
|
||||
$app->run();
|
||||
$container = new ServiceManager(['factories' => [
|
||||
Application::class => InstallApplicationFactory::class,
|
||||
]]);
|
||||
$container->build(Application::class)->run();
|
||||
|
||||
Reference in New Issue
Block a user