[Runtime] dont display the shebang on the CLI
This commit is contained in:
parent
e03ab57139
commit
463b2db51b
@ -6,8 +6,16 @@ if (true === (require_once __DIR__.'/autoload.php') || empty($_SERVER['SCRIPT_FI
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is_object($app = require $_SERVER['SCRIPT_FILENAME'])) {
|
||||
throw new \TypeError(sprintf('Invalid return value: callable object expected, "%s" returned from "%s".', get_debug_type($app), $_SERVER['SCRIPT_FILENAME']));
|
||||
if (PHP_VERSION_ID < 80000 && in_array(PHP_SAPI, ['cli', 'phpdbg'], true)) {
|
||||
ob_start();
|
||||
$app = require $_SERVER['SCRIPT_FILENAME'];
|
||||
ob_end_clean();
|
||||
} else {
|
||||
$app = require $_SERVER['SCRIPT_FILENAME'];
|
||||
}
|
||||
|
||||
if (!is_object($app)) {
|
||||
throw new TypeError(sprintf('Invalid return value: callable object expected, "%s" returned from "%s".', get_debug_type($app), $_SERVER['SCRIPT_FILENAME']));
|
||||
}
|
||||
|
||||
$runtime = $_SERVER['APP_RUNTIME'] ?? %runtime_class%;
|
||||
|
Reference in New Issue
Block a user