1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-08 17:56:52 +02:00

[ticket/16649] Upgrade to Symfony 5

PHPBB3-16649
This commit is contained in:
rxu
2020-12-01 13:10:45 +07:00
parent 7110b61df5
commit 19b12bf6ee
133 changed files with 524 additions and 190 deletions

View File

@@ -12,6 +12,7 @@
*/
namespace phpbb\console\command\extension;
use Symfony\Component\Console\Command\Command as symfony_command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
@@ -19,6 +20,9 @@ use Symfony\Component\Console\Style\SymfonyStyle;
class enable extends command
{
/**
* {@inheritdoc}
*/
protected function configure()
{
$this
@@ -32,6 +36,16 @@ class enable extends command
;
}
/**
* Executes the command extension:enable.
*
* Enables the specified extension
*
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
@@ -41,7 +55,7 @@ class enable extends command
if (!$this->manager->is_available($name))
{
$io->error($this->user->lang('CLI_EXTENSION_NOT_EXIST', $name));
return 1;
return symfony_command::FAILURE;
}
$extension = $this->manager->get_extension($name);
@@ -51,13 +65,13 @@ class enable extends command
$message = !empty($enableable) ? $enableable : $this->user->lang('CLI_EXTENSION_NOT_ENABLEABLE', $name);
$message = is_array($message) ? implode(PHP_EOL, $message) : $message;
$io->error($message);
return 1;
return symfony_command::FAILURE;
}
if ($this->manager->is_enabled($name))
{
$io->error($this->user->lang('CLI_EXTENSION_ENABLED', $name));
return 1;
return symfony_command::FAILURE;
}
$this->manager->enable($name);
@@ -68,12 +82,12 @@ class enable extends command
$this->log->add('admin', ANONYMOUS, '', 'LOG_EXT_ENABLE', time(), array($name));
$this->check_apcu_cache($io);
$io->success($this->user->lang('CLI_EXTENSION_ENABLE_SUCCESS', $name));
return 0;
return symfony_command::SUCCESS;
}
else
{
$io->error($this->user->lang('CLI_EXTENSION_ENABLE_FAILURE', $name));
return 1;
return symfony_command::FAILURE;
}
}
}