Skip to content

Commit

Permalink
Allow Box to run with a embed SAPI
Browse files Browse the repository at this point in the history
Closes #332
  • Loading branch information
theofidry committed Dec 10, 2018
1 parent 76793ed commit c21a870
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bin/box
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ declare(strict_types=1);

namespace KevinGH\Box;

use function in_array;
use KevinGH\Box\Console\Application;
use RuntimeException;
use const PHP_EOL;
use const PHP_SAPI;
use function file_exists;

if (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') {
echo PHP_EOL.'Box may only be invoked from a command line'.\PHP_EOL;
if (false === in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
echo PHP_EOL.'Box may only be invoked from a command line'.PHP_EOL;

exit(1);
}
Expand Down

0 comments on commit c21a870

Please # to comment.