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,
|
'success' => false,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
|
||||||
require '../../index.php';
|
require '../../index.php';
|
||||||
|
|
||||||
switch ($_SERVER['REQUEST_METHOD']) {
|
switch ($_SERVER['REQUEST_METHOD']) {
|
||||||
|
@ -48,6 +50,8 @@ switch ($_SERVER['REQUEST_METHOD']) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$response['warning'] = ob_get_clean();
|
||||||
|
|
||||||
header('Content-type: application/json; charset=utf-8');
|
header('Content-type: application/json; charset=utf-8');
|
||||||
echo json_encode($response);
|
echo json_encode($response);
|
||||||
die();
|
die();
|
||||||
|
|
|
@ -13,6 +13,8 @@ $response = array(
|
||||||
'success' => false,
|
'success' => false,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
|
||||||
require '../../index.php';
|
require '../../index.php';
|
||||||
|
|
||||||
switch ($_SERVER['REQUEST_METHOD']) {
|
switch ($_SERVER['REQUEST_METHOD']) {
|
||||||
|
@ -28,6 +30,8 @@ switch ($_SERVER['REQUEST_METHOD']) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$response['warning'] = ob_get_clean();
|
||||||
|
|
||||||
header('Content-type: application/json; charset=utf-8');
|
header('Content-type: application/json; charset=utf-8');
|
||||||
echo json_encode($response);
|
echo json_encode($response);
|
||||||
die();
|
die();
|
||||||
|
|
|
@ -13,6 +13,8 @@ $response = array(
|
||||||
'success' => false,
|
'success' => false,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
|
||||||
require '../../index.php';
|
require '../../index.php';
|
||||||
|
|
||||||
switch ($_SERVER['REQUEST_METHOD']) {
|
switch ($_SERVER['REQUEST_METHOD']) {
|
||||||
|
@ -87,6 +89,8 @@ switch ($_SERVER['REQUEST_METHOD']) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$response['warning'] = ob_get_clean();
|
||||||
|
|
||||||
header('Content-type: application/json; charset=utf-8');
|
header('Content-type: application/json; charset=utf-8');
|
||||||
echo json_encode($response);
|
echo json_encode($response);
|
||||||
die();
|
die();
|
||||||
|
|
Loading…
Reference in a new issue