Catch all api script output/warnings
This commit is contained in:
parent
05124129b5
commit
43e1c4e01b
3 changed files with 12 additions and 0 deletions
|
@ -11,6 +11,8 @@ $response = array(
|
|||
'success' => false,
|
||||
);
|
||||
|
||||
ob_start();
|
||||
|
||||
require '../../index.php';
|
||||
|
||||
switch ($_SERVER['REQUEST_METHOD']) {
|
||||
|
@ -48,6 +50,8 @@ switch ($_SERVER['REQUEST_METHOD']) {
|
|||
break;
|
||||
}
|
||||
|
||||
$response['warning'] = ob_get_clean();
|
||||
|
||||
header('Content-type: application/json; charset=utf-8');
|
||||
echo json_encode($response);
|
||||
die();
|
||||
|
|
|
@ -13,6 +13,8 @@ $response = array(
|
|||
'success' => false,
|
||||
);
|
||||
|
||||
ob_start();
|
||||
|
||||
require '../../index.php';
|
||||
|
||||
switch ($_SERVER['REQUEST_METHOD']) {
|
||||
|
@ -28,6 +30,8 @@ switch ($_SERVER['REQUEST_METHOD']) {
|
|||
break;
|
||||
}
|
||||
|
||||
$response['warning'] = ob_get_clean();
|
||||
|
||||
header('Content-type: application/json; charset=utf-8');
|
||||
echo json_encode($response);
|
||||
die();
|
||||
|
|
|
@ -13,6 +13,8 @@ $response = array(
|
|||
'success' => false,
|
||||
);
|
||||
|
||||
ob_start();
|
||||
|
||||
require '../../index.php';
|
||||
|
||||
switch ($_SERVER['REQUEST_METHOD']) {
|
||||
|
@ -87,6 +89,8 @@ switch ($_SERVER['REQUEST_METHOD']) {
|
|||
break;
|
||||
}
|
||||
|
||||
$response['warning'] = ob_get_clean();
|
||||
|
||||
header('Content-type: application/json; charset=utf-8');
|
||||
echo json_encode($response);
|
||||
die();
|
||||
|
|
Loading…
Reference in a new issue