mirror of
https://github.com/danog/parallel.git
synced 2024-11-29 20:29:00 +01:00
cs-fix
This commit is contained in:
parent
a5d4270acb
commit
7ee97e2ef0
@ -5,7 +5,6 @@ namespace Amp\Parallel\Context\Internal\Runner;
|
||||
use Amp\ByteStream\ResourceOutputStream;
|
||||
use Amp\Parallel\Context\ContextException;
|
||||
use Amp\Parallel\Context\Internal\ProcessHub;
|
||||
use Amp\Parallel\Context\Internal\Runner\RunnerAbstract;
|
||||
use Amp\Promise;
|
||||
use Amp\Success;
|
||||
|
||||
@ -33,7 +32,7 @@ final class WebRunner extends RunnerAbstract
|
||||
private $running = false;
|
||||
|
||||
/**
|
||||
* Socket
|
||||
* Socket.
|
||||
*
|
||||
* @var ResourceOutputStream
|
||||
*/
|
||||
@ -59,7 +58,7 @@ final class WebRunner extends RunnerAbstract
|
||||
if (\substr($uri, -1) === '/') { // http://example.com/path/ (assumed index.php)
|
||||
$uri .= 'index'; // Add fake file name
|
||||
}
|
||||
$uri = str_replace('//', '/', $uri);
|
||||
$uri = \str_replace('//', '/', $uri);
|
||||
|
||||
$rootDir = \debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
|
||||
$rootDir = \end($rootDir)['file'] ?? '';
|
||||
@ -106,7 +105,7 @@ final class WebRunner extends RunnerAbstract
|
||||
if (!\is_array($script)) {
|
||||
$script = [$script];
|
||||
}
|
||||
array_unshift($script, $hub->getUri());
|
||||
\array_unshift($script, $hub->getUri());
|
||||
$this->params = [
|
||||
'cwd' => $cwd,
|
||||
'env' => $env,
|
||||
|
@ -39,8 +39,8 @@ if (\function_exists("cli_set_process_title")) {
|
||||
$fromWeb = false;
|
||||
if (!isset($argv)) { // Running from web
|
||||
$argv = $_REQUEST['argv'] ?? [];
|
||||
array_unshift($argv, __DIR__);
|
||||
$argc = count($argv);
|
||||
\array_unshift($argv, __DIR__);
|
||||
$argc = \count($argv);
|
||||
$fromWeb = true;
|
||||
|
||||
@\ini_set('html_errors', 0);
|
||||
@ -135,9 +135,9 @@ if (!isset($argv)) { // Running from web
|
||||
|
||||
if ($fromWeb) { // Set environment variables only after auth
|
||||
if (isset($_REQUEST['cwd'])) {
|
||||
chdir($_REQUEST['cwd']);
|
||||
\chdir($_REQUEST['cwd']);
|
||||
}
|
||||
if (isset($_REQUEST['env']) && is_array($_REQUEST['env'])) {
|
||||
if (isset($_REQUEST['env']) && \is_array($_REQUEST['env'])) {
|
||||
foreach ($_REQUEST['env'] as $key => $value) {
|
||||
@\putenv("$key=$value");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user