mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-12 19:54:12 +02:00
[ticket/16955] Use constants for exit codes in installer console commands
PHPBB3-16955
This commit is contained in:
@@ -22,6 +22,7 @@ use phpbb\install\updater_configuration;
|
||||
use phpbb\language\language;
|
||||
use Symfony\Component\Config\Definition\Exception\Exception;
|
||||
use Symfony\Component\Config\Definition\Processor;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
@@ -111,14 +112,14 @@ class update extends \phpbb\console\command\command
|
||||
{
|
||||
$iohandler->add_error_message('INSTALL_PHPBB_NOT_INSTALLED');
|
||||
|
||||
return 1;
|
||||
return Command::FAILURE;
|
||||
}
|
||||
|
||||
if (!is_file($config_file))
|
||||
{
|
||||
$iohandler->add_error_message(array('MISSING_FILE', $config_file));
|
||||
|
||||
return 1;
|
||||
return Command::FAILURE;
|
||||
}
|
||||
|
||||
try
|
||||
@@ -129,7 +130,7 @@ class update extends \phpbb\console\command\command
|
||||
{
|
||||
$iohandler->add_error_message(array('INVALID_YAML_FILE', $config_file));
|
||||
|
||||
return 1;
|
||||
return Command::FAILURE;
|
||||
}
|
||||
|
||||
$processor = new Processor();
|
||||
@@ -143,7 +144,7 @@ class update extends \phpbb\console\command\command
|
||||
{
|
||||
$iohandler->add_error_message('INVALID_CONFIGURATION', $e->getMessage());
|
||||
|
||||
return 1;
|
||||
return Command::FAILURE;
|
||||
}
|
||||
|
||||
$this->register_configuration($iohandler, $config);
|
||||
@@ -151,12 +152,12 @@ class update extends \phpbb\console\command\command
|
||||
try
|
||||
{
|
||||
$this->installer->run();
|
||||
return 0;
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
catch (installer_exception $e)
|
||||
{
|
||||
$iohandler->add_error_message($e->getMessage());
|
||||
return 1;
|
||||
return Command::FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user