diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig index 669f654b72..a2a7dff8b4 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig @@ -31,84 +31,89 @@ {% endset %} {% set text %} - {% if collector.applicationname %} +
+ {% if collector.applicationname %} +
+ {{ collector.applicationname }} + {{ collector.applicationversion }} +
+ {% endif %} +
- {{ collector.applicationname }} - {{ collector.applicationversion }} -
- {% endif %} - -
- Profiler token - - {% if profiler_url %} - {{ collector.token }} - {% else %} - {{ collector.token }} - {% endif %} - -
- - {% if 'n/a' != collector.appname %} -
- Kernel name - {{ collector.appname }} -
- {% endif %} - - {% if 'n/a' != collector.env %} -
- Environment - {{ collector.env }} -
- {% endif %} - - {% if 'n/a' != collector.debug %} -
- Debug - {{ collector.debug ? 'enabled' : 'disabled' }} -
- {% endif %} - -
- PHP version - - {{ collector.phpversion }} -   View phpinfo() - -
- -
- PHP Extensions - xdebug - accel -
- -
- PHP SAPI - {{ collector.sapiName }} -
- - - {% if collector.symfonyversion is defined %} -
- Resources + Profiler token - {% if 'Silex' == collector.applicationname %} - - Read Silex Docs - + {% if profiler_url %} + {{ collector.token }} {% else %} - - Read Symfony {{ collector.symfonyversion }} Docs - + {{ collector.token }} {% endif %}
- {% endif %} + + {% if 'n/a' != collector.appname %} +
+ Kernel name + {{ collector.appname }} +
+ {% endif %} + + {% if 'n/a' != collector.env %} +
+ Environment + {{ collector.env }} +
+ {% endif %} + + {% if 'n/a' != collector.debug %} +
+ Debug + {{ collector.debug ? 'enabled' : 'disabled' }} +
+ {% endif %} +
+ +
+
+ PHP version + + {{ collector.phpversion }} +   View phpinfo() + +
+ +
+ PHP Extensions + xdebug + accel +
+ +
+ PHP SAPI + {{ collector.sapiName }} +
+
+ +
+ {% if collector.symfonyversion is defined %} +
+ Resources + + {% if 'Silex' == collector.applicationname %} + + Read Silex Docs + + {% else %} + + Read Symfony {{ collector.symfonyversion }} Docs + + {% endif %} + +
+ {% endif %} +
{% endset %} - {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: true, name: 'config', status: block_status }) }} + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: true, name: 'config', status: block_status, additional_classes: 'sf-toolbar-block-right' }) }} {% endblock %} {% block menu %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 6d07bc4e0b..1b61835d10 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -104,6 +104,16 @@ .sf-toolbar-block .sf-toolbar-info-piece-additional-detail { display: none; } +.sf-toolbar-block .sf-toolbar-info-group { + margin-bottom: 4px; + padding-bottom: 2px; + border-bottom: 1px solid #333333; +} +.sf-toolbar-block .sf-toolbar-info-group:last-child { + margin-bottom: 0; + padding-bottom: 0; + border-bottom: none; +} .sf-toolbar-block .sf-toolbar-info-piece .sf-toolbar-status { padding: 2px 5px; @@ -436,7 +446,7 @@ font-size: 13px; } - .sf-toolbar-block-config { + .sf-toolbar-block-right { float: right; margin-left: 0; margin-right: 0; diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig index 2f30e05c9a..7424f1fcef 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig @@ -1,4 +1,4 @@ -
+
{% if link %}{% endif %}
{{ icon|default('') }}
{% if link %}
{% endif %} diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index 2213fe4402..21db95ec02 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Console; +use Symfony\Component\Console\Exception\ExceptionInterface; use Symfony\Component\Console\Helper\DebugFormatterHelper; use Symfony\Component\Console\Helper\ProcessHelper; use Symfony\Component\Console\Helper\QuestionHelper; @@ -787,6 +788,14 @@ class Application return $command->run($input, $output); } + // bind before the console.command event, so the listeners have access to input options/arguments + try { + $command->mergeApplicationDefinition(); + $input->bind($command->getDefinition()); + } catch (ExceptionInterface $e) { + // ignore invalid options/arguments for now, to allow the event listeners to customize the InputDefinition + } + $event = new ConsoleCommandEvent($command, $input, $output); $this->dispatcher->dispatch(ConsoleEvents::COMMAND, $event); diff --git a/src/Symfony/Component/Console/Command/Command.php b/src/Symfony/Component/Console/Command/Command.php index caa2bdb65b..d3db5bce56 100644 --- a/src/Symfony/Component/Console/Command/Command.php +++ b/src/Symfony/Component/Console/Command/Command.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Console\Command; +use Symfony\Component\Console\Exception\ExceptionInterface; use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputArgument; @@ -218,7 +219,7 @@ class Command // bind the input against the command specific arguments/options try { $input->bind($this->definition); - } catch (\Exception $e) { + } catch (ExceptionInterface $e) { if (!$this->ignoreValidationErrors) { throw $e; } diff --git a/src/Symfony/Component/Console/Tests/ApplicationTest.php b/src/Symfony/Component/Console/Tests/ApplicationTest.php index 802eabb288..9b5b1f0e69 100644 --- a/src/Symfony/Component/Console/Tests/ApplicationTest.php +++ b/src/Symfony/Component/Console/Tests/ApplicationTest.php @@ -920,6 +920,63 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase $this->assertEquals(ConsoleCommandEvent::RETURN_CODE_DISABLED, $exitCode); } + public function testRunWithDispatcherAccessingInputOptions() + { + $noInteractionValue = null; + $quietValue = null; + + $dispatcher = $this->getDispatcher(); + $dispatcher->addListener('console.command', function (ConsoleCommandEvent $event) use (&$noInteractionValue, &$quietValue) { + $input = $event->getInput(); + + $noInteractionValue = $input->getOption('no-interaction'); + $quietValue = $input->getOption('quiet'); + }); + + $application = new Application(); + $application->setDispatcher($dispatcher); + $application->setAutoExit(false); + + $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) { + $output->write('foo.'); + }); + + $tester = new ApplicationTester($application); + $tester->run(array('command' => 'foo', '--no-interaction' => true)); + + $this->assertTrue($noInteractionValue); + $this->assertFalse($quietValue); + } + + public function testRunWithDispatcherAddingInputOptions() + { + $extraValue = null; + + $dispatcher = $this->getDispatcher(); + $dispatcher->addListener('console.command', function (ConsoleCommandEvent $event) use (&$extraValue) { + $definition = $event->getCommand()->getDefinition(); + $input = $event->getInput(); + + $definition->addOption(new InputOption('extra', null, InputOption::VALUE_REQUIRED)); + $input->bind($definition); + + $extraValue = $input->getOption('extra'); + }); + + $application = new Application(); + $application->setDispatcher($dispatcher); + $application->setAutoExit(false); + + $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) { + $output->write('foo.'); + }); + + $tester = new ApplicationTester($application); + $tester->run(array('command' => 'foo', '--extra' => 'some test value')); + + $this->assertEquals('some test value', $extraValue); + } + public function testTerminalDimensions() { $application = new Application(); diff --git a/src/Symfony/Component/Security/composer.json b/src/Symfony/Component/Security/composer.json index 555b6ec0ea..6167fded3a 100644 --- a/src/Symfony/Component/Security/composer.json +++ b/src/Symfony/Component/Security/composer.json @@ -19,7 +19,8 @@ "php": ">=5.5.9", "symfony/event-dispatcher": "~2.8|~3.0", "symfony/http-foundation": "~2.8|~3.0", - "symfony/http-kernel": "~2.8|~3.0" + "symfony/http-kernel": "~2.8|~3.0", + "symfony/property-access": "~2.8|~3.0.0" }, "replace": { "symfony/security-core": "self.version",