Skip to content

Commit

Permalink
fix: swoft-cloud/swoft/issues/895 win10 will delete sys helper
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Aug 18, 2019
1 parent 975a4d0 commit 71c2893
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/stdlib/src/Helper/SystemHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use function implode;
use function is_resource;
use function ob_start;
use function passthru;
use function preg_match;
use function preg_replace;
use function proc_close;
Expand Down Expand Up @@ -96,10 +95,9 @@ public static function run(string $command, string $cwd = null): array
/**
* Method to execute a command in the sys
* Uses :
* 1. system
* 2. passthru
* 3. exec
* 4. shell_exec
* - system
* - exec
* - shell_exec
*
* @param string $command
* @param bool $returnStatus
Expand All @@ -121,12 +119,6 @@ public static function execute(string $command, bool $returnStatus = true, strin
system($command, $exitStatus);
$output = ob_get_clean();

// passthru
} elseif (function_exists('passthru')) {
ob_start();
passthru($command, $exitStatus);
$output = ob_get_clean();

//exec
} elseif (function_exists('exec')) {
exec($command, $output, $exitStatus);
Expand Down

0 comments on commit 71c2893

Please sign in to comment.