@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | public function isRunning() |
87 | 87 | { |
88 | 88 | $this->checkSupportingOS('Cocur\BackgroundProcess can only check if a process is running on *nix-based '. |
89 | - 'systems, such as Unix, Linux or Mac OS X. You are running "%s".'); |
|
89 | + 'systems, such as Unix, Linux or Mac OS X. You are running "%s".'); |
|
90 | 90 | |
91 | 91 | try { |
92 | 92 | $result = shell_exec(sprintf('ps %d 2>&1', $this->pid)); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | public function stop() |
108 | 108 | { |
109 | 109 | $this->checkSupportingOS('Cocur\BackgroundProcess can only stop a process on *nix-based systems, such as '. |
110 | - 'Unix, Linux or Mac OS X. You are running "%s".'); |
|
110 | + 'Unix, Linux or Mac OS X. You are running "%s".'); |
|
111 | 111 | |
112 | 112 | try { |
113 | 113 | $result = shell_exec(sprintf('kill %d 2>&1', $this->pid)); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | public function getPid() |
129 | 129 | { |
130 | 130 | $this->checkSupportingOS('Cocur\BackgroundProcess can only return the PID of a process on *nix-based systems, '. |
131 | - 'such as Unix, Linux or Mac OS X. You are running "%s".'); |
|
131 | + 'such as Unix, Linux or Mac OS X. You are running "%s".'); |
|
132 | 132 | |
133 | 133 | return $this->pid; |
134 | 134 | } |
@@ -62,13 +62,13 @@ |
||
62 | 62 | */ |
63 | 63 | public function run($outputFile = '/dev/null', $append = false) |
64 | 64 | { |
65 | - if(is_null($this->command)) return; |
|
65 | + if (is_null($this->command)) return; |
|
66 | 66 | switch ($this->getOS()) { |
67 | 67 | case self::OS_WINDOWS: |
68 | 68 | shell_exec(sprintf('%s &', $this->command, $outputFile)); |
69 | 69 | break; |
70 | 70 | case self::OS_NIX: |
71 | - $this->pid = (int)shell_exec(sprintf('%s %s %s 2>&1 & echo $!', $this->command, ($append) ? '>>' : '>', $outputFile)); |
|
71 | + $this->pid = (int) shell_exec(sprintf('%s %s %s 2>&1 & echo $!', $this->command, ($append) ? '>>' : '>', $outputFile)); |
|
72 | 72 | break; |
73 | 73 | default: |
74 | 74 | throw new RuntimeException(sprintf( |
@@ -62,7 +62,9 @@ |
||
62 | 62 | */ |
63 | 63 | public function run($outputFile = '/dev/null', $append = false) |
64 | 64 | { |
65 | - if(is_null($this->command)) return; |
|
65 | + if(is_null($this->command)) { |
|
66 | + return; |
|
67 | + } |
|
66 | 68 | switch ($this->getOS()) { |
67 | 69 | case self::OS_WINDOWS: |
68 | 70 | shell_exec(sprintf('%s &', $this->command, $outputFile)); |