1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-14 12:44:06 +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\config;
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;
@@ -20,8 +21,8 @@ use Symfony\Component\Console\Style\SymfonyStyle;
class delete extends command
{
/**
* {@inheritdoc}
*/
* {@inheritdoc}
*/
protected function configure()
{
$this
@@ -36,16 +37,16 @@ class delete extends command
}
/**
* Executes the command config:delete.
*
* Removes a configuration option
*
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*
* @return void
* @see \phpbb\config\config::delete()
*/
* Executes the command config:delete.
*
* Removes a configuration option
*
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*
* @return int
* @see \phpbb\config\config::delete()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
@@ -57,10 +58,13 @@ class delete extends command
$this->config->delete($key);
$io->success($this->user->lang('CLI_CONFIG_DELETE_SUCCESS', $key));
return symfony_command::SUCCESS;
}
else
{
$io->error($this->user->lang('CLI_CONFIG_NOT_EXISTS', $key));
return symfony_command::FAILURE;
}
}
}

View File

@@ -12,6 +12,7 @@
*/
namespace phpbb\console\command\config;
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\Input\InputOption;
@@ -50,7 +51,7 @@ class get extends command
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*
* @return void
* @return int
* @see \phpbb\config\config::offsetGet()
*/
protected function execute(InputInterface $input, OutputInterface $output)
@@ -62,14 +63,17 @@ class get extends command
if (isset($this->config[$key]) && $input->getOption('no-newline'))
{
$output->write($this->config[$key]);
return symfony_command::SUCCESS;
}
else if (isset($this->config[$key]))
{
$output->writeln($this->config[$key]);
return symfony_command::SUCCESS;
}
else
{
$io->error($this->user->lang('CLI_CONFIG_NOT_EXISTS', $key));
return symfony_command::FAILURE;
}
}
}

View File

@@ -12,6 +12,7 @@
*/
namespace phpbb\console\command\config;
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\Input\InputOption;
@@ -55,7 +56,7 @@ class increment extends command
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*
* @return void
* @return int
* @see \phpbb\config\config::increment()
*/
protected function execute(InputInterface $input, OutputInterface $output)
@@ -69,5 +70,7 @@ class increment extends command
$this->config->increment($key, $increment, $use_cache);
$io->success($this->user->lang('CLI_CONFIG_INCREMENT_SUCCESS', $key));
return symfony_command::SUCCESS;
}
}

View File

@@ -12,6 +12,7 @@
*/
namespace phpbb\console\command\config;
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\Input\InputOption;
@@ -55,7 +56,7 @@ class set extends command
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*
* @return void
* @return int
* @see \phpbb\config\config::set()
*/
protected function execute(InputInterface $input, OutputInterface $output)
@@ -69,5 +70,7 @@ class set extends command
$this->config->set($key, $value, $use_cache);
$io->success($this->user->lang('CLI_CONFIG_SET_SUCCESS', $key));
return symfony_command::SUCCESS;
}
}

View File

@@ -12,6 +12,7 @@
*/
namespace phpbb\console\command\config;
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\Input\InputOption;
@@ -76,12 +77,12 @@ class set_atomic extends command
if ($this->config->set_atomic($key, $old_value, $new_value, $use_cache))
{
$io->success($this->user->lang('CLI_CONFIG_SET_SUCCESS', $key));
return 0;
return symfony_command::SUCCESS;
}
else
{
$io->error($this->user->lang('CLI_CONFIG_SET_FAILURE', $key));
return 1;
return symfony_command::FAILURE;
}
}
}