AsyncExecuterService::runBashCommand()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
c 0
b 0
f 0
nc 2
nop 1
dl 0
loc 8
rs 10
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: benedikt
5
 * Date: 6/28/18
6
 * Time: 5:41 PM
7
 */
8
9
namespace Tfboe\FmLib\Service;
10
11
12
class AsyncExecuterService implements AsyncExecuterServiceInterface
13
{
14
//<editor-fold desc="Public Methods">
15
  /**
16
   * @param $command
17
   */
18
  public function runBashCommand($command)
19
  {
20
    if (substr(php_uname(), 0, 7) == "Windows") {
21
      pclose(popen("start /B " . $command, "r"));
22
    } else {
23
      exec($command . " > /dev/null &");
24
    }
25
  }
26
//</editor-fold desc="Public Methods">
27
}