mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
N°8796 - Add PHP code style validation in iTop and extensions - format whole code base
This commit is contained in:
@@ -5,21 +5,18 @@
|
||||
require_once __DIR__.'/../../../../../../sources/application/status/Status.php';
|
||||
|
||||
// Do check Status
|
||||
try
|
||||
{
|
||||
\Combodo\iTop\Application\Status\StatusStartup();
|
||||
$aResult = array('status' => STATUS_RUNNING, 'code' => \RestResult::OK, 'message' => '');
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
$iCode = (defined('\RestResult::INTERNAL_ERROR')) ? \RestResult::INTERNAL_ERROR : 100;
|
||||
$aResult = array('status' => STATUS_ERROR, 'code' => $iCode, 'message' => $e->getMessage());
|
||||
http_response_code(500);
|
||||
try {
|
||||
\Combodo\iTop\Application\Status\StatusStartup();
|
||||
$aResult = ['status' => STATUS_RUNNING, 'code' => \RestResult::OK, 'message' => ''];
|
||||
} catch (\Exception $e) {
|
||||
$iCode = (defined('\RestResult::INTERNAL_ERROR')) ? \RestResult::INTERNAL_ERROR : 100;
|
||||
$aResult = ['status' => STATUS_ERROR, 'code' => $iCode, 'message' => $e->getMessage()];
|
||||
http_response_code(500);
|
||||
}
|
||||
|
||||
//Set headers, based on webservices/rest.php
|
||||
$sContentType = 'application/json';
|
||||
header('Content-type: ' . $sContentType);
|
||||
header('Content-type: '.$sContentType);
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
|
||||
//Output result
|
||||
|
||||
Reference in New Issue
Block a user