Skip to content

Commit f0ef641

Browse files
author
郭庆哲
committed
=add param cwd
1 parent 33f1916 commit f0ef641

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Async.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,18 @@ public static function discard()
4646
* Input you want to execute the required parameters in function
4747
* </p>
4848
* @param string $phpBin You can specify the PHP path for asynchronous execution scripts.
49+
* @param $cwd where to exec script
4950
* @param array $envs
5051
* @return $this
5152
*/
52-
public function start($scriptname, $args = [], $phpBin = null, $envs = [])
53+
public function start($scriptname, $args = [], $cwd = null, $phpBin = null, $envs = [])
5354
{
5455
if ($scriptname == 'callbackStub.php') {
5556
$cwd = __DIR__;
5657
} else {
57-
$cwd = '.';
58+
if ($cwd === null) {
59+
$cwd = '.';
60+
}
5861
if (!is_file($scriptname)) {
5962
throw new FileNotFoundException($scriptname." is not found");
6063
}
@@ -171,7 +174,5 @@ public function regCallback(callable $callback)
171174
}
172175

173176
// todo add multi async execution like add()->add()->start();
174-
175-
176177
}
177178

0 commit comments

Comments
 (0)