Commit 47e6ecfc authored by webchick's avatar webchick

Issue #2578805 by hussainweb: Upgrade to Symfony 2.7.5

parent 05fd0200
......@@ -1046,7 +1046,7 @@
},
{
"name": "symfony/class-loader",
"version": "v2.7.4",
"version": "v2.7.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/class-loader.git",
......@@ -1096,16 +1096,16 @@
},
{
"name": "symfony/console",
"version": "v2.7.4",
"version": "v2.7.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "9ff9032151186bd66ecee727d728f1319f52d1d8"
"reference": "06cb17c013a82f94a3d840682b49425cd00a2161"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/9ff9032151186bd66ecee727d728f1319f52d1d8",
"reference": "9ff9032151186bd66ecee727d728f1319f52d1d8",
"url": "https://api.github.com/repos/symfony/console/zipball/06cb17c013a82f94a3d840682b49425cd00a2161",
"reference": "06cb17c013a82f94a3d840682b49425cd00a2161",
"shasum": ""
},
"require": {
......@@ -1149,20 +1149,20 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2015-09-03 11:40:38"
"time": "2015-09-25 08:32:23"
},
{
"name": "symfony/debug",
"version": "v2.7.4",
"version": "v2.7.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
"reference": "726bf9651d29f53243281d0b6418cfaa5e318281"
"reference": "c79c361bca8e5ada6a47603875a3c964d03b67b1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/debug/zipball/726bf9651d29f53243281d0b6418cfaa5e318281",
"reference": "726bf9651d29f53243281d0b6418cfaa5e318281",
"url": "https://api.github.com/repos/symfony/debug/zipball/c79c361bca8e5ada6a47603875a3c964d03b67b1",
"reference": "c79c361bca8e5ada6a47603875a3c964d03b67b1",
"shasum": ""
},
"require": {
......@@ -1204,20 +1204,20 @@
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
"time": "2015-08-29 11:12:16"
"time": "2015-09-14 08:41:38"
},
{
"name": "symfony/dependency-injection",
"version": "v2.7.4",
"version": "v2.7.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/dependency-injection.git",
"reference": "c0a3a97b9450d77cd8eff81c5825efb3624c255b"
"reference": "422c3819b110f610d79c6f1dc38af23787dc790e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/c0a3a97b9450d77cd8eff81c5825efb3624c255b",
"reference": "c0a3a97b9450d77cd8eff81c5825efb3624c255b",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/422c3819b110f610d79c6f1dc38af23787dc790e",
"reference": "422c3819b110f610d79c6f1dc38af23787dc790e",
"shasum": ""
},
"require": {
......@@ -1264,20 +1264,20 @@
],
"description": "Symfony DependencyInjection Component",
"homepage": "https://symfony.com",
"time": "2015-08-24 07:16:32"
"time": "2015-09-15 08:30:42"
},
{
"name": "symfony/event-dispatcher",
"version": "v2.7.4",
"version": "v2.7.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "b58c916f1db03a611b72dd702564f30ad8fe83fa"
"reference": "ae4dcc2a8d3de98bd794167a3ccda1311597c5d9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b58c916f1db03a611b72dd702564f30ad8fe83fa",
"reference": "b58c916f1db03a611b72dd702564f30ad8fe83fa",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ae4dcc2a8d3de98bd794167a3ccda1311597c5d9",
"reference": "ae4dcc2a8d3de98bd794167a3ccda1311597c5d9",
"shasum": ""
},
"require": {
......@@ -1322,20 +1322,20 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"time": "2015-08-24 07:13:45"
"time": "2015-09-22 13:49:29"
},
{
"name": "symfony/http-foundation",
"version": "v2.7.4",
"version": "v2.7.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
"reference": "7253c2041652353e71560bbd300d6256d170ddaf"
"reference": "e1509119f164a0d0a940d7d924d693a7a28a5470"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/7253c2041652353e71560bbd300d6256d170ddaf",
"reference": "7253c2041652353e71560bbd300d6256d170ddaf",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/e1509119f164a0d0a940d7d924d693a7a28a5470",
"reference": "e1509119f164a0d0a940d7d924d693a7a28a5470",
"shasum": ""
},
"require": {
......@@ -1375,20 +1375,20 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com",
"time": "2015-08-27 06:45:45"
"time": "2015-09-22 13:49:29"
},
{
"name": "symfony/http-kernel",
"version": "v2.7.4",
"version": "v2.7.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
"reference": "fd9c7af92c9e3ade1327cc3af10b17731eebc4a7"
"reference": "353aa457424262d7d4e4289ea483145921cffcb5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/fd9c7af92c9e3ade1327cc3af10b17731eebc4a7",
"reference": "fd9c7af92c9e3ade1327cc3af10b17731eebc4a7",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/353aa457424262d7d4e4289ea483145921cffcb5",
"reference": "353aa457424262d7d4e4289ea483145921cffcb5",
"shasum": ""
},
"require": {
......@@ -1455,20 +1455,20 @@
],
"description": "Symfony HttpKernel Component",
"homepage": "https://symfony.com",
"time": "2015-09-08 14:26:39"
"time": "2015-09-25 11:16:52"
},
{
"name": "symfony/process",
"version": "v2.7.4",
"version": "v2.7.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/Process.git",
"reference": "f7b3f73f70a7f8f49a1c838dc3debbf054732d8e"
"url": "https://github.com/symfony/process.git",
"reference": "b27c8e317922cd3cdd3600850273cf6b82b2e8e9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Process/zipball/f7b3f73f70a7f8f49a1c838dc3debbf054732d8e",
"reference": "f7b3f73f70a7f8f49a1c838dc3debbf054732d8e",
"url": "https://api.github.com/repos/symfony/process/zipball/b27c8e317922cd3cdd3600850273cf6b82b2e8e9",
"reference": "b27c8e317922cd3cdd3600850273cf6b82b2e8e9",
"shasum": ""
},
"require": {
......@@ -1504,7 +1504,7 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
"time": "2015-08-27 06:45:45"
"time": "2015-09-19 19:59:23"
},
{
"name": "symfony/psr-http-message-bridge",
......@@ -1562,16 +1562,16 @@
},
{
"name": "symfony/routing",
"version": "v2.7.4",
"version": "v2.7.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/Routing.git",
"reference": "20b1378cb6efffb77ea0608232f18c8f0dd25109"
"url": "https://github.com/symfony/routing.git",
"reference": "6c5fae83efa20baf166fcf4582f57094e9f60f16"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Routing/zipball/20b1378cb6efffb77ea0608232f18c8f0dd25109",
"reference": "20b1378cb6efffb77ea0608232f18c8f0dd25109",
"url": "https://api.github.com/repos/symfony/routing/zipball/6c5fae83efa20baf166fcf4582f57094e9f60f16",
"reference": "6c5fae83efa20baf166fcf4582f57094e9f60f16",
"shasum": ""
},
"require": {
......@@ -1629,19 +1629,19 @@
"uri",
"url"
],
"time": "2015-08-24 07:13:45"
"time": "2015-09-14 14:14:09"
},
{
"name": "symfony/serializer",
"version": "v2.7.4",
"version": "v2.7.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/Serializer.git",
"url": "https://github.com/symfony/serializer.git",
"reference": "baf24f86a8656eea9c80988f332e51461bfcb67f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Serializer/zipball/baf24f86a8656eea9c80988f332e51461bfcb67f",
"url": "https://api.github.com/repos/symfony/serializer/zipball/baf24f86a8656eea9c80988f332e51461bfcb67f",
"reference": "baf24f86a8656eea9c80988f332e51461bfcb67f",
"shasum": ""
},
......@@ -1694,15 +1694,15 @@
},
{
"name": "symfony/translation",
"version": "v2.7.4",
"version": "v2.7.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/Translation.git",
"url": "https://github.com/symfony/translation.git",
"reference": "485877661835e188cd78345c6d4eef1290d17571"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Translation/zipball/485877661835e188cd78345c6d4eef1290d17571",
"url": "https://api.github.com/repos/symfony/translation/zipball/485877661835e188cd78345c6d4eef1290d17571",
"reference": "485877661835e188cd78345c6d4eef1290d17571",
"shasum": ""
},
......@@ -1755,16 +1755,16 @@
},
{
"name": "symfony/validator",
"version": "v2.7.4",
"version": "v2.7.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/Validator.git",
"reference": "356459a697e26274d44c608513c05c23dc1d8ea7"
"url": "https://github.com/symfony/validator.git",
"reference": "b359dc71e253ce6eb69eefbd5088032241e7a66f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Validator/zipball/356459a697e26274d44c608513c05c23dc1d8ea7",
"reference": "356459a697e26274d44c608513c05c23dc1d8ea7",
"url": "https://api.github.com/repos/symfony/validator/zipball/b359dc71e253ce6eb69eefbd5088032241e7a66f",
"reference": "b359dc71e253ce6eb69eefbd5088032241e7a66f",
"shasum": ""
},
"require": {
......@@ -1821,20 +1821,20 @@
],
"description": "Symfony Validator Component",
"homepage": "https://symfony.com",
"time": "2015-09-06 08:36:38"
"time": "2015-09-23 11:13:27"
},
{
"name": "symfony/yaml",
"version": "v2.7.4",
"version": "v2.7.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/Yaml.git",
"reference": "2dc7b06c065df96cc686c66da2705e5e18aef661"
"url": "https://github.com/symfony/yaml.git",
"reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Yaml/zipball/2dc7b06c065df96cc686c66da2705e5e18aef661",
"reference": "2dc7b06c065df96cc686c66da2705e5e18aef661",
"url": "https://api.github.com/repos/symfony/yaml/zipball/31cb2ad0155c95b88ee55fe12bc7ff92232c1770",
"reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770",
"shasum": ""
},
"require": {
......@@ -1870,7 +1870,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2015-08-24 07:13:45"
"time": "2015-09-14 14:14:09"
},
{
"name": "twig/twig",
......@@ -3362,7 +3362,7 @@
},
{
"name": "symfony/browser-kit",
"version": "v2.7.4",
"version": "v2.7.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/browser-kit.git",
......@@ -3417,16 +3417,16 @@
},
{
"name": "symfony/css-selector",
"version": "v2.7.4",
"version": "v2.7.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
"reference": "ffb5f3b8a75f8d1b9801e74dc6789a0751a670ad"
"reference": "abe19cc0429a06be0c133056d1f9859854860970"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/ffb5f3b8a75f8d1b9801e74dc6789a0751a670ad",
"reference": "ffb5f3b8a75f8d1b9801e74dc6789a0751a670ad",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/abe19cc0429a06be0c133056d1f9859854860970",
"reference": "abe19cc0429a06be0c133056d1f9859854860970",
"shasum": ""
},
"require": {
......@@ -3466,20 +3466,20 @@
],
"description": "Symfony CssSelector Component",
"homepage": "https://symfony.com",
"time": "2015-08-24 07:13:45"
"time": "2015-09-22 13:49:29"
},
{
"name": "symfony/dom-crawler",
"version": "v2.7.4",
"version": "v2.7.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/dom-crawler.git",
"reference": "2a161e4ee2b2f33d4153be58df4f6f2a5506936e"
"reference": "2e185ca136399f902b948694987e62c80099c052"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/2a161e4ee2b2f33d4153be58df4f6f2a5506936e",
"reference": "2a161e4ee2b2f33d4153be58df4f6f2a5506936e",
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/2e185ca136399f902b948694987e62c80099c052",
"reference": "2e185ca136399f902b948694987e62c80099c052",
"shasum": ""
},
"require": {
......@@ -3519,7 +3519,7 @@
],
"description": "Symfony DomCrawler Component",
"homepage": "https://symfony.com",
"time": "2015-08-26 10:48:03"
"time": "2015-09-20 21:13:58"
}
],
"aliases": [],
......
This diff is collapsed.
......@@ -885,13 +885,15 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI
try {
$exitCode = $command->run($input, $output);
} catch (\Exception $e) {
$event = new ConsoleExceptionEvent($command, $input, $output, $e, $e->getCode());
$this->dispatcher->dispatch(ConsoleEvents::EXCEPTION, $event);
$e = $event->getException();
$event = new ConsoleTerminateEvent($command, $input, $output, $e->getCode());
$this->dispatcher->dispatch(ConsoleEvents::TERMINATE, $event);
$event = new ConsoleExceptionEvent($command, $input, $output, $e, $event->getExitCode());
$this->dispatcher->dispatch(ConsoleEvents::EXCEPTION, $event);
throw $event->getException();
throw $e;
}
} else {
$exitCode = ConsoleCommandEvent::RETURN_CODE_DISABLED;
......
......@@ -399,7 +399,7 @@ public function setInputStream($stream)
/**
* Returns the helper's input stream.
*
* @return string
* @return resource|null The input stream or null if the default STDIN is used
*/
public function getInputStream()
{
......
......@@ -11,6 +11,7 @@
namespace Symfony\Component\Console\Helper;
use Symfony\Component\Console\Output\ConsoleOutputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\Process;
......@@ -37,6 +38,10 @@ class ProcessHelper extends Helper
*/
public function run(OutputInterface $output, $cmd, $error = null, $callback = null, $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE)
{
if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput();
}
$formatter = $this->getHelperSet()->get('debug_formatter');
if (is_array($cmd)) {
......@@ -109,6 +114,10 @@ public function mustRun(OutputInterface $output, $cmd, $error = null, $callback
*/
public function wrapCallback(OutputInterface $output, Process $process, $callback = null)
{
if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput();
}
$formatter = $this->getHelperSet()->get('debug_formatter');
$that = $this;
......
......@@ -11,6 +11,7 @@
namespace Symfony\Component\Console\Helper;
use Symfony\Component\Console\Output\ConsoleOutputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
......@@ -54,6 +55,10 @@ class ProgressBar
*/
public function __construct(OutputInterface $output, $max = 0)
{
if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput();
}
$this->output = $output;
$this->setMaxSteps($max);
......@@ -476,7 +481,7 @@ public function clear()
/**
* Sets the progress bar maximal steps.
*
* @param int The progress bar max steps
* @param int $max The progress bar max steps
*/
private function setMaxSteps($max)
{
......
......@@ -12,6 +12,7 @@
namespace Symfony\Component\Console\Helper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\ConsoleOutputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
use Symfony\Component\Console\Question\Question;
......@@ -41,6 +42,10 @@ class QuestionHelper extends Helper
*/
public function ask(InputInterface $input, OutputInterface $output, Question $question)
{
if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput();
}
if (!$input->isInteractive()) {
return $question->getDefault();
}
......
......@@ -376,7 +376,7 @@ private function buildTableRows($rows)
* fill rows that contains rowspan > 1.
*
* @param array $rows
* @param array $line
* @param int $line
*
* @return array
*/
......@@ -429,7 +429,7 @@ private function fillNextRows($rows, $line)
* fill cells for a row that contains colspan > 1.
*
* @param array $row
* @param array $column
* @param int $column
*
* @return array
*/
......
......@@ -48,7 +48,12 @@ public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = nu
{
parent::__construct($this->openOutputStream(), $verbosity, $decorated, $formatter);
$actualDecorated = $this->isDecorated();
$this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated, $this->getFormatter());
if (null === $decorated) {
$this->setDecorated($actualDecorated && $this->stderr->isDecorated());
}
}
/**
......
......@@ -48,7 +48,7 @@ public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL);
/**
* Writes a message to the output and adds a newline at the end.
*
* @param string|array $messages The message as an array of lines of a single string
* @param string|array $messages The message as an array of lines or a single string
* @param int $type The type of output (one of the OUTPUT constants)
*
* @throws \InvalidArgumentException When unknown output type is given
......
......@@ -35,7 +35,7 @@ class StreamOutput extends Output
/**
* Constructor.
*
* @param mixed $stream A stream resource
* @param resource $stream A stream resource
* @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface)
* @param bool|null $decorated Whether to decorate messages (null for auto-guessing)
* @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter)
......
......@@ -884,7 +884,7 @@ public function testRunWithDispatcher()
$tester = new ApplicationTester($application);
$tester->run(array('command' => 'foo'));
$this->assertEquals('before.foo.after.', $tester->getDisplay());
$this->assertEquals('before.foo.after.'.PHP_EOL, $tester->getDisplay());
}
/**
......@@ -920,7 +920,7 @@ public function testRunDispatchesAllEventsWithException()
$tester = new ApplicationTester($application);
$tester->run(array('command' => 'foo'));
$this->assertContains('before.foo.after.caught.', $tester->getDisplay());
$this->assertContains('before.foo.caught.after.', $tester->getDisplay());
}
public function testRunWithDispatcherSkippingCommand()
......@@ -965,14 +965,14 @@ protected function getDispatcher($skipCommand = false)
}
});
$dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use ($skipCommand) {
$event->getOutput()->write('after.');
$event->getOutput()->writeln('after.');
if (!$skipCommand) {
$event->setExitCode(113);
}
});
$dispatcher->addListener('console.exception', function (ConsoleExceptionEvent $event) {
$event->getOutput()->writeln('caught.');
$event->getOutput()->write('caught.');
$event->setException(new \LogicException('caught.', $event->getExitCode(), $event->getException()));
});
......
<?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\Console\Helper;
use Symfony\Component\Console\Tests;
function time()
{
return Tests\time();
}
namespace Symfony\Component\Console\Tests;
function with_clock_mock($enable = null)
{
static $enabled;
if (null === $enable) {
return $enabled;
}
$enabled = $enable;
}
function time()
{
if (!with_clock_mock()) {
return \time();
}
return $_SERVER['REQUEST_TIME'];
}
......@@ -2,11 +2,11 @@
<symfony>
<commands>
<command id="help" name="help">
<usages>