mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-15 05:53:13 +00:00
add check on border-manager service configuration
This commit is contained in:
@@ -39,6 +39,7 @@ class module_console_fileEnsureDevSetting extends Command
|
||||
, 'checkOrmService'
|
||||
, 'checkCacheService'
|
||||
, 'checkOpcodeCacheService'
|
||||
, 'checkBorderService'
|
||||
);
|
||||
protected $errors = 0;
|
||||
protected $alerts = 0;
|
||||
@@ -115,6 +116,9 @@ class module_console_fileEnsureDevSetting extends Command
|
||||
case 'checkOpcodeCacheService' :
|
||||
$display = "Opcode";
|
||||
break;
|
||||
case 'checkBorderService' :
|
||||
$display = "Border";
|
||||
break;
|
||||
default:
|
||||
throw new \Exception('Unknown test');
|
||||
break;
|
||||
@@ -192,6 +196,32 @@ class module_console_fileEnsureDevSetting extends Command
|
||||
$this->verifyCacheOptions($output, $cache);
|
||||
}
|
||||
|
||||
private function checkBorderService(OutputInterface $output)
|
||||
{
|
||||
$serviceName = $this->configuration->getBorder();
|
||||
$configuration = $this->configuration->getService($serviceName);
|
||||
|
||||
$listChecks = false;
|
||||
try {
|
||||
$service = Core\Service\Builder::create(\bootstrap::getCore(), $configuration);
|
||||
$work_message = '<info>Works !</info>';
|
||||
$listChecks = true;
|
||||
} catch (\Exception $e) {
|
||||
$work_message = '<error>Failed - could not load Border Manager service !</error>';
|
||||
$this->errors ++;
|
||||
}
|
||||
|
||||
$output->writeln(sprintf("\t--> Verify Border Manager<info>%s</info> : %s", $serviceName, $work_message));
|
||||
|
||||
if ($listChecks) {
|
||||
$borderManager = $service->getDriver();
|
||||
|
||||
foreach ($service->getUnregisteredCheckers() as $check) {
|
||||
$output->writeln(sprintf("\t\t--> <comment>check %s could not be loaded for the following reason %s</comment>", $check['checker'], $check['message']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function checkPhraseanetScope(OutputInterface $output)
|
||||
{
|
||||
$required = array('servername', 'maintenance', 'debug', 'display_errors', 'database');
|
||||
|
@@ -39,6 +39,7 @@ class module_console_fileEnsureProductionSetting extends Command
|
||||
, 'checkOrmService'
|
||||
, 'checkCacheService'
|
||||
, 'checkOpcodeCacheService'
|
||||
, 'checkBorderService'
|
||||
);
|
||||
protected $errors = 0;
|
||||
protected $alerts = 0;
|
||||
@@ -113,6 +114,9 @@ class module_console_fileEnsureProductionSetting extends Command
|
||||
case 'checkOpcodeCacheService' :
|
||||
$display = "Opcode";
|
||||
break;
|
||||
case 'checkBorderService' :
|
||||
$display = "Border";
|
||||
break;
|
||||
default:
|
||||
throw new \Exception('Unknown test');
|
||||
break;
|
||||
@@ -188,6 +192,32 @@ class module_console_fileEnsureProductionSetting extends Command
|
||||
$this->verifyCacheOptions($output, $cache);
|
||||
}
|
||||
|
||||
private function checkBorderService(OutputInterface $output)
|
||||
{
|
||||
$serviceName = $this->configuration->getBorder();
|
||||
$configuration = $this->configuration->getService($serviceName);
|
||||
|
||||
$listChecks = false;
|
||||
try {
|
||||
$service = Core\Service\Builder::create(\bootstrap::getCore(), $configuration);
|
||||
$work_message = '<info>Works !</info>';
|
||||
$listChecks = true;
|
||||
} catch (\Exception $e) {
|
||||
$work_message = '<error>Failed - could not load Border Manager service !</error>';
|
||||
$this->errors ++;
|
||||
}
|
||||
|
||||
$output->writeln(sprintf("\t--> Verify Border Manager<info>%s</info> : %s", $serviceName, $work_message));
|
||||
|
||||
if ($listChecks) {
|
||||
$borderManager = $service->getDriver();
|
||||
|
||||
foreach ($service->getUnregisteredCheckers() as $check) {
|
||||
$output->writeln(sprintf("\t\t--> <comment>check %s could not be loaded for the following reason %s</comment>", $check['checker'], $check['message']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function checkPhraseanetScope(OutputInterface $output)
|
||||
{
|
||||
$required = array('servername', 'maintenance', 'debug', 'display_errors', 'database');
|
||||
|
Reference in New Issue
Block a user