Skip to content

Commit

Permalink
fix(shell): add is enabled method
Browse files Browse the repository at this point in the history
  • Loading branch information
marcocesarato committed May 14, 2021
1 parent 54599fb commit edee7de
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Helper/ShellCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit edee7de

Please sign in to comment.