"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "public_html/lists/base/vendor/symfony/symfony/src/Symfony/Component/Process/Pipes/WindowsPipes.php" between
phplist-3.4.5.tgz and phplist-3.4.6.tgz

About: phpList is a one-way email announcement delivery system for newsletters, publicity lists, notifications, and many other uses (requires PHP and MySQL).

WindowsPipes.php  (phplist-3.4.5.tgz):WindowsPipes.php  (phplist-3.4.6.tgz)
skipping to change at line 20 skipping to change at line 20
*/ */
namespace Symfony\Component\Process\Pipes; namespace Symfony\Component\Process\Pipes;
use Symfony\Component\Process\Exception\RuntimeException; use Symfony\Component\Process\Exception\RuntimeException;
use Symfony\Component\Process\Process; use Symfony\Component\Process\Process;
/** /**
* WindowsPipes implementation uses temporary files as handles. * WindowsPipes implementation uses temporary files as handles.
* *
* @see https://bugs.php.net/bug.php?id=51800 * @see https://bugs.php.net/51800
* @see https://bugs.php.net/bug.php?id=65650 * @see https://bugs.php.net/65650
* *
* @author Romain Neutron <imprec@gmail.com> * @author Romain Neutron <imprec@gmail.com>
* *
* @internal * @internal
*/ */
class WindowsPipes extends AbstractPipes class WindowsPipes extends AbstractPipes
{ {
private $files = []; private $files = [];
private $fileHandles = []; private $fileHandles = [];
private $lockHandles = []; private $lockHandles = [];
skipping to change at line 46 skipping to change at line 46
private $haveReadSupport; private $haveReadSupport;
public function __construct($input, $haveReadSupport) public function __construct($input, $haveReadSupport)
{ {
$this->haveReadSupport = (bool) $haveReadSupport; $this->haveReadSupport = (bool) $haveReadSupport;
if ($this->haveReadSupport) { if ($this->haveReadSupport) {
// Fix for PHP bug #51800: reading from STDOUT pipe hangs forever on Windows if the output is too big. // Fix for PHP bug #51800: reading from STDOUT pipe hangs forever on Windows if the output is too big.
// Workaround for this problem is to use temporary files instead of pipes on Windows platform. // Workaround for this problem is to use temporary files instead of pipes on Windows platform.
// //
// @see https://bugs.php.net/bug.php?id=51800 // @see https://bugs.php.net/51800
$pipes = [ $pipes = [
Process::STDOUT => Process::OUT, Process::STDOUT => Process::OUT,
Process::STDERR => Process::ERR, Process::STDERR => Process::ERR,
]; ];
$tmpDir = sys_get_temp_dir(); $tmpDir = sys_get_temp_dir();
$lastError = 'unknown reason'; $lastError = 'unknown reason';
set_error_handler(function ($type, $msg) use (&$lastError) { $lastEr ror = $msg; }); set_error_handler(function ($type, $msg) use (&$lastError) { $lastEr ror = $msg; });
for ($i = 0;; ++$i) { for ($i = 0;; ++$i) {
foreach ($pipes as $pipe => $name) { foreach ($pipes as $pipe => $name) {
$file = sprintf('%s\\sf_proc_%02X.%s', $tmpDir, $i, $name); $file = sprintf('%s\\sf_proc_%02X.%s', $tmpDir, $i, $name);
skipping to change at line 108 skipping to change at line 108
if (!$this->haveReadSupport) { if (!$this->haveReadSupport) {
$nullstream = fopen('NUL', 'c'); $nullstream = fopen('NUL', 'c');
return [ return [
['pipe', 'r'], ['pipe', 'r'],
$nullstream, $nullstream,
$nullstream, $nullstream,
]; ];
} }
// We're not using pipe on Windows platform as it hangs (https://bugs.ph // We're not using pipe on Windows platform as it hangs (https://bugs.ph
p.net/bug.php?id=51800) p.net/51800)
// We're not using file handles as it can produce corrupted output https // We're not using file handles as it can produce corrupted output https
://bugs.php.net/bug.php?id=65650 ://bugs.php.net/65650
// So we redirect output within the commandline and pass the nul device to the process // So we redirect output within the commandline and pass the nul device to the process
return [ return [
['pipe', 'r'], ['pipe', 'r'],
['file', 'NUL', 'w'], ['file', 'NUL', 'w'],
['file', 'NUL', 'w'], ['file', 'NUL', 'w'],
]; ];
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
 End of changes. 3 change blocks. 
7 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)