Skip to content

Commit

Permalink
Merge pull request #19 from nextcloud/bump_symfony_process
Browse files Browse the repository at this point in the history
Bump symfony/process
  • Loading branch information
rullzer committed Oct 18, 2016
2 parents 8575a38 + 1dc902c commit bbe556f
Show file tree
Hide file tree
Showing 17 changed files with 548 additions and 412 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"symfony/console": "^3.0.0",
"symfony/event-dispatcher": "^3.0.0",
"symfony/routing": "^3.0.0",
"symfony/process": "2.8.1",
"symfony/process": "^3.0.0",
"pimple/pimple": "3.0.2",
"nikic/php-parser": "1.4.1",
"icewind/Streams": "0.4.1",
Expand Down
18 changes: 9 additions & 9 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -1406,6 +1406,7 @@
'Symfony\\Component\\Process\\Exception\\ProcessTimedOutException' => $vendorDir . '/symfony/process/Exception/ProcessTimedOutException.php',
'Symfony\\Component\\Process\\Exception\\RuntimeException' => $vendorDir . '/symfony/process/Exception/RuntimeException.php',
'Symfony\\Component\\Process\\ExecutableFinder' => $vendorDir . '/symfony/process/ExecutableFinder.php',
'Symfony\\Component\\Process\\InputStream' => $vendorDir . '/symfony/process/InputStream.php',
'Symfony\\Component\\Process\\PhpExecutableFinder' => $vendorDir . '/symfony/process/PhpExecutableFinder.php',
'Symfony\\Component\\Process\\PhpProcess' => $vendorDir . '/symfony/process/PhpProcess.php',
'Symfony\\Component\\Process\\Pipes\\AbstractPipes' => $vendorDir . '/symfony/process/Pipes/AbstractPipes.php',
Expand Down
1 change: 1 addition & 0 deletions composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -1713,6 +1713,7 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652
'Symfony\\Component\\Process\\Exception\\ProcessTimedOutException' => __DIR__ . '/..' . '/symfony/process/Exception/ProcessTimedOutException.php',
'Symfony\\Component\\Process\\Exception\\RuntimeException' => __DIR__ . '/..' . '/symfony/process/Exception/RuntimeException.php',
'Symfony\\Component\\Process\\ExecutableFinder' => __DIR__ . '/..' . '/symfony/process/ExecutableFinder.php',
'Symfony\\Component\\Process\\InputStream' => __DIR__ . '/..' . '/symfony/process/InputStream.php',
'Symfony\\Component\\Process\\PhpExecutableFinder' => __DIR__ . '/..' . '/symfony/process/PhpExecutableFinder.php',
'Symfony\\Component\\Process\\PhpProcess' => __DIR__ . '/..' . '/symfony/process/PhpProcess.php',
'Symfony\\Component\\Process\\Pipes\\AbstractPipes' => __DIR__ . '/..' . '/symfony/process/Pipes/AbstractPipes.php',
Expand Down
102 changes: 51 additions & 51 deletions composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -1487,57 +1487,6 @@
"normalizer"
]
},
{
"name": "symfony/process",
"version": "v2.8.1",
"version_normalized": "2.8.1.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "62c254438b5040bc2217156e1570cf2206e8540c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/62c254438b5040bc2217156e1570cf2206e8540c",
"reference": "62c254438b5040bc2217156e1570cf2206e8540c",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"time": "2015-12-23 11:03:46",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.8-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Symfony\\Component\\Process\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com"
},
{
"name": "deepdiver1975/tarstreamer",
"version": "v0.1.0",
Expand Down Expand Up @@ -2899,5 +2848,56 @@
"persistence",
"queryobject"
]
},
{
"name": "symfony/process",
"version": "v3.1.5",
"version_normalized": "3.1.5.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "66de154ae86b1a07001da9fbffd620206e4faf94"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/66de154ae86b1a07001da9fbffd620206e4faf94",
"reference": "66de154ae86b1a07001da9fbffd620206e4faf94",
"shasum": ""
},
"require": {
"php": ">=5.5.9"
},
"time": "2016-09-29 14:13:09",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.1-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Symfony\\Component\\Process\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com"
}
]
4 changes: 2 additions & 2 deletions symfony/process/ExecutableFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function find($name, $default = null, array $extraDirs = array())
if (@is_dir($path)) {
$dirs[] = $path;
} else {
if (basename($path) == $name && is_executable($path)) {
if (basename($path) == $name && @is_executable($path)) {
return $path;
}
}
Expand All @@ -79,7 +79,7 @@ public function find($name, $default = null, array $extraDirs = array())
}
foreach ($suffixes as $suffix) {
foreach ($dirs as $dir) {
if (is_file($file = $dir.DIRECTORY_SEPARATOR.$name.$suffix) && ('\\' === DIRECTORY_SEPARATOR || is_executable($file))) {
if (@is_file($file = $dir.DIRECTORY_SEPARATOR.$name.$suffix) && ('\\' === DIRECTORY_SEPARATOR || is_executable($file))) {
return $file;
}
}
Expand Down
90 changes: 90 additions & 0 deletions symfony/process/InputStream.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\Process;

use Symfony\Component\Process\Exception\RuntimeException;

/**
* Provides a way to continuously write to the input of a Process until the InputStream is closed.
*
* @author Nicolas Grekas <p@tchwork.com>
*/
class InputStream implements \IteratorAggregate
{
private $onEmpty = null;
private $input = array();
private $open = true;

/**
* Sets a callback that is called when the write buffer becomes empty.
*/
public function onEmpty(callable $onEmpty = null)
{
$this->onEmpty = $onEmpty;
}

/**
* Appends an input to the write buffer.
*
* @param resource|scalar|\Traversable|null The input to append as stream resource, scalar or \Traversable
*/
public function write($input)
{
if (null === $input) {
return;
}
if ($this->isClosed()) {
throw new RuntimeException(sprintf('%s is closed', static::class));
}
$this->input[] = ProcessUtils::validateInput(__METHOD__, $input);
}

/**
* Closes the write buffer.
*/
public function close()
{
$this->open = false;
}

/**
* Tells whether the write buffer is closed or not.
*/
public function isClosed()
{
return !$this->open;
}

public function getIterator()
{
$this->open = true;

while ($this->open || $this->input) {
if (!$this->input) {
yield '';
continue;
}
$current = array_shift($this->input);

if ($current instanceof \Iterator) {
foreach ($current as $cur) {
yield $cur;
}
} else {
yield $current;
}
if (!$this->input && $this->open && null !== $onEmpty = $this->onEmpty) {
$this->write($onEmpty($this));
}
}
}
}
2 changes: 1 addition & 1 deletion symfony/process/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2004-2015 Fabien Potencier
Copyright (c) 2004-2016 Fabien Potencier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion symfony/process/PhpExecutableFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function find($includeArgs = true)
}

// PHP_BINARY return the current sapi executable
if (defined('PHP_BINARY') && PHP_BINARY && in_array(PHP_SAPI, array('cli', 'cli-server', 'phpdbg')) && is_file(PHP_BINARY)) {
if (PHP_BINARY && in_array(PHP_SAPI, array('cli', 'cli-server', 'phpdbg')) && is_file(PHP_BINARY)) {
return PHP_BINARY.$args;
}

Expand Down
2 changes: 1 addition & 1 deletion symfony/process/PhpProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function setPhpBinary($php)
/**
* {@inheritdoc}
*/
public function start($callback = null)
public function start(callable $callback = null)
{
if (null === $this->getCommandLine()) {
throw new RuntimeException('Unable to find the PHP executable.');
Expand Down

0 comments on commit bbe556f

Please sign in to comment.