diff --git a/src/Helper/ShellCommand.php b/src/Helper/ShellCommand.php index 5cd2d30..75064fe 100644 --- a/src/Helper/ShellCommand.php +++ b/src/Helper/ShellCommand.php @@ -27,4 +27,14 @@ public static function exists(string $command) return !empty($return); } + + /** + * Check if can execute shell commands. + */ + public static function isEnabled(): bool + { + return function_exists('shell_exec') && + is_callable('shell_exec') && + stripos(ini_get('disable_functions'), 'shell_exec') === false; + } }