diff --git a/.phpstorm.meta.php b/.phpstorm.meta.php index 5acf91bd..5dc306bc 100644 --- a/.phpstorm.meta.php +++ b/.phpstorm.meta.php @@ -2,6 +2,7 @@ namespace PHPSTORM_META; use Psr\Container\ContainerInterface; +use Zend\ServiceManager\ServiceManager; /** * PhpStorm Container Interop code completion @@ -16,4 +17,7 @@ $STATIC_METHOD_TYPES = [ ContainerInterface::get('') => [ '' == '@', ], + ServiceManager::build('') => [ + '' == '@', + ], ]; diff --git a/bin/install b/bin/install index 2a6bb2e1..b4147e10 100755 --- a/bin/install +++ b/bin/install @@ -1,16 +1,14 @@ #!/usr/bin/env php add($command); -$app->setDefaultCommand($command->getName()); -$app->run(); +$container = new ServiceManager(['factories' => [ + Application::class => InstallApplicationFactory::class, +]]); +$container->build(Application::class)->run(); diff --git a/bin/update b/bin/update index 223939b2..13c2a684 100755 --- a/bin/update +++ b/bin/update @@ -1,16 +1,14 @@ #!/usr/bin/env php add($command); -$app->setDefaultCommand($command->getName()); -$app->run(); +$container = new ServiceManager(['factories' => [ + Application::class => InstallApplicationFactory::class, +]]); +$container->build(Application::class, ['isUpdate' => true])->run(); diff --git a/module/CLI/src/Factory/InstallApplicationFactory.php b/module/CLI/src/Factory/InstallApplicationFactory.php new file mode 100644 index 00000000..2c5b5236 --- /dev/null +++ b/module/CLI/src/Factory/InstallApplicationFactory.php @@ -0,0 +1,41 @@ +add($command); + $app->setDefaultCommand($command->getName()); + + return $app; + } +}