mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 17:23:12 +08:00
Removed plugin suffix on config ustomizers
This commit is contained in:
@@ -116,12 +116,12 @@ class InstallCommand extends Command
|
||||
|
||||
// Ask for custom config params
|
||||
foreach ([
|
||||
Plugin\DatabaseConfigCustomizerPlugin::class,
|
||||
Plugin\UrlShortenerConfigCustomizerPlugin::class,
|
||||
Plugin\LanguageConfigCustomizerPlugin::class,
|
||||
Plugin\ApplicationConfigCustomizerPlugin::class,
|
||||
Plugin\DatabaseConfigCustomizer::class,
|
||||
Plugin\UrlShortenerConfigCustomizer::class,
|
||||
Plugin\LanguageConfigCustomizer::class,
|
||||
Plugin\ApplicationConfigCustomizer::class,
|
||||
] as $pluginName) {
|
||||
/** @var Plugin\ConfigCustomizerPluginInterface $configCustomizer */
|
||||
/** @var Plugin\ConfigCustomizerInterface $configCustomizer */
|
||||
$configCustomizer = $this->configCustomizers->get($pluginName);
|
||||
$configCustomizer->process($this->io, $config);
|
||||
}
|
||||
|
||||
@@ -42,10 +42,10 @@ class InstallApplicationFactory implements FactoryInterface
|
||||
new PhpArray(),
|
||||
$container->get(Filesystem::class),
|
||||
new ConfigCustomizerPluginManager($container, ['factories' => [
|
||||
Plugin\DatabaseConfigCustomizerPlugin::class => ConfigAbstractFactory::class,
|
||||
Plugin\UrlShortenerConfigCustomizerPlugin::class => InvokableFactory::class,
|
||||
Plugin\LanguageConfigCustomizerPlugin::class => InvokableFactory::class,
|
||||
Plugin\ApplicationConfigCustomizerPlugin::class => InvokableFactory::class,
|
||||
Plugin\DatabaseConfigCustomizer::class => ConfigAbstractFactory::class,
|
||||
Plugin\UrlShortenerConfigCustomizer::class => InvokableFactory::class,
|
||||
Plugin\LanguageConfigCustomizer::class => InvokableFactory::class,
|
||||
Plugin\ApplicationConfigCustomizer::class => InvokableFactory::class,
|
||||
]]),
|
||||
$isUpdate
|
||||
);
|
||||
|
||||
@@ -3,10 +3,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace Shlinkio\Shlink\CLI\Install;
|
||||
|
||||
use Shlinkio\Shlink\CLI\Install\Plugin\ConfigCustomizerPluginInterface;
|
||||
use Shlinkio\Shlink\CLI\Install\Plugin\ConfigCustomizerInterface;
|
||||
use Zend\ServiceManager\AbstractPluginManager;
|
||||
|
||||
class ConfigCustomizerPluginManager extends AbstractPluginManager implements ConfigCustomizerPluginManagerInterface
|
||||
{
|
||||
protected $instanceOf = ConfigCustomizerPluginInterface::class;
|
||||
protected $instanceOf = ConfigCustomizerInterface::class;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Shlinkio\Shlink\CLI\Install\Plugin;
|
||||
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
|
||||
abstract class AbstractConfigCustomizerPlugin implements ConfigCustomizerPluginInterface
|
||||
abstract class AbstractConfigCustomizer implements ConfigCustomizerInterface
|
||||
{
|
||||
/**
|
||||
* @param SymfonyStyle $io
|
||||
@@ -7,7 +7,7 @@ use Shlinkio\Shlink\CLI\Model\CustomizableAppConfig;
|
||||
use Shlinkio\Shlink\Common\Util\StringUtilsTrait;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
|
||||
class ApplicationConfigCustomizerPlugin extends AbstractConfigCustomizerPlugin
|
||||
class ApplicationConfigCustomizer extends AbstractConfigCustomizer
|
||||
{
|
||||
use StringUtilsTrait;
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Shlinkio\Shlink\CLI\Install\Plugin;
|
||||
use Shlinkio\Shlink\CLI\Model\CustomizableAppConfig;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
|
||||
interface ConfigCustomizerPluginInterface
|
||||
interface ConfigCustomizerInterface
|
||||
{
|
||||
/**
|
||||
* @param SymfonyStyle $io
|
||||
@@ -8,7 +8,7 @@ use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Symfony\Component\Filesystem\Exception\IOException;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
|
||||
class DatabaseConfigCustomizerPlugin extends AbstractConfigCustomizerPlugin
|
||||
class DatabaseConfigCustomizer extends AbstractConfigCustomizer
|
||||
{
|
||||
const DATABASE_DRIVERS = [
|
||||
'MySQL' => 'pdo_mysql',
|
||||
@@ -6,7 +6,7 @@ namespace Shlinkio\Shlink\CLI\Install\Plugin;
|
||||
use Shlinkio\Shlink\CLI\Model\CustomizableAppConfig;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
|
||||
class LanguageConfigCustomizerPlugin extends AbstractConfigCustomizerPlugin
|
||||
class LanguageConfigCustomizer extends AbstractConfigCustomizer
|
||||
{
|
||||
const SUPPORTED_LANGUAGES = ['en', 'es'];
|
||||
|
||||
@@ -7,7 +7,7 @@ use Shlinkio\Shlink\CLI\Model\CustomizableAppConfig;
|
||||
use Shlinkio\Shlink\Core\Service\UrlShortener;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
|
||||
class UrlShortenerConfigCustomizerPlugin extends AbstractConfigCustomizerPlugin
|
||||
class UrlShortenerConfigCustomizer extends AbstractConfigCustomizer
|
||||
{
|
||||
/**
|
||||
* @param SymfonyStyle $io
|
||||
Reference in New Issue
Block a user