mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 13:28:55 +00:00
[ticket/16649] Changes for Symfony 5
PHPBB3-16649
This commit is contained in:
parent
19b12bf6ee
commit
157a8aca01
14 changed files with 22 additions and 20 deletions
|
@ -59,7 +59,7 @@
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"fabpot/goutte": "~3.2",
|
"fabpot/goutte": "~3.2",
|
||||||
"laravel/homestead": "~7.0",
|
"laravel/homestead": "~9.4",
|
||||||
"phing/phing": "~2.4",
|
"phing/phing": "~2.4",
|
||||||
"phpunit/dbunit": "~4.0",
|
"phpunit/dbunit": "~4.0",
|
||||||
"phpunit/phpunit": "^7.0",
|
"phpunit/phpunit": "^7.0",
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
namespace phpbb\console\command\cron;
|
namespace phpbb\console\command\cron;
|
||||||
|
|
||||||
use phpbb\exception\runtime_exception;
|
use phpbb\exception\runtime_exception;
|
||||||
|
use Symfony\Component\Console\Command\Command as symfony_command;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
@ -90,7 +91,8 @@ class run extends \phpbb\console\command\command
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->lock_db->release();
|
$this->lock_db->release();
|
||||||
return $exit_status;
|
|
||||||
|
return !$exit_status ? symfony_command::SUCCESS : symfony_command::FAILURE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -85,13 +85,13 @@ class list_command extends \phpbb\console\command\db\migration_command
|
||||||
if (!empty($available))
|
if (!empty($available))
|
||||||
{
|
{
|
||||||
$io->listing($available);
|
$io->listing($available);
|
||||||
return symfony_command::SUCCESS;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$io->text($this->user->lang('CLI_MIGRATIONS_EMPTY'));
|
$io->text($this->user->lang('CLI_MIGRATIONS_EMPTY'));
|
||||||
$io->newLine();
|
$io->newLine();
|
||||||
return symfony_command::FAILURE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return symfony_command::SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ class install extends \phpbb\console\command\command
|
||||||
*
|
*
|
||||||
* @param InputInterface $input
|
* @param InputInterface $input
|
||||||
* @param OutputInterface $output
|
* @param OutputInterface $output
|
||||||
* @return integer
|
* @return int
|
||||||
*/
|
*/
|
||||||
protected function execute(InputInterface $input, OutputInterface $output)
|
protected function execute(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
|
|
|
@ -53,7 +53,7 @@ class list_available extends \phpbb\console\command\command
|
||||||
*
|
*
|
||||||
* @param InputInterface $input
|
* @param InputInterface $input
|
||||||
* @param OutputInterface $output
|
* @param OutputInterface $output
|
||||||
* @return integer
|
* @return int
|
||||||
*/
|
*/
|
||||||
protected function execute(InputInterface $input, OutputInterface $output)
|
protected function execute(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
|
|
|
@ -67,7 +67,7 @@ class manage extends \phpbb\console\command\command
|
||||||
*
|
*
|
||||||
* @param InputInterface $input
|
* @param InputInterface $input
|
||||||
* @param OutputInterface $output
|
* @param OutputInterface $output
|
||||||
* @return integer
|
* @return int
|
||||||
*/
|
*/
|
||||||
protected function execute(InputInterface $input, OutputInterface $output)
|
protected function execute(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,7 +50,7 @@ class show extends command
|
||||||
if (empty($all))
|
if (empty($all))
|
||||||
{
|
{
|
||||||
$io->note($this->user->lang('CLI_EXTENSION_NOT_FOUND'));
|
$io->note($this->user->lang('CLI_EXTENSION_NOT_FOUND'));
|
||||||
return 3;
|
return symfony_command::FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
$enabled = array_keys($this->manager->all_enabled());
|
$enabled = array_keys($this->manager->all_enabled());
|
||||||
|
|
|
@ -60,7 +60,7 @@ class list_all extends \phpbb\console\command\command
|
||||||
*
|
*
|
||||||
* @param InputInterface $input
|
* @param InputInterface $input
|
||||||
* @param OutputInterface $output
|
* @param OutputInterface $output
|
||||||
* @return integer
|
* @return int
|
||||||
*/
|
*/
|
||||||
protected function execute(InputInterface $input, OutputInterface $output)
|
protected function execute(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
|
|
|
@ -127,7 +127,7 @@ class reparse extends \phpbb\console\command\command
|
||||||
*
|
*
|
||||||
* @param InputInterface $input
|
* @param InputInterface $input
|
||||||
* @param OutputInterface $output
|
* @param OutputInterface $output
|
||||||
* @return integer
|
* @return int
|
||||||
*/
|
*/
|
||||||
protected function execute(InputInterface $input, OutputInterface $output)
|
protected function execute(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
|
|
|
@ -99,7 +99,7 @@ class check extends \phpbb\console\command\command
|
||||||
if (!($stability == 'stable') && !($stability == 'unstable'))
|
if (!($stability == 'stable') && !($stability == 'unstable'))
|
||||||
{
|
{
|
||||||
$io->error($this->language->lang('CLI_ERROR_INVALID_STABILITY', $stability));
|
$io->error($this->language->lang('CLI_ERROR_INVALID_STABILITY', $stability));
|
||||||
return 3;
|
return symfony_command::FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ use phpbb\template\template;
|
||||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||||
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
|
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
|
||||||
use Symfony\Component\HttpKernel\KernelEvents;
|
use Symfony\Component\HttpKernel\KernelEvents;
|
||||||
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
|
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -60,11 +60,11 @@ class kernel_exception_subscriber implements EventSubscriberInterface
|
||||||
/**
|
/**
|
||||||
* This listener is run when the KernelEvents::EXCEPTION event is triggered
|
* This listener is run when the KernelEvents::EXCEPTION event is triggered
|
||||||
*
|
*
|
||||||
* @param GetResponseForExceptionEvent $event
|
* @param ExceptionEvent $event
|
||||||
*/
|
*/
|
||||||
public function on_kernel_exception(GetResponseForExceptionEvent $event)
|
public function on_kernel_exception(ExceptionEvent $event)
|
||||||
{
|
{
|
||||||
$exception = $event->getException();
|
$exception = $event->getThrowable();
|
||||||
$message = $exception->getMessage();
|
$message = $exception->getMessage();
|
||||||
|
|
||||||
if ($exception instanceof exception_interface)
|
if ($exception instanceof exception_interface)
|
||||||
|
|
|
@ -26,8 +26,8 @@ class installer_configuration implements ConfigurationInterface
|
||||||
*/
|
*/
|
||||||
public function getConfigTreeBuilder()
|
public function getConfigTreeBuilder()
|
||||||
{
|
{
|
||||||
$treeBuilder = new TreeBuilder();
|
$treeBuilder = new TreeBuilder('installer');
|
||||||
$rootNode = $treeBuilder->root('installer');
|
$rootNode = $treeBuilder->getRootNode();
|
||||||
$rootNode
|
$rootNode
|
||||||
->children()
|
->children()
|
||||||
->arrayNode('admin')
|
->arrayNode('admin')
|
||||||
|
|
|
@ -26,8 +26,8 @@ class updater_configuration implements ConfigurationInterface
|
||||||
*/
|
*/
|
||||||
public function getConfigTreeBuilder()
|
public function getConfigTreeBuilder()
|
||||||
{
|
{
|
||||||
$treeBuilder = new TreeBuilder();
|
$treeBuilder = new TreeBuilder('updater');
|
||||||
$rootNode = $treeBuilder->root('updater');
|
$rootNode = $treeBuilder->getRootNode();
|
||||||
$rootNode
|
$rootNode
|
||||||
->addDefaultsIfNotSet()
|
->addDefaultsIfNotSet()
|
||||||
->children()
|
->children()
|
||||||
|
|
|
@ -106,7 +106,7 @@ class phpbb_console_user_add_test extends phpbb_console_user_base
|
||||||
|
|
||||||
$this->assertEquals(2, $this->get_user_id('Admin'));
|
$this->assertEquals(2, $this->get_user_id('Admin'));
|
||||||
|
|
||||||
$command_tester->setInputs(['bar\npassword\npassword\nbar@test.com']);
|
$command_tester->setInputs(['bar', 'password', 'password', 'bar@test.com']);
|
||||||
|
|
||||||
$command_tester->execute(array(
|
$command_tester->execute(array(
|
||||||
'command' => $this->command_name,
|
'command' => $this->command_name,
|
||||||
|
|
Loading…
Add table
Reference in a new issue