From 885104cb787aac5bee498faf45ab9d8ace220695 Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Mon, 23 Apr 2012 14:43:49 +0300 Subject: [PATCH 1/2] fix typo --- src/Symfony/Component/Process/Process.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index 47d00afacf..0628af6760 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -48,7 +48,7 @@ class Process private $status = self::STATUS_READY; private $fileHandles; - private $readedBytes; + private $readBytes; /** * Exit codes translation table. @@ -274,7 +274,7 @@ class Process foreach ($fh as $type => $fileHandle) { fseek($fileHandle, 0); $data = fread($fileHandle, 8192); - $this->readedBytes[$type] = strlen($data); + $this->readBytes[$type] = strlen($data); if (strlen($data) > 0) { call_user_func($callback, $type == 1 ? self::OUT : self::ERR, $data); } @@ -318,7 +318,7 @@ class Process { $this->processInformation = proc_get_status($this->process); $callback = $this->buildCallback($callback); - while ($this->pipes || (defined('PHP_WINDOWS_VERSION_BUILD') && $this->fileHandles)) { + while ($this->pipes || defined('PHP_WINDOWS_VERSION_BUILD') && $this->fileHandles) { $r = $this->pipes; $w = null; $e = null; @@ -337,12 +337,12 @@ class Process if (defined('PHP_WINDOWS_VERSION_BUILD')) { $fh = $this->fileHandles; foreach ($fh as $type => $fileHandle) { - fseek($fileHandle, $this->readedBytes[$type]); + fseek($fileHandle, $this->readBytes[$type]); $data = fread($fileHandle, 8192); - if(isset($this->readedBytes)) { - $this->readedBytes[$type] += strlen($data); + if(isset($this->readBytes)) { + $this->readBytes[$type] += strlen($data); } else { - $this->readedBytes[$type] = strlen($data); + $this->readBytes[$type] = strlen($data); } if (strlen($data) > 0) { @@ -719,7 +719,7 @@ class Process protected function updateOutput() { if (defined('PHP_WINDOWS_VERSION_BUILD') && isset($this->fileHandles[self::STDOUT]) && is_resource($this->fileHandles[self::STDOUT])) { - fseek($this->fileHandles[self::STDOUT], $this->readedBytes[self::STDOUT]); + fseek($this->fileHandles[self::STDOUT], $this->readBytes[self::STDOUT]); $this->addOutput(stream_get_contents($this->fileHandles[self::STDOUT])); } elseif (isset($this->pipes[self::STDOUT]) && is_resource($this->pipes[self::STDOUT])) { $this->addOutput(stream_get_contents($this->pipes[self::STDOUT])); From 9f0daf47f9d4dfbbbc472d83786322d47a1960fa Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Tue, 24 Apr 2012 15:28:42 +0300 Subject: [PATCH 2/2] put parentheses back --- src/Symfony/Component/Process/Process.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index 0628af6760..a5557d7ebd 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -318,7 +318,7 @@ class Process { $this->processInformation = proc_get_status($this->process); $callback = $this->buildCallback($callback); - while ($this->pipes || defined('PHP_WINDOWS_VERSION_BUILD') && $this->fileHandles) { + while ($this->pipes || (defined('PHP_WINDOWS_VERSION_BUILD') && $this->fileHandles)) { $r = $this->pipes; $w = null; $e = null;