From c21a870315f1c7401b60b27647f45b48c9a1ce45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Mon, 10 Dec 2018 12:21:20 +0100 Subject: [PATCH] Allow Box to run with a `embed` SAPI Closes #332 --- bin/box | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/box b/bin/box index 1b10e2cfd..f65017ae0 100755 --- a/bin/box +++ b/bin/box @@ -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); }