diff --git a/examples/embed_example.php b/examples/embed_example.php index 3eaf176cc2c295ca05eb0d93993a344f7699149d..d9d1688442d60a56c8e97abcc496e7f2519ba024 100644 --- a/examples/embed_example.php +++ b/examples/embed_example.php @@ -1,16 +1,17 @@ <?php -$AMCLI=__DIR__.'/../built_packages/amcli'; -$INI=__DIR__.'/../src/simple.ini'; +$AMCLI = __DIR__ . '/../built_packages/amcli'; +$INI = __DIR__ . '/../src/simple.ini'; -$sCommand="$AMCLI --ini='$INI'"; -$aOut=[]; +$sCommand = "$AMCLI --ini='$INI'"; +$aOut = []; exec($sCommand, $aOut, $iRc); -if($iRc==0){ +if ($iRc == 0) { header('Content-type: application/json'); -}else{ - echo "Error: occured...\n"; +} else { + header("HTTP/1.1 503 Service unavailable"); + echo "<h1>503 Service unavailable</h1>\n"; } echo implode("\n", $aOut);