mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 23:33:13 +08:00
Unified config for installer tool
This commit is contained in:
@@ -14,21 +14,35 @@ chdir(dirname(__DIR__));
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
$container = new ServiceManager([
|
||||
'factories' => [
|
||||
Application::class => InstallApplicationFactory::class,
|
||||
Filesystem::class => InvokableFactory::class,
|
||||
],
|
||||
'services' => [
|
||||
'random-chars-generator' => function () {
|
||||
return str_shuffle(UrlShortenerOptions::DEFAULT_CHARS);
|
||||
},
|
||||
'config' => [
|
||||
ConfigAbstractFactory::class => [
|
||||
Plugin\DatabaseConfigCustomizer::class => [Filesystem::class],
|
||||
Plugin\UrlShortenerConfigCustomizer::class => ['random-chars-generator'],
|
||||
],
|
||||
$config = [
|
||||
'dependencies' => [
|
||||
'factories' => [
|
||||
Application::class => InstallApplicationFactory::class,
|
||||
Filesystem::class => InvokableFactory::class,
|
||||
],
|
||||
'services' => [
|
||||
'random-chars-generator' => function () {
|
||||
return str_shuffle(UrlShortenerOptions::DEFAULT_CHARS);
|
||||
},
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
'config_customizer_plugins' => [
|
||||
'factories' => [
|
||||
Plugin\DatabaseConfigCustomizer::class => ConfigAbstractFactory::class,
|
||||
Plugin\UrlShortenerConfigCustomizer::class => ConfigAbstractFactory::class,
|
||||
Plugin\LanguageConfigCustomizer::class => InvokableFactory::class,
|
||||
Plugin\ApplicationConfigCustomizer::class => InvokableFactory::class,
|
||||
],
|
||||
],
|
||||
|
||||
ConfigAbstractFactory::class => [
|
||||
Plugin\DatabaseConfigCustomizer::class => [Filesystem::class],
|
||||
Plugin\UrlShortenerConfigCustomizer::class => ['random-chars-generator'],
|
||||
],
|
||||
];
|
||||
|
||||
$container = new ServiceManager($config['dependencies']);
|
||||
$container->setService('config', $config);
|
||||
|
||||
return $container;
|
||||
|
||||
Reference in New Issue
Block a user