| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | public static function asyncRun($logFile = '') { |
||
| 9 | |||
| 10 | $binPath = EnvHelper::getBinPath(); |
||
| 11 | /** @var Command $command */ |
||
| 12 | $command = new self(); |
||
| 13 | |||
| 14 | if(empty($logFile)) { |
||
| 15 | $logFile = '/dev/null'; |
||
| 16 | } else { |
||
| 17 | $logFile = $_ENV['APP_CMD_LOG_PATH'] . $logFile; |
||
| 18 | } |
||
| 19 | |||
| 20 | $cmd = sprintf("nohup %s %s > %s 2>&1 &", $binPath, $command->getName(), $logFile); |
||
| 21 | |||
| 22 | exec($cmd); |
||
| 23 | } |
||
| 24 | } |