mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Moved update and install duplicated code to common config file
This commit is contained in:
28
bin/install
28
bin/install
@@ -2,29 +2,11 @@
|
|||||||
<?php
|
<?php
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
use Shlinkio\Shlink\Installer\Factory\InstallApplicationFactory;
|
namespace Shlinkio\Shlink\Installer;
|
||||||
use Shlinkio\Shlink\Installer\Config\Plugin\DatabaseConfigCustomizer;
|
|
||||||
use Symfony\Component\Console\Application;
|
use Symfony\Component\Console\Application;
|
||||||
use Symfony\Component\Filesystem\Filesystem;
|
use Zend\ServiceManager\ServiceLocatorInterface;
|
||||||
use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
|
||||||
use Zend\ServiceManager\Factory\InvokableFactory;
|
|
||||||
use Zend\ServiceManager\ServiceManager;
|
|
||||||
|
|
||||||
chdir(dirname(__DIR__));
|
/** @var ServiceLocatorInterface $container */
|
||||||
|
$container = include __DIR__ . '/../config/install-container.php';
|
||||||
require __DIR__ . '/../vendor/autoload.php';
|
|
||||||
|
|
||||||
$container = new ServiceManager([
|
|
||||||
'factories' => [
|
|
||||||
Application::class => InstallApplicationFactory::class,
|
|
||||||
Filesystem::class => InvokableFactory::class,
|
|
||||||
],
|
|
||||||
'services' => [
|
|
||||||
'config' => [
|
|
||||||
ConfigAbstractFactory::class => [
|
|
||||||
DatabaseConfigCustomizer::class => [Filesystem::class]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
$container->build(Application::class)->run();
|
$container->build(Application::class)->run();
|
||||||
|
|||||||
28
bin/update
28
bin/update
@@ -2,29 +2,11 @@
|
|||||||
<?php
|
<?php
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
use Shlinkio\Shlink\Installer\Factory\InstallApplicationFactory;
|
namespace Shlinkio\Shlink\Installer;
|
||||||
use Shlinkio\Shlink\Installer\Config\Plugin\DatabaseConfigCustomizer;
|
|
||||||
use Symfony\Component\Console\Application;
|
use Symfony\Component\Console\Application;
|
||||||
use Symfony\Component\Filesystem\Filesystem;
|
use Zend\ServiceManager\ServiceLocatorInterface;
|
||||||
use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
|
||||||
use Zend\ServiceManager\Factory\InvokableFactory;
|
|
||||||
use Zend\ServiceManager\ServiceManager;
|
|
||||||
|
|
||||||
chdir(dirname(__DIR__));
|
/** @var ServiceLocatorInterface $container */
|
||||||
|
$container = include __DIR__ . '/../config/install-container.php';
|
||||||
require __DIR__ . '/../vendor/autoload.php';
|
|
||||||
|
|
||||||
$container = new ServiceManager([
|
|
||||||
'factories' => [
|
|
||||||
Application::class => InstallApplicationFactory::class,
|
|
||||||
Filesystem::class => InvokableFactory::class,
|
|
||||||
],
|
|
||||||
'services' => [
|
|
||||||
'config' => [
|
|
||||||
ConfigAbstractFactory::class => [
|
|
||||||
DatabaseConfigCustomizer::class => [Filesystem::class]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
$container->build(Application::class, ['isUpdate' => true])->run();
|
$container->build(Application::class, ['isUpdate' => true])->run();
|
||||||
|
|||||||
29
config/install-container.php
Normal file
29
config/install-container.php
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use Shlinkio\Shlink\Installer\Config\Plugin\DatabaseConfigCustomizer;
|
||||||
|
use Shlinkio\Shlink\Installer\Factory\InstallApplicationFactory;
|
||||||
|
use Symfony\Component\Console\Application;
|
||||||
|
use Symfony\Component\Filesystem\Filesystem;
|
||||||
|
use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
||||||
|
use Zend\ServiceManager\Factory\InvokableFactory;
|
||||||
|
use Zend\ServiceManager\ServiceManager;
|
||||||
|
|
||||||
|
chdir(dirname(__DIR__));
|
||||||
|
|
||||||
|
require __DIR__ . '/../vendor/autoload.php';
|
||||||
|
|
||||||
|
$container = new ServiceManager([
|
||||||
|
'factories' => [
|
||||||
|
Application::class => InstallApplicationFactory::class,
|
||||||
|
Filesystem::class => InvokableFactory::class,
|
||||||
|
],
|
||||||
|
'services' => [
|
||||||
|
'config' => [
|
||||||
|
ConfigAbstractFactory::class => [
|
||||||
|
DatabaseConfigCustomizer::class => [Filesystem::class],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
return $container;
|
||||||
Reference in New Issue
Block a user