Skip to content

Commit

Permalink
fix #5010 function exec() is disabled (#5012)
Browse files Browse the repository at this point in the history
* fix #5010 function exec() is disabled

* Improve error message

Co-authored-by: Thomas Bley <thomas.bley@bringmeister.de>
Co-authored-by: Matthew Brown <github@muglug.com>
  • Loading branch information
3 people authored Jan 14, 2021
1 parent ef4afd7 commit 080cf61
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ final class SystemCommandExecutor
*/
public function execute(string $command) : array
{
if (!\function_exists('exec')) {
throw new \RuntimeException(sprintf('exec does not exist, failed to execute command: %s', $command));
};

exec($command, $result, $returnValue);

if ($returnValue === 0) {
Expand Down

0 comments on commit 080cf61

Please sign in to comment.