diff --git a/.travis.yml b/.travis.yml
index 8dec46a3d8d7c..5e3646df3fa82 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -50,5 +50,5 @@ install:
script:
- if [ "$deps" = "no" ]; then echo "$components" | parallel --gnu --keep-order 'echo -e "\\nRunning {} tests"; phpunit --exclude-group tty,benchmark,intl-data {} || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
- if [ "$deps" = "no" ]; then echo -e "\\nRunning tests requiring tty"; phpunit --group tty || (echo -e "\\e[41mKO\\e[0m tty group" && $(exit 1)); fi;
- - if [ "$deps" = "high" ]; then echo "$components" | parallel --gnu --keep-order -j10% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source update; phpunit --exclude-group tty,benchmark,intl-data || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
+ - if [ "$deps" = "high" ]; then echo "$components" | parallel --gnu --keep-order -j10% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source update; phpunit --exclude-group tty,benchmark,intl-data,legacy || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
- if [ "$deps" = "low" ]; then echo "$components" | parallel --gnu --keep-order -j10% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source --prefer-lowest --prefer-stable update; phpunit --exclude-group tty,benchmark,intl-data || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
diff --git a/UPGRADE-2.8.md b/UPGRADE-2.8.md
new file mode 100644
index 0000000000000..966f1f4711132
--- /dev/null
+++ b/UPGRADE-2.8.md
@@ -0,0 +1,138 @@
+UPGRADE FROM 2.7 to 2.8
+=======================
+
+Form
+----
+
+ * The "cascade_validation" option was deprecated. Use the "constraints"
+ option together with the `Valid` constraint instead. Contrary to
+ "cascade_validation", "constraints" must be set on the respective child forms,
+ not the parent form.
+
+ Before:
+
+ ```php
+ $form = $this->createForm('form', $article, array('cascade_validation' => true))
+ ->add('author', new AuthorType())
+ ->getForm();
+ ```
+
+ After:
+
+ ```php
+ use Symfony\Component\Validator\Constraints\Valid;
+
+ $form = $this->createForm('form', $article)
+ ->add('author', new AuthorType(), array(
+ 'constraints' => new Valid(),
+ ))
+ ->getForm();
+ ```
+
+ Alternatively, you can set the `Valid` constraint in the model itself:
+
+ ```php
+ use Symfony\Component\Validator\Constraints as Assert;
+
+ class Article
+ {
+ /**
+ * @Assert\Valid
+ */
+ private $author;
+ }
+ ```
+
+Translator
+----------
+
+ * The `getMessages()` method of the `Symfony\Component\Translation\Translator` was deprecated and will be removed in
+ Symfony 3.0. You should use the `getCatalogue()` method of the `Symfony\Component\Translation\TranslatorBagInterface`.
+
+ Before:
+
+ ```php
+ $messages = $translator->getMessages();
+ ```
+
+ After:
+
+ ```php
+ $catalogue = $translator->getCatalogue($locale);
+ $messages = $catalogue->all();
+
+ while ($catalogue = $catalogue->getFallbackCatalogue()) {
+ $messages = array_replace_recursive($catalogue->all(), $messages);
+ }
+ ```
+
+DependencyInjection
+-------------------
+
+ * The concept of scopes were deprecated, the deprecated methods are:
+
+ - `Symfony\Component\DependencyInjection\ContainerBuilder::getScopes()`
+ - `Symfony\Component\DependencyInjection\ContainerBuilder::getScopeChildren()`
+ - `Symfony\Component\DependencyInjection\ContainerInterface::enterScope()`
+ - `Symfony\Component\DependencyInjection\ContainerInterface::leaveScope()`
+ - `Symfony\Component\DependencyInjection\ContainerInterface::addScope()`
+ - `Symfony\Component\DependencyInjection\ContainerInterface::hasScope()`
+ - `Symfony\Component\DependencyInjection\ContainerInterface::isScopeActive()`
+ - `Symfony\Component\DependencyInjection\Definition::setScope()`
+ - `Symfony\Component\DependencyInjection\Definition::getScope()`
+ - `Symfony\Component\DependencyInjection\Reference::isStrict()`
+
+ Also, the `$scope` and `$strict` parameters of `Symfony\Component\DependencyInjection\ContainerInterface::set()` and `Symfony\Component\DependencyInjection\Reference` respectively were deprecated.
+
+ * A new `shared` flag has been added to the service definition
+ in replacement of the `prototype` scope.
+
+ Before:
+
+ ```php
+ use Symfony\Component\DependencyInjection\ContainerBuilder;
+
+ $container = new ContainerBuilder();
+ $container
+ ->register('foo', 'stdClass')
+ ->setScope(ContainerBuilder::SCOPE_PROTOTYPE)
+ ;
+ ```
+
+ ```yml
+ services:
+ foo:
+ class: stdClass
+ scope: prototype
+ ```
+
+ ```xml
+
+
+
+ ```
+
+ After:
+
+ ```php
+ use Symfony\Component\DependencyInjection\ContainerBuilder;
+
+ $container = new ContainerBuilder();
+ $container
+ ->register('foo', 'stdClass')
+ ->setShared(false)
+ ;
+ ```
+
+ ```yml
+ services:
+ foo:
+ class: stdClass
+ shared: false
+ ```
+
+ ```xml
+
+
+
+ ```
diff --git a/UPGRADE-3.0.md b/UPGRADE-3.0.md
index 6b6d6cad8d688..de9a230a55468 100644
--- a/UPGRADE-3.0.md
+++ b/UPGRADE-3.0.md
@@ -600,6 +600,86 @@ UPGRADE FROM 2.x to 3.0
* The `Resources/` directory was moved to `Core/Resources/`
+ * The `key` settings of `anonymous` and `remember_me` are renamed to `secret`.
+
+ Before:
+
+ ```yaml
+ security:
+ # ...
+ firewalls:
+ default:
+ # ...
+ anonymous: { key: "%secret%" }
+ remember_me:
+ key: "%secret%"
+ ```
+
+ ```xml
+
+
+
+
+
+
+
+
+
+
+
+ ```
+
+ ```php
+ // ...
+ $container->loadFromExtension('security', array(
+ // ...
+ 'firewalls' => array(
+ // ...
+ 'anonymous' => array('key' => '%secret%'),
+ 'remember_me' => array('key' => '%secret%'),
+ ),
+ ));
+ ```
+
+ After:
+
+ ```yaml
+ security:
+ # ...
+ firewalls:
+ default:
+ # ...
+ anonymous: { secret: "%secret%" }
+ remember_me:
+ secret: "%secret%"
+ ```
+
+ ```xml
+
+
+
+
+
+
+
+
+
+
+
+ ```
+
+ ```php
+ // ...
+ $container->loadFromExtension('security', array(
+ // ...
+ 'firewalls' => array(
+ // ...
+ 'anonymous' => array('secret' => '%secret%'),
+ 'remember_me' => array('secret' => '%secret%'),
+ ),
+ ));
+ ```
+
### Translator
* The `Translator::setFallbackLocale()` method has been removed in favor of
diff --git a/composer.json b/composer.json
index 115adbfc16f6a..1b7d12551747f 100644
--- a/composer.json
+++ b/composer.json
@@ -97,7 +97,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "2.7-dev"
+ "dev-master": "2.8-dev"
}
}
}
diff --git a/src/Symfony/Bridge/Doctrine/composer.json b/src/Symfony/Bridge/Doctrine/composer.json
index ea8b88b101b62..b76704cba7154 100644
--- a/src/Symfony/Bridge/Doctrine/composer.json
+++ b/src/Symfony/Bridge/Doctrine/composer.json
@@ -20,16 +20,16 @@
"doctrine/common": "~2.3"
},
"require-dev": {
- "symfony/phpunit-bridge": "~2.7",
- "symfony/stopwatch": "~2.2",
- "symfony/dependency-injection": "~2.2",
- "symfony/form": "~2.7,>=2.7.1",
- "symfony/http-kernel": "~2.2",
- "symfony/property-access": "~2.3",
- "symfony/security": "~2.2",
- "symfony/expression-language": "~2.2",
- "symfony/validator": "~2.5,>=2.5.5",
- "symfony/translation": "~2.0,>=2.0.5",
+ "symfony/phpunit-bridge": "~2.7|~3.0.0",
+ "symfony/stopwatch": "~2.2|~3.0.0",
+ "symfony/dependency-injection": "~2.2|~3.0.0",
+ "symfony/form": "~2.7,>=2.7.1|~3.0.0",
+ "symfony/http-kernel": "~2.2|~3.0.0",
+ "symfony/property-access": "~2.3|~3.0.0",
+ "symfony/security": "~2.2|~3.0.0",
+ "symfony/expression-language": "~2.2|~3.0.0",
+ "symfony/validator": "~2.5,>=2.5.5|~3.0.0",
+ "symfony/translation": "~2.0,>=2.0.5|~3.0.0",
"doctrine/data-fixtures": "1.0.*",
"doctrine/dbal": "~2.2",
"doctrine/orm": "~2.2,>=2.2.3"
@@ -47,7 +47,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "2.7-dev"
+ "dev-master": "2.8-dev"
}
}
}
diff --git a/src/Symfony/Bridge/Monolog/Handler/DebugHandler.php b/src/Symfony/Bridge/Monolog/Handler/DebugHandler.php
index c959a5a94fcb7..f1046c96a6ad1 100644
--- a/src/Symfony/Bridge/Monolog/Handler/DebugHandler.php
+++ b/src/Symfony/Bridge/Monolog/Handler/DebugHandler.php
@@ -35,6 +35,7 @@ public function getLogs()
'priority' => $record['level'],
'priorityName' => $record['level_name'],
'context' => $record['context'],
+ 'channel' => isset($record['channel']) ? $record['channel'] : '',
);
}
diff --git a/src/Symfony/Bridge/Monolog/composer.json b/src/Symfony/Bridge/Monolog/composer.json
index a3a4e374130e2..61b6ff02d3518 100644
--- a/src/Symfony/Bridge/Monolog/composer.json
+++ b/src/Symfony/Bridge/Monolog/composer.json
@@ -20,10 +20,10 @@
"monolog/monolog": "~1.11"
},
"require-dev": {
- "symfony/phpunit-bridge": "~2.7",
- "symfony/http-kernel": "~2.4",
- "symfony/console": "~2.4",
- "symfony/event-dispatcher": "~2.2"
+ "symfony/phpunit-bridge": "~2.7|~3.0.0",
+ "symfony/http-kernel": "~2.4|~3.0.0",
+ "symfony/console": "~2.4|~3.0.0",
+ "symfony/event-dispatcher": "~2.2|~3.0.0"
},
"suggest": {
"symfony/http-kernel": "For using the debugging handlers together with the response life cycle of the HTTP kernel.",
@@ -36,7 +36,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "2.7-dev"
+ "dev-master": "2.8-dev"
}
}
}
diff --git a/src/Symfony/Bridge/PhpUnit/composer.json b/src/Symfony/Bridge/PhpUnit/composer.json
index 8412a277bae98..90ac8e5d9dd19 100644
--- a/src/Symfony/Bridge/PhpUnit/composer.json
+++ b/src/Symfony/Bridge/PhpUnit/composer.json
@@ -28,7 +28,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "2.7-dev"
+ "dev-master": "2.8-dev"
}
}
}
diff --git a/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php b/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php
index bba5055d0085d..076484567aae6 100644
--- a/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php
+++ b/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php
@@ -68,9 +68,9 @@ public function getProxyFactoryCode(Definition $definition, $id)
{
$instantiation = 'return';
- if (ContainerInterface::SCOPE_CONTAINER === $definition->getScope()) {
+ if ($definition->isShared() && ContainerInterface::SCOPE_CONTAINER === $definition->getScope(false)) {
$instantiation .= " \$this->services['$id'] =";
- } elseif (ContainerInterface::SCOPE_PROTOTYPE !== $scope = $definition->getScope()) {
+ } elseif ($definition->isShared() && ContainerInterface::SCOPE_PROTOTYPE !== $scope = $definition->getScope(false)) {
$instantiation .= " \$this->services['$id'] = \$this->scopedServices['$scope']['$id'] =";
}
diff --git a/src/Symfony/Bridge/ProxyManager/composer.json b/src/Symfony/Bridge/ProxyManager/composer.json
index 24a8edea01b45..b37bf7b875759 100644
--- a/src/Symfony/Bridge/ProxyManager/composer.json
+++ b/src/Symfony/Bridge/ProxyManager/composer.json
@@ -17,12 +17,12 @@
],
"require": {
"php": ">=5.3.9",
- "symfony/dependency-injection": "~2.3",
+ "symfony/dependency-injection": "~2.8|~3.0.0",
"ocramius/proxy-manager": "~0.4|~1.0"
},
"require-dev": {
- "symfony/phpunit-bridge": "~2.7",
- "symfony/config": "~2.3"
+ "symfony/phpunit-bridge": "~2.7|~3.0.0",
+ "symfony/config": "~2.3|~3.0.0"
},
"autoload": {
"psr-4": { "Symfony\\Bridge\\ProxyManager\\": "" }
@@ -30,7 +30,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "2.7-dev"
+ "dev-master": "2.8-dev"
}
}
}
diff --git a/src/Symfony/Bridge/Swiftmailer/composer.json b/src/Symfony/Bridge/Swiftmailer/composer.json
index 6d3fa5057cd9d..3e5fcc3bf837a 100644
--- a/src/Symfony/Bridge/Swiftmailer/composer.json
+++ b/src/Symfony/Bridge/Swiftmailer/composer.json
@@ -20,7 +20,7 @@
"swiftmailer/swiftmailer": ">=4.2.0,<6.0-dev"
},
"require-dev": {
- "symfony/phpunit-bridge": "~2.7"
+ "symfony/phpunit-bridge": "~2.7|~3.0.0"
},
"suggest": {
"symfony/http-kernel": ""
@@ -31,7 +31,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "2.7-dev"
+ "dev-master": "2.8-dev"
}
}
}
diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
index a0828b38003fd..11182cf97d660 100644
--- a/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
+++ b/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
@@ -176,6 +176,11 @@
{{ block('form_widget_simple') }}
{%- endblock email_widget -%}
+{%- block range_widget -%}
+ {% set type = type|default('range') %}
+ {{- block('form_widget_simple') -}}
+{%- endblock range_widget %}
+
{%- block button_widget -%}
{%- if label is empty -%}
{%- if label_format is not empty -%}
@@ -314,7 +319,6 @@
{%- block widget_attributes -%}
id="{{ id }}" name="{{ full_name }}"
- {%- if read_only and attr.readonly is not defined %} readonly="readonly"{% endif -%}
{%- if disabled %} disabled="disabled"{% endif -%}
{%- if required %} required="required"{% endif -%}
{%- for attrname, attrvalue in attr -%}
diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3LayoutTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3LayoutTest.php
index a9d161b2b909a..ef7f91bbe9e1f 100644
--- a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3LayoutTest.php
+++ b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3LayoutTest.php
@@ -29,6 +29,7 @@ class FormExtensionBootstrap3LayoutTest extends AbstractBootstrap3LayoutTest
protected $testableFeatures = array(
'choice_attr',
+ 'choice_label_attr',
);
protected function setUp()
@@ -115,14 +116,4 @@ protected function setTheme(FormView $view, array $themes)
{
$this->extension->renderer->setTheme($view, $themes);
}
-
- public function testRange()
- {
- // No-op for forward compatibility with AbstractLayoutTest 2.8
- }
-
- public function testRangeWithMinMaxValues()
- {
- // No-op for forward compatibility with AbstractLayoutTest 2.8
- }
}
diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php
index 1bce43b83780c..d0696d7c2ccb5 100644
--- a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php
+++ b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php
@@ -30,6 +30,7 @@ class FormExtensionDivLayoutTest extends AbstractDivLayoutTest
protected $testableFeatures = array(
'choice_attr',
+ 'choice_label_attr',
);
protected function setUp()
@@ -208,14 +209,4 @@ public static function themeInheritanceProvider()
array(array('parent_label.html.twig'), array('child_label.html.twig')),
);
}
-
- public function testRange()
- {
- // No-op for forward compatibility with AbstractLayoutTest 2.8
- }
-
- public function testRangeWithMinMaxValues()
- {
- // No-op for forward compatibility with AbstractLayoutTest 2.8
- }
}
diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTableLayoutTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTableLayoutTest.php
index 555ea306fca89..fd5c1e8b1c614 100644
--- a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTableLayoutTest.php
+++ b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTableLayoutTest.php
@@ -29,6 +29,7 @@ class FormExtensionTableLayoutTest extends AbstractTableLayoutTest
protected $testableFeatures = array(
'choice_attr',
+ 'choice_label_attr',
);
protected function setUp()
@@ -116,14 +117,4 @@ protected function setTheme(FormView $view, array $themes)
{
$this->extension->renderer->setTheme($view, $themes);
}
-
- public function testRange()
- {
- // No-op for forward compatibility with AbstractLayoutTest 2.8
- }
-
- public function testRangeWithMinMaxValues()
- {
- // No-op for forward compatibility with AbstractLayoutTest 2.8
- }
}
diff --git a/src/Symfony/Bridge/Twig/composer.json b/src/Symfony/Bridge/Twig/composer.json
index 1ad00a67b7ce8..605901bc8a5ae 100644
--- a/src/Symfony/Bridge/Twig/composer.json
+++ b/src/Symfony/Bridge/Twig/composer.json
@@ -20,21 +20,21 @@
"twig/twig": "~1.18"
},
"require-dev": {
- "symfony/phpunit-bridge": "~2.7",
- "symfony/asset": "~2.7",
- "symfony/finder": "~2.3",
- "symfony/form": "~2.7,>=2.7.2",
- "symfony/http-kernel": "~2.3",
- "symfony/intl": "~2.3",
- "symfony/routing": "~2.2",
- "symfony/templating": "~2.1",
- "symfony/translation": "~2.7",
- "symfony/yaml": "~2.0,>=2.0.5",
- "symfony/security": "~2.6",
- "symfony/stopwatch": "~2.2",
- "symfony/console": "~2.7",
- "symfony/var-dumper": "~2.6",
- "symfony/expression-language": "~2.4"
+ "symfony/phpunit-bridge": "~2.7|~3.0.0",
+ "symfony/asset": "~2.7|~3.0.0",
+ "symfony/finder": "~2.3|~3.0.0",
+ "symfony/form": "~2.8",
+ "symfony/http-kernel": "~2.3|~3.0.0",
+ "symfony/intl": "~2.3|~3.0.0",
+ "symfony/routing": "~2.2|~3.0.0",
+ "symfony/templating": "~2.1|~3.0.0",
+ "symfony/translation": "~2.7|~3.0.0",
+ "symfony/yaml": "~2.0,>=2.0.5|~3.0.0",
+ "symfony/security": "~2.6|~3.0.0",
+ "symfony/stopwatch": "~2.2|~3.0.0",
+ "symfony/console": "~2.7|~3.0.0",
+ "symfony/var-dumper": "~2.6|~3.0.0",
+ "symfony/expression-language": "~2.4|~3.0.0"
},
"suggest": {
"symfony/finder": "",
@@ -56,7 +56,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "2.7-dev"
+ "dev-master": "2.8-dev"
}
}
}
diff --git a/src/Symfony/Bundle/DebugBundle/composer.json b/src/Symfony/Bundle/DebugBundle/composer.json
index e7ccc9a4b11f1..66d77643479dd 100644
--- a/src/Symfony/Bundle/DebugBundle/composer.json
+++ b/src/Symfony/Bundle/DebugBundle/composer.json
@@ -17,15 +17,15 @@
],
"require": {
"php": ">=5.3.9",
- "symfony/http-kernel": "~2.6",
- "symfony/twig-bridge": "~2.6",
- "symfony/var-dumper": "~2.6"
+ "symfony/http-kernel": "~2.6|~3.0.0",
+ "symfony/twig-bridge": "~2.6|~3.0.0",
+ "symfony/var-dumper": "~2.6|~3.0.0"
},
"require-dev": {
- "symfony/phpunit-bridge": "~2.7",
- "symfony/config": "~2.3",
- "symfony/dependency-injection": "~2.3",
- "symfony/web-profiler-bundle": "~2.3"
+ "symfony/phpunit-bridge": "~2.7|~3.0.0",
+ "symfony/config": "~2.3|~3.0.0",
+ "symfony/dependency-injection": "~2.3|~3.0.0",
+ "symfony/web-profiler-bundle": "~2.3|~3.0.0"
},
"suggest": {
"symfony/config": "For service container configuration",
@@ -37,7 +37,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "2.7-dev"
+ "dev-master": "2.8-dev"
}
}
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php
index 6af52feaaec57..44ebdeb36e7d4 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php
@@ -44,7 +44,8 @@ protected function configure()
{
$this
->setDefinition(array(
- new InputArgument('address', InputArgument::OPTIONAL, 'Address:port', '127.0.0.1:8000'),
+ new InputArgument('address', InputArgument::OPTIONAL, 'Address:port', '127.0.0.1'),
+ new InputOption('port', 'p', InputOption::VALUE_REQUIRED, 'Address port number', '8000'),
new InputOption('docroot', 'd', InputOption::VALUE_REQUIRED, 'Document root', null),
new InputOption('router', 'r', InputOption::VALUE_REQUIRED, 'Path to custom router script'),
))
@@ -99,9 +100,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$address = $input->getArgument('address');
if (false === strpos($address, ':')) {
- $output->writeln('The address has to be of the form bind-address:port.');
-
- return 1;
+ $address = $address.':'.$input->getOption('port');
}
if ($this->isOtherServerProcessRunning($address)) {
diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ServerStartCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ServerStartCommand.php
index 04906317fa944..6300e9774a25d 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Command/ServerStartCommand.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Command/ServerStartCommand.php
@@ -33,9 +33,11 @@ protected function configure()
{
$this
->setDefinition(array(
- new InputArgument('address', InputArgument::OPTIONAL, 'Address:port', '127.0.0.1:8000'),
+ new InputArgument('address', InputArgument::OPTIONAL, 'Address:port', '127.0.0.1'),
+ new InputOption('port', 'p', InputOption::VALUE_REQUIRED, 'Address port number', '8000'),
new InputOption('docroot', 'd', InputOption::VALUE_REQUIRED, 'Document root', null),
new InputOption('router', 'r', InputOption::VALUE_REQUIRED, 'Path to custom router script'),
+ new InputOption('force', 'f', InputOption::VALUE_NONE, 'Force web server startup'),
))
->setName('server:start')
->setDescription('Starts PHP built-in web server in the background')
@@ -106,13 +108,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
$address = $input->getArgument('address');
if (false === strpos($address, ':')) {
- $output->writeln('The address has to be of the form bind-address:port.');
-
- return 1;
+ $address = $address.':'.$input->getOption('port');
}
- if ($this->isOtherServerProcessRunning($address)) {
+ if (!$input->getOption('force') && $this->isOtherServerProcessRunning($address)) {
$output->writeln(sprintf('A process is already listening on http://%s.', $address));
+ $output->writeln(sprintf('Use the --force option if the server process terminated unexpectedly to start a new web server process.'));
return 1;
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ServerStopCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ServerStopCommand.php
index 9b0656c220b66..c40952059a294 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Command/ServerStopCommand.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Command/ServerStopCommand.php
@@ -14,6 +14,7 @@
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Input\InputOption;
/**
* Stops a background process running PHP's built-in web server.
@@ -29,7 +30,8 @@ protected function configure()
{
$this
->setDefinition(array(
- new InputArgument('address', InputArgument::OPTIONAL, 'Address:port', '127.0.0.1:8000'),
+ new InputArgument('address', InputArgument::OPTIONAL, 'Address:port', '127.0.0.1'),
+ new InputOption('port', 'p', InputOption::VALUE_REQUIRED, 'Address port number', '8000'),
))
->setName('server:stop')
->setDescription('Stops PHP\'s built-in web server that was started with the server:start command')
@@ -53,6 +55,10 @@ protected function configure()
protected function execute(InputInterface $input, OutputInterface $output)
{
$address = $input->getArgument('address');
+ if (false === strpos($address, ':')) {
+ $address = $address.':'.$input->getOption('port');
+ }
+
$lockFile = $this->getLockFile($address);
if (!file_exists($lockFile)) {
diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php
index 30d44493d4c4b..c6be5ba47554f 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php
@@ -11,12 +11,15 @@
namespace Symfony\Bundle\FrameworkBundle\Command;
+use Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader;
+use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Style\SymfonyStyle;
-use Symfony\Component\Translation\Catalogue\MergeOperation;
use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\HttpKernel\Kernel;
+use Symfony\Component\Translation\Catalogue\MergeOperation;
use Symfony\Component\Translation\MessageCatalogue;
use Symfony\Component\Translation\Translator;
@@ -48,6 +51,7 @@ protected function configure()
new InputOption('domain', null, InputOption::VALUE_OPTIONAL, 'The messages domain'),
new InputOption('only-missing', null, InputOption::VALUE_NONE, 'Displays only missing messages'),
new InputOption('only-unused', null, InputOption::VALUE_NONE, 'Displays only unused messages'),
+ new InputOption('all', null, InputOption::VALUE_NONE, 'Load messages from all registered bundles'),
))
->setDescription('Displays translation messages information')
->setHelp(<<php %command.full_name% en
+You can display information about translations in all registered bundles in a specific locale:
+
+ php %command.full_name% --all en
+
EOF
)
;
@@ -92,7 +100,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
$locale = $input->getArgument('locale');
$domain = $input->getOption('domain');
+ /** @var TranslationLoader $loader */
$loader = $this->getContainer()->get('translation.loader');
+ /** @var Kernel $kernel */
$kernel = $this->getContainer()->get('kernel');
// Define Root Path to App folder
@@ -109,30 +119,23 @@ protected function execute(InputInterface $input, OutputInterface $output)
} catch (\InvalidArgumentException $e) {
// such a bundle does not exist, so treat the argument as path
$transPaths = array($input->getArgument('bundle').'/Resources/');
+
if (!is_dir($transPaths[0])) {
throw new \InvalidArgumentException(sprintf('"%s" is neither an enabled bundle nor a directory.', $transPaths[0]));
}
}
+ } elseif ($input->getOption('all')) {
+ foreach ($kernel->getBundles() as $bundle) {
+ $transPaths[] = $bundle->getPath().'/Resources/';
+ $transPaths[] = sprintf('%s/Resources/%s/', $kernel->getRootDir(), $bundle->getName());
+ }
}
// Extract used messages
- $extractedCatalogue = new MessageCatalogue($locale);
- foreach ($transPaths as $path) {
- $path .= 'views';
-
- if (is_dir($path)) {
- $this->getContainer()->get('translation.extractor')->extract($path, $extractedCatalogue);
- }
- }
+ $extractedCatalogue = $this->extractMessages($locale, $transPaths);
// Load defined messages
- $currentCatalogue = new MessageCatalogue($locale);
- foreach ($transPaths as $path) {
- $path .= 'translations';
- if (is_dir($path)) {
- $loader->loadMessages($path, $currentCatalogue);
- }
- }
+ $currentCatalogue = $this->loadCurrentMessages($locale, $transPaths, $loader);
// Merge defined and extracted messages to get all message ids
$mergeOperation = new MergeOperation($extractedCatalogue, $currentCatalogue);
@@ -155,24 +158,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
// Load the fallback catalogues
- $fallbackCatalogues = array();
- $translator = $this->getContainer()->get('translator');
- if ($translator instanceof Translator) {
- foreach ($translator->getFallbackLocales() as $fallbackLocale) {
- if ($fallbackLocale === $locale) {
- continue;
- }
-
- $fallbackCatalogue = new MessageCatalogue($fallbackLocale);
- foreach ($transPaths as $path) {
- $path = $path.'translations';
- if (is_dir($path)) {
- $loader->loadMessages($path, $fallbackCatalogue);
- }
- }
- $fallbackCatalogues[] = $fallbackCatalogue;
- }
- }
+ $fallbackCatalogues = $this->loadFallbackCatalogues($locale, $transPaths, $loader);
// Display header line
$headers = array('State', 'Domain', 'Id', sprintf('Message Preview (%s)', $locale));
@@ -265,4 +251,74 @@ private function sanitizeString($string, $length = 40)
return $string;
}
+
+ /**
+ * @param string $locale
+ * @param array $transPaths
+ *
+ * @return MessageCatalogue
+ */
+ private function extractMessages($locale, $transPaths)
+ {
+ $extractedCatalogue = new MessageCatalogue($locale);
+ foreach ($transPaths as $path) {
+ $path = $path.'views';
+ if (is_dir($path)) {
+ $this->getContainer()->get('translation.extractor')->extract($path, $extractedCatalogue);
+ }
+ }
+
+ return $extractedCatalogue;
+ }
+
+ /**
+ * @param string $locale
+ * @param array $transPaths
+ * @param TranslationLoader $loader
+ *
+ * @return MessageCatalogue
+ */
+ private function loadCurrentMessages($locale, $transPaths, TranslationLoader $loader)
+ {
+ $currentCatalogue = new MessageCatalogue($locale);
+ foreach ($transPaths as $path) {
+ $path = $path.'translations';
+ if (is_dir($path)) {
+ $loader->loadMessages($path, $currentCatalogue);
+ }
+ }
+
+ return $currentCatalogue;
+ }
+
+ /**
+ * @param string $locale
+ * @param array $transPaths
+ * @param TranslationLoader $loader
+ *
+ * @return MessageCatalogue[]
+ */
+ private function loadFallbackCatalogues($locale, $transPaths, TranslationLoader $loader)
+ {
+ $fallbackCatalogues = array();
+ $translator = $this->getContainer()->get('translator');
+ if ($translator instanceof Translator) {
+ foreach ($translator->getFallbackLocales() as $fallbackLocale) {
+ if ($fallbackLocale === $locale) {
+ continue;
+ }
+
+ $fallbackCatalogue = new MessageCatalogue($fallbackLocale);
+ foreach ($transPaths as $path) {
+ $path = $path.'translations';
+ if (is_dir($path)) {
+ $loader->loadMessages($path, $fallbackCatalogue);
+ }
+ }
+ $fallbackCatalogues[] = $fallbackCatalogue;
+ }
+ }
+
+ return $fallbackCatalogues;
+ }
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php
index f61af1cc959ce..57780d2e52fd3 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php
@@ -213,12 +213,16 @@ private function getContainerDefinitionData(Definition $definition, $omitTags =
{
$data = array(
'class' => (string) $definition->getClass(),
- 'scope' => $definition->getScope(),
+ 'scope' => $definition->getScope(false),
'public' => $definition->isPublic(),
'synthetic' => $definition->isSynthetic(),
'lazy' => $definition->isLazy(),
);
+ if (method_exists($definition, 'isShared')) {
+ $data['shared'] = $definition->isShared();
+ }
+
if (method_exists($definition, 'isSynchronized')) {
$data['synchronized'] = $definition->isSynchronized(false);
}
@@ -290,17 +294,27 @@ private function getEventDispatcherListenersData(EventDispatcherInterface $event
{
$data = array();
- $registeredListeners = $eventDispatcher->getListeners($event);
+ $registeredListeners = $eventDispatcher->getListeners($event, true);
if (null !== $event) {
- foreach ($registeredListeners as $listener) {
- $data[] = $this->getCallableData($listener);
+ krsort($registeredListeners);
+ foreach ($registeredListeners as $priority => $listeners) {
+ foreach ($listeners as $listener) {
+ $listener = $this->getCallableData($listener);
+ $listener['priority'] = $priority;
+ $data[] = $listener;
+ }
}
} else {
ksort($registeredListeners);
foreach ($registeredListeners as $eventListened => $eventListeners) {
- foreach ($eventListeners as $eventListener) {
- $data[$eventListened][] = $this->getCallableData($eventListener);
+ krsort($eventListeners);
+ foreach ($eventListeners as $priority => $listeners) {
+ foreach ($listeners as $listener) {
+ $listener = $this->getCallableData($listener);
+ $listener['priority'] = $priority;
+ $data[$eventListened][] = $listener;
+ }
}
}
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php
index 84877461c832a..8f5437146bb57 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php
@@ -113,7 +113,7 @@ protected function describeContainerService($service, array $options = array())
} elseif ($service instanceof Definition) {
$this->describeContainerDefinition($service, $childOptions);
} else {
- $this->write(sprintf("**`%s`:** `%s`", $options['id'], get_class($service)));
+ $this->write(sprintf('**`%s`:** `%s`', $options['id'], get_class($service)));
}
}
@@ -179,12 +179,16 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
protected function describeContainerDefinition(Definition $definition, array $options = array())
{
$output = '- Class: `'.$definition->getClass().'`'
- ."\n".'- Scope: `'.$definition->getScope().'`'
+ ."\n".'- Scope: `'.$definition->getScope(false).'`'
."\n".'- Public: '.($definition->isPublic() ? 'yes' : 'no')
."\n".'- Synthetic: '.($definition->isSynthetic() ? 'yes' : 'no')
."\n".'- Lazy: '.($definition->isLazy() ? 'yes' : 'no')
;
+ if (method_exists($definition, 'isShared')) {
+ $output .= "\n".'- Shared: '.($definition->isShared() ? 'yes' : 'no');
+ }
+
if (method_exists($definition, 'isSynchronized')) {
$output .= "\n".'- Synchronized: '.($definition->isSynchronized(false) ? 'yes' : 'no');
}
@@ -269,21 +273,30 @@ protected function describeEventDispatcherListeners(EventDispatcherInterface $ev
$this->write(sprintf('# %s', $title)."\n");
- $registeredListeners = $eventDispatcher->getListeners($event);
+ $registeredListeners = $eventDispatcher->getListeners($event, true);
if (null !== $event) {
- foreach ($registeredListeners as $order => $listener) {
- $this->write("\n".sprintf('## Listener %d', $order + 1)."\n");
- $this->describeCallable($listener);
+ krsort($registeredListeners);
+ $order = 1;
+ foreach ($registeredListeners as $priority => $listeners) {
+ foreach ($listeners as $listener) {
+ $this->write("\n".sprintf('## Listener %d', $order++)."\n");
+ $this->describeCallable($listener);
+ $this->write(sprintf('- Priority: `%d`', $priority)."\n");
+ }
}
} else {
ksort($registeredListeners);
foreach ($registeredListeners as $eventListened => $eventListeners) {
$this->write("\n".sprintf('## %s', $eventListened)."\n");
-
- foreach ($eventListeners as $order => $eventListener) {
- $this->write("\n".sprintf('### Listener %d', $order + 1)."\n");
- $this->describeCallable($eventListener);
+ krsort($eventListeners);
+ $order = 1;
+ foreach ($eventListeners as $priority => $listeners) {
+ foreach ($listeners as $listener) {
+ $this->write("\n".sprintf('### Listener %d', $order++)."\n");
+ $this->describeCallable($listener);
+ $this->write(sprintf('- Priority: `%d`', $priority)."\n");
+ }
}
}
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
index 22d0bde4d42e7..422e50ead2b83 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
@@ -261,10 +261,13 @@ protected function describeContainerDefinition(Definition $definition, array $op
$description[] = 'Tags -';
}
- $description[] = sprintf('Scope %s', $definition->getScope());
+ $description[] = sprintf('Scope %s', $definition->getScope(false));
$description[] = sprintf('Public %s', $definition->isPublic() ? 'yes' : 'no');
$description[] = sprintf('Synthetic %s', $definition->isSynthetic() ? 'yes' : 'no');
$description[] = sprintf('Lazy %s', $definition->isLazy() ? 'yes' : 'no');
+ if (method_exists($definition, 'isShared')) {
+ $description[] = sprintf('Shared %s', $definition->isShared() ? 'yes' : 'no');
+ }
if (method_exists($definition, 'isSynchronized')) {
$description[] = sprintf('Synchronized %s', $definition->isSynchronized(false) ? 'yes' : 'no');
}
@@ -336,33 +339,16 @@ protected function describeEventDispatcherListeners(EventDispatcherInterface $ev
$this->writeText($this->formatSection('event_dispatcher', $label)."\n", $options);
- $registeredListeners = $eventDispatcher->getListeners($event);
+ $registeredListeners = $eventDispatcher->getListeners($event, true);
if (null !== $event) {
$this->writeText("\n");
- $table = new Table($this->getOutput());
- $table->getStyle()->setCellHeaderFormat('%s');
- $table->setHeaders(array('Order', 'Callable'));
-
- foreach ($registeredListeners as $order => $listener) {
- $table->addRow(array(sprintf('#%d', $order + 1), $this->formatCallable($listener)));
- }
-
- $table->render();
+ $this->renderEventListenerTable($registeredListeners);
} else {
ksort($registeredListeners);
foreach ($registeredListeners as $eventListened => $eventListeners) {
$this->writeText(sprintf("\n[Event] %s\n", $eventListened), $options);
-
- $table = new Table($this->getOutput());
- $table->getStyle()->setCellHeaderFormat('%s');
- $table->setHeaders(array('Order', 'Callable'));
-
- foreach ($eventListeners as $order => $eventListener) {
- $table->addRow(array(sprintf('#%d', $order + 1), $this->formatCallable($eventListener)));
- }
-
- $table->render();
+ $this->renderEventListenerTable($eventListeners);
}
}
}
@@ -375,6 +361,26 @@ protected function describeCallable($callable, array $options = array())
$this->writeText($this->formatCallable($callable), $options);
}
+ /**
+ * @param array $array
+ */
+ private function renderEventListenerTable(array $eventListeners)
+ {
+ $table = new Table($this->getOutput());
+ $table->getStyle()->setCellHeaderFormat('%s');
+ $table->setHeaders(array('Order', 'Callable', 'Priority'));
+
+ krsort($eventListeners);
+ $order = 1;
+ foreach ($eventListeners as $priority => $listeners) {
+ foreach ($listeners as $listener) {
+ $table->addRow(array(sprintf('#%d', $order++), $this->formatCallable($listener), $priority));
+ }
+ }
+
+ $table->render();
+ }
+
/**
* @param array $array
*
diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php
index c37a9009fcff5..c9e6f7eb731a3 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php
@@ -362,10 +362,13 @@ private function getContainerDefinitionDocument(Definition $definition, $id = nu
}
}
- $serviceXML->setAttribute('scope', $definition->getScope());
+ $serviceXML->setAttribute('scope', $definition->getScope(false));
$serviceXML->setAttribute('public', $definition->isPublic() ? 'true' : 'false');
$serviceXML->setAttribute('synthetic', $definition->isSynthetic() ? 'true' : 'false');
$serviceXML->setAttribute('lazy', $definition->isLazy() ? 'true' : 'false');
+ if (method_exists($definition, 'isShared')) {
+ $serviceXML->setAttribute('shared', $definition->isShared() ? 'true' : 'false');
+ }
if (method_exists($definition, 'isSynchronized')) {
$serviceXML->setAttribute('synchronized', $definition->isSynchronized(false) ? 'true' : 'false');
}
@@ -446,13 +449,9 @@ private function getEventDispatcherListenersDocument(EventDispatcherInterface $e
$dom = new \DOMDocument('1.0', 'UTF-8');
$dom->appendChild($eventDispatcherXML = $dom->createElement('event-dispatcher'));
- $registeredListeners = $eventDispatcher->getListeners($event);
+ $registeredListeners = $eventDispatcher->getListeners($event, true);
if (null !== $event) {
- foreach ($registeredListeners as $listener) {
- $callableXML = $this->getCallableDocument($listener);
-
- $eventDispatcherXML->appendChild($eventDispatcherXML->ownerDocument->importNode($callableXML->childNodes->item(0), true));
- }
+ $this->appendEventListenerDocument($eventDispatcherXML, $registeredListeners);
} else {
ksort($registeredListeners);
@@ -460,17 +459,30 @@ private function getEventDispatcherListenersDocument(EventDispatcherInterface $e
$eventDispatcherXML->appendChild($eventXML = $dom->createElement('event'));
$eventXML->setAttribute('name', $eventListened);
- foreach ($eventListeners as $eventListener) {
- $callableXML = $this->getCallableDocument($eventListener);
-
- $eventXML->appendChild($eventXML->ownerDocument->importNode($callableXML->childNodes->item(0), true));
- }
+ $this->appendEventListenerDocument($eventXML, $eventListeners);
}
}
return $dom;
}
+ /**
+ * @param DOMElement $element
+ * @param array $eventListeners
+ */
+ private function appendEventListenerDocument(\DOMElement $element, array $eventListeners)
+ {
+ krsort($eventListeners);
+ foreach ($eventListeners as $priority => $listeners) {
+ foreach ($listeners as $listener) {
+ $callableXML = $this->getCallableDocument($listener);
+ $callableXML->childNodes->item(0)->setAttribute('priority', $priority);
+
+ $element->appendChild($element->ownerDocument->importNode($callableXML->childNodes->item(0), true));
+ }
+ }
+ }
+
/**
* @param callable $callable
*
diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
index 655e95cf93061..977c0669c409c 100644
--- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
+++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
@@ -575,6 +575,7 @@ private function addTranslatorSection(ArrayNodeDefinition $rootNode)
->info('translator configuration')
->canBeEnabled()
->fixXmlConfig('fallback')
+ ->fixXmlConfig('path')
->children()
->arrayNode('fallbacks')
->beforeNormalization()->ifString()->then(function ($v) { return array($v); })->end()
@@ -582,6 +583,9 @@ private function addTranslatorSection(ArrayNodeDefinition $rootNode)
->defaultValue(array('en'))
->end()
->booleanNode('logging')->defaultValue($this->debug)->end()
+ ->arrayNode('paths')
+ ->prototype('scalar')->end()
+ ->end()
->end()
->end()
->end()
diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
index 2183004d85315..08c7f1c54be7c 100644
--- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
@@ -692,6 +692,13 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
$dirs[] = $dir;
}
}
+ foreach ($config['paths'] as $dir) {
+ if (is_dir($dir)) {
+ $dirs[] = $dir;
+ } else {
+ throw new \UnexpectedValueException(sprintf('%s defined in translator.paths does not exist or is not a directory', $dir));
+ }
+ }
if (is_dir($dir = $container->getParameter('kernel.root_dir').'/Resources/translations')) {
$dirs[] = $dir;
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/form.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/form.xml
index 7d1a588fbad34..10e8f807899fb 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/form.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/form.xml
@@ -115,6 +115,9 @@
+
+
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml
index 6b2f7c9688699..78a98177287db 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml
@@ -45,6 +45,11 @@
+
+
+
+
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd
index fa7aa2b2bd808..e1ca041e6114f 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd
+++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd
@@ -183,6 +183,7 @@
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/test.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/test.xml
index 4e609a06e5d95..428ba0c8ee48a 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/test.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/test.xml
@@ -13,16 +13,16 @@
-
+ %test.client.parameters%
-
+
-
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml
index ccfd44e5ca483..c0bf73a94e981 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml
@@ -39,6 +39,16 @@
%validator.mapping.cache.prefix%
+
+
+
+
+ %validator.mapping.cache.prefix%
+
+
+
+
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/range_widget.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/range_widget.html.php
new file mode 100644
index 0000000000000..4c628f8e005bc
--- /dev/null
+++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/range_widget.html.php
@@ -0,0 +1 @@
+block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'range'));
diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_attributes.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_attributes.html.php
index 14e65a7991c53..ac5a481d0b55e 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_attributes.html.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_attributes.html.php
@@ -1,12 +1,11 @@
-id="escape($id) ?>" name="escape($full_name) ?>" readonly="readonly"
-disabled="disabled"
-required="required"
+id="escape($id) ?>" name="escape($full_name) ?>" disabled="disabled"
+ required="required"
$v): ?>
-escape($k), $view->escape($view['translator']->trans($v, array(), $translation_domain))) ?>
+escape($k), $view->escape($view['translator']->trans($v, array(), $translation_domain))) ?>
-escape($k), $view->escape($k)) ?>
+escape($k), $view->escape($k)) ?>
-escape($k), $view->escape($v)) ?>
+escape($k), $view->escape($v)) ?>
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php
index 8a9800bc865bd..38dda10ba7d7c 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php
@@ -75,6 +75,9 @@ public function testLegacyDescribeSynchronizedServiceDefinition(Definition $defi
$this->assertDescription($expectedDescription, $definition);
}
+ /**
+ * @group legacy
+ */
public function provideLegacySynchronizedServiceDefinitionTestData()
{
return $this->getDescriptionTestData(ObjectsProvider::getLegacyContainerDefinitions());
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php
index 94db08b5bdc91..810038909d90c 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php
@@ -114,6 +114,7 @@ public static function getContainerDefinitions()
/**
* @deprecated since version 2.7, to be removed in 3.0
+ *
* @internal
*/
public static function getLegacyContainerDefinitions()
@@ -157,8 +158,8 @@ public static function getEventDispatchers()
{
$eventDispatcher = new EventDispatcher();
- $eventDispatcher->addListener('event1', 'global_function');
- $eventDispatcher->addListener('event1', function () { return 'Closure'; });
+ $eventDispatcher->addListener('event1', 'global_function', 255);
+ $eventDispatcher->addListener('event1', function () { return 'Closure'; }, -1);
$eventDispatcher->addListener('event2', new CallableClass());
return array('event_dispatcher_1' => $eventDispatcher);
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php
index 47482433a9742..621ea4bdeec6c 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php
@@ -144,6 +144,7 @@ protected static function getBundleDefaultConfig()
'enabled' => false,
'fallbacks' => array('en'),
'logging' => true,
+ 'paths' => array(),
),
'validation' => array(
'enabled' => false,
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php
index 5022aeaf9f207..a035b56d70029 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php
@@ -50,6 +50,7 @@
'translator' => array(
'enabled' => true,
'fallback' => 'fr',
+ 'paths' => array('%kernel.root_dir%/Fixtures/translations'),
),
'validation' => array(
'enabled' => true,
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/translations/test_paths.en.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/translations/test_paths.en.yml
new file mode 100644
index 0000000000000..d4e682c47c9ca
--- /dev/null
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/translations/test_paths.en.yml
@@ -0,0 +1,2 @@
+custom:
+ paths: test
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml
index 5b16a59796091..bf4537b910e8b 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml
@@ -34,7 +34,9 @@
theme2
-
+
+ %kernel.root_dir%/Fixtures/translations
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml
index be1b41e25f894..47513b1f665b5 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml
@@ -39,6 +39,7 @@ framework:
translator:
enabled: true
fallback: fr
+ paths: ['%kernel.root_dir%/Fixtures/translations']
validation:
enabled: true
cache: apc
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
index 213f0927077c7..edace5bf7a9ad 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
@@ -242,6 +242,11 @@ public function testTranslator()
$files,
'->registerTranslatorConfiguration() finds Security translation resources'
);
+ $this->assertContains(
+ strtr(__DIR__.'/Fixtures/translations/test_paths.en.yml', '/', DIRECTORY_SEPARATOR),
+ $files,
+ '->registerTranslatorConfiguration() finds translation resources in custom paths'
+ );
$calls = $container->getDefinition('translator.default')->getMethodCalls();
$this->assertEquals(array('fr'), $calls[0][1][0]);
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.json
index 047f4e8c16a48..9be35dad0705e 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.json
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.json
@@ -6,6 +6,7 @@
"public": true,
"synthetic": false,
"lazy": true,
+ "shared": true,
"synchronized": false,
"abstract": true,
"file": null,
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.md
index 1c3b958bd92ca..de404d24d0f59 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.md
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.md
@@ -12,6 +12,7 @@ definition_1
- Public: yes
- Synthetic: no
- Lazy: yes
+- Shared: yes
- Synchronized: no
- Abstract: yes
- Factory Class: `Full\Qualified\FactoryClass`
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.xml
index b21190dc7983e..59a1e85c6bb8a 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.xml
@@ -2,7 +2,7 @@
-
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.json
index 3397fd67acd6e..c76d13ee4234d 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.json
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.json
@@ -6,6 +6,7 @@
"public": true,
"synthetic": false,
"lazy": true,
+ "shared": true,
"synchronized": false,
"abstract": true,
"file": null,
@@ -21,6 +22,7 @@
"public": false,
"synthetic": true,
"lazy": false,
+ "shared": true,
"synchronized": false,
"abstract": false,
"file": "\/path\/to\/file",
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.md
index b3018b80b7f3b..3a3de41c409e5 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.md
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.md
@@ -12,6 +12,7 @@ definition_1
- Public: yes
- Synthetic: no
- Lazy: yes
+- Shared: yes
- Synchronized: no
- Abstract: yes
- Factory Class: `Full\Qualified\FactoryClass`
@@ -25,6 +26,7 @@ definition_2
- Public: no
- Synthetic: yes
- Lazy: no
+- Shared: yes
- Synchronized: no
- Abstract: no
- File: `/path/to/file`
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.xml
index 7aecc4f629e7f..5ceee2772a993 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.xml
@@ -2,10 +2,10 @@
-
+
-
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.json
index 53bf114e81e04..40a3da00963af 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.json
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.json
@@ -6,6 +6,7 @@
"public": false,
"synthetic": true,
"lazy": false,
+ "shared": true,
"synchronized": false,
"abstract": false,
"file": "\/path\/to\/file",
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.md
index 56a2c390779aa..c0d4f11e33261 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.md
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.md
@@ -12,6 +12,7 @@ definition_2
- Public: no
- Synthetic: yes
- Lazy: no
+- Shared: yes
- Synchronized: no
- Abstract: no
- File: `/path/to/file`
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.xml
index d6ac0b750b169..51bb9c254f545 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.xml
@@ -1,6 +1,6 @@
-
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.json
index 3837b95cb89e9..6844d2d18076b 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.json
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.json
@@ -6,6 +6,7 @@
"public": false,
"synthetic": true,
"lazy": false,
+ "shared": true,
"synchronized": false,
"abstract": false,
"file": "\/path\/to\/file",
@@ -20,6 +21,7 @@
"public": false,
"synthetic": true,
"lazy": false,
+ "shared": true,
"synchronized": false,
"abstract": false,
"file": "\/path\/to\/file",
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.md
index 6577037f9c00f..551c9cb24b298 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.md
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.md
@@ -12,6 +12,7 @@ definition_2
- Public: no
- Synthetic: yes
- Lazy: no
+- Shared: yes
- Synchronized: no
- Abstract: no
- File: `/path/to/file`
@@ -30,6 +31,7 @@ definition_2
- Public: no
- Synthetic: yes
- Lazy: no
+- Shared: yes
- Synchronized: no
- Abstract: no
- File: `/path/to/file`
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.xml
index be9d2f015bd2c..01f324860885f 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.xml
@@ -1,12 +1,12 @@
-
+
-
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.json
index 8de781dfc45a5..92f1300b4bd51 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.json
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.json
@@ -4,6 +4,7 @@
"public": true,
"synthetic": false,
"lazy": true,
+ "shared": true,
"synchronized": false,
"abstract": true,
"file": null,
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.md
index 68d3569732c61..6c18a6c2bbf82 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.md
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.md
@@ -3,6 +3,7 @@
- Public: yes
- Synthetic: no
- Lazy: yes
+- Shared: yes
- Synchronized: no
- Abstract: yes
- Factory Class: `Full\Qualified\FactoryClass`
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.txt
index af495497dd35d..4c37faccf29ad 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.txt
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.txt
@@ -5,6 +5,7 @@
Public yes
Synthetic no
Lazy yes
+Shared yes
Synchronized no
Abstract yes
Factory Class Full\Qualified\FactoryClass
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.xml
index 92a9bbd70bd30..ec8a8cefa9e47 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.xml
@@ -1,4 +1,4 @@
-
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.json
index 9d58434c17e1b..22a094928a48a 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.json
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.json
@@ -4,6 +4,7 @@
"public": false,
"synthetic": true,
"lazy": false,
+ "shared": true,
"synchronized": false,
"abstract": false,
"file": "\/path\/to\/file",
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.md
index 6b2f14651d300..8668587994270 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.md
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.md
@@ -3,6 +3,7 @@
- Public: no
- Synthetic: yes
- Lazy: no
+- Shared: yes
- Synchronized: no
- Abstract: no
- File: `/path/to/file`
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.txt
index 28a00d583b090..62fc7d2dc6c33 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.txt
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.txt
@@ -8,6 +8,7 @@
Public no
Synthetic yes
Lazy no
+Shared yes
Synchronized no
Abstract no
Required File /path/to/file
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.xml
index f128e522e5990..ce9b1d05220c6 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_event1.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_event1.json
index e40e130d453cb..4b68f0cefc0e4 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_event1.json
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_event1.json
@@ -1,9 +1,11 @@
[
{
"type": "function",
- "name": "global_function"
+ "name": "global_function",
+ "priority": 255
},
{
- "type": "closure"
+ "type": "closure",
+ "priority": -1
}
]
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_event1.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_event1.md
index 206c44f717526..98b81ecdce422 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_event1.md
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_event1.md
@@ -4,7 +4,9 @@
- Type: `function`
- Name: `global_function`
+- Priority: `255`
## Listener 2
- Type: `closure`
+- Priority: `-1`
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_event1.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_event1.txt
index 22b17a19cfb91..45035d12d6228 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_event1.txt
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_event1.txt
@@ -1,8 +1,8 @@
[event_dispatcher] Registered listeners for event event1
-+-------+-------------------+
-| Order | Callable |
-+-------+-------------------+
-| #1 | global_function() |
-| #2 | \Closure() |
-+-------+-------------------+
++-------+-------------------+----------+
+| Order | Callable | Priority |
++-------+-------------------+----------+
+| #1 | global_function() | 255 |
+| #2 | \Closure() | -1 |
++-------+-------------------+----------+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_event1.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_event1.xml
index 4806f1f1280c7..bc03189af7b80 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_event1.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_event1.xml
@@ -1,5 +1,5 @@
-
-
+
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_events.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_events.json
index 56fc7a4f1e546..30772d9a4a212 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_events.json
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_events.json
@@ -2,16 +2,19 @@
"event1": [
{
"type": "function",
- "name": "global_function"
+ "name": "global_function",
+ "priority": 255
},
{
- "type": "closure"
+ "type": "closure",
+ "priority": -1
}
],
"event2": [
{
"type": "object",
- "name": "Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\CallableClass"
+ "name": "Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\CallableClass",
+ "priority": 0
}
]
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_events.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_events.md
index ad4b79e3117fa..eb809789d5f17 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_events.md
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_events.md
@@ -6,10 +6,12 @@
- Type: `function`
- Name: `global_function`
+- Priority: `255`
### Listener 2
- Type: `closure`
+- Priority: `-1`
## event2
@@ -17,3 +19,4 @@
- Type: `object`
- Name: `Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass`
+- Priority: `0`
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_events.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_events.txt
index 95a5b4648e939..88e5dc9c89692 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_events.txt
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_events.txt
@@ -1,16 +1,16 @@
[event_dispatcher] Registered listeners by event
[Event] event1
-+-------+-------------------+
-| Order | Callable |
-+-------+-------------------+
-| #1 | global_function() |
-| #2 | \Closure() |
-+-------+-------------------+
++-------+-------------------+----------+
+| Order | Callable | Priority |
++-------+-------------------+----------+
+| #1 | global_function() | 255 |
+| #2 | \Closure() | -1 |
++-------+-------------------+----------+
[Event] event2
-+-------+-----------------------------------------------------------------------------------+
-| Order | Callable |
-+-------+-----------------------------------------------------------------------------------+
-| #1 | Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::__invoke() |
-+-------+-----------------------------------------------------------------------------------+
++-------+-----------------------------------------------------------------------------------+----------+
+| Order | Callable | Priority |
++-------+-----------------------------------------------------------------------------------+----------+
+| #1 | Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::__invoke() | 0 |
++-------+-----------------------------------------------------------------------------------+----------+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_events.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_events.xml
index 3e4b20d823798..d7443f9743666 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_events.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_events.xml
@@ -1,10 +1,10 @@
-
-
+
+
-
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_1.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_1.json
index 6372d9e5b56df..b7a5dec87df72 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_1.json
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_1.json
@@ -4,6 +4,7 @@
"public": true,
"synthetic": false,
"lazy": true,
+ "shared": true,
"synchronized": true,
"abstract": true,
"file": null,
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_1.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_1.md
index d9832a1511ab2..f527ab9ff8749 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_1.md
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_1.md
@@ -3,6 +3,7 @@
- Public: yes
- Synthetic: no
- Lazy: yes
+- Shared: yes
- Synchronized: yes
- Abstract: yes
- Factory Class: `Full\Qualified\FactoryClass`
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_1.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_1.txt
index 3d9cbb2077c3b..09340efcf5d82 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_1.txt
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_1.txt
@@ -5,6 +5,7 @@
Public yes
Synthetic no
Lazy yes
+Shared yes
Synchronized yes
Abstract yes
Factory Class Full\Qualified\FactoryClass
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_1.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_1.xml
index 75d0820244579..6088d9a21b5a8 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_1.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_1.xml
@@ -1,2 +1,2 @@
-
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_2.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_2.json
index 278a5bfed413b..bb0f5685f36a6 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_2.json
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_2.json
@@ -4,6 +4,7 @@
"public": false,
"synthetic": true,
"lazy": false,
+ "shared": true,
"synchronized": false,
"abstract": false,
"file": "\/path\/to\/file",
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_2.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_2.md
index f552debbf18bc..43227638d88a4 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_2.md
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_2.md
@@ -3,6 +3,7 @@
- Public: no
- Synthetic: yes
- Lazy: no
+- Shared: yes
- Synchronized: no
- Abstract: no
- File: `/path/to/file`
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_2.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_2.txt
index 28a00d583b090..62fc7d2dc6c33 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_2.txt
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_2.txt
@@ -8,6 +8,7 @@
Public no
Synthetic yes
Lazy no
+Shared yes
Synchronized no
Abstract no
Required File /path/to/file
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_2.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_2.xml
index dd3e2e06d7174..7a2154487d1eb 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_2.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_2.xml
@@ -1,5 +1,5 @@
-
+val1
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php
index 4af5b929cbb50..76c0ce46a2f7a 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php
@@ -29,6 +29,7 @@ class FormHelperDivLayoutTest extends AbstractDivLayoutTest
protected $testableFeatures = array(
'choice_attr',
+ 'choice_label_attr',
);
protected function getExtensions()
@@ -128,14 +129,4 @@ public static function themeInheritanceProvider()
array(array('TestBundle:Parent'), array('TestBundle:Child')),
);
}
-
- public function testRange()
- {
- // No-op for forward compatibility with AbstractLayoutTest 2.8
- }
-
- public function testRangeWithMinMaxValues()
- {
- // No-op for forward compatibility with AbstractLayoutTest 2.8
- }
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php
index 1bf641fe1b93f..d87b128676cf1 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php
@@ -29,6 +29,7 @@ class FormHelperTableLayoutTest extends AbstractTableLayoutTest
protected $testableFeatures = array(
'choice_attr',
+ 'choice_label_attr',
);
protected function getExtensions()
@@ -115,14 +116,4 @@ protected function setTheme(FormView $view, array $themes)
{
$this->engine->get('form')->setTheme($view, $themes);
}
-
- public function testRange()
- {
- // No-op for forward compatibility with AbstractLayoutTest 2.8
- }
-
- public function testRangeWithMinMaxValues()
- {
- // No-op for forward compatibility with AbstractLayoutTest 2.8
- }
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json
index 4b658ddc1b568..843a4cce7be4a 100644
--- a/src/Symfony/Bundle/FrameworkBundle/composer.json
+++ b/src/Symfony/Bundle/FrameworkBundle/composer.json
@@ -17,36 +17,36 @@
],
"require": {
"php": ">=5.3.9",
- "symfony/asset": "~2.7",
- "symfony/dependency-injection": "~2.6,>=2.6.2",
+ "symfony/asset": "~2.7|~3.0.0",
+ "symfony/dependency-injection": "~2.8",
"symfony/config": "~2.4",
- "symfony/event-dispatcher": "~2.5",
- "symfony/http-foundation": "~2.4.9|~2.5,>=2.5.4",
+ "symfony/event-dispatcher": "~2.8|~3.0.0",
+ "symfony/http-foundation": "~2.4.9|~2.5,>=2.5.4|~3.0.0",
"symfony/http-kernel": "~2.7",
- "symfony/filesystem": "~2.3",
- "symfony/routing": "~2.6,>2.6.4",
- "symfony/security-core": "~2.6",
- "symfony/security-csrf": "~2.6",
- "symfony/stopwatch": "~2.3",
- "symfony/templating": "~2.1",
+ "symfony/filesystem": "~2.3|~3.0.0",
+ "symfony/routing": "~2.8|~3.0.0",
+ "symfony/security-core": "~2.6|~3.0.0",
+ "symfony/security-csrf": "~2.6|~3.0.0",
+ "symfony/stopwatch": "~2.3|~3.0.0",
+ "symfony/templating": "~2.1|~3.0.0",
"symfony/translation": "~2.7",
"doctrine/annotations": "~1.0"
},
"require-dev": {
- "symfony/phpunit-bridge": "~2.7",
- "symfony/browser-kit": "~2.4",
- "symfony/console": "~2.7",
- "symfony/css-selector": "~2.0,>=2.0.5",
- "symfony/dom-crawler": "~2.0,>=2.0.5",
- "symfony/finder": "~2.0,>=2.0.5",
- "symfony/intl": "~2.3",
- "symfony/security": "~2.6",
- "symfony/form": "~2.7,>=2.7.2",
- "symfony/class-loader": "~2.1",
- "symfony/expression-language": "~2.6",
- "symfony/process": "~2.0,>=2.0.5",
- "symfony/validator": "~2.5",
- "symfony/yaml": "~2.0,>=2.0.5"
+ "symfony/phpunit-bridge": "~2.7|~3.0.0",
+ "symfony/browser-kit": "~2.4|~3.0.0",
+ "symfony/console": "~2.7|~3.0.0",
+ "symfony/css-selector": "~2.0,>=2.0.5|~3.0.0",
+ "symfony/dom-crawler": "~2.0,>=2.0.5|~3.0.0",
+ "symfony/finder": "~2.0,>=2.0.5|~3.0.0",
+ "symfony/intl": "~2.3|~3.0.0",
+ "symfony/security": "~2.6|~3.0.0",
+ "symfony/form": "~2.8",
+ "symfony/class-loader": "~2.1|~3.0.0",
+ "symfony/expression-language": "~2.6|~3.0.0",
+ "symfony/process": "~2.0,>=2.0.5|~3.0.0",
+ "symfony/validator": "~2.5|~3.0.0",
+ "symfony/yaml": "~2.0,>=2.0.5|~3.0.0"
},
"suggest": {
"symfony/console": "For using the console commands",
@@ -62,7 +62,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "2.7-dev"
+ "dev-master": "2.8-dev"
}
}
}
diff --git a/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md b/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md
index f1adc832efe23..f893aa92236ab 100644
--- a/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md
+++ b/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md
@@ -1,12 +1,18 @@
CHANGELOG
=========
+2.8.0
+-----
+
+ * deprecated the `key` setting of `anonymous` and `remember_me` in favor of the
+ `secret` setting.
+
2.6.0
-----
* Added the possibility to override the default success/failure handler
to get the provider key and the options injected
- * Deprecated the `security.context` service for the `security.token_storage` and
+ * Deprecated the `security.context` service for the `security.token_storage` and
`security.authorization_checker` services.
2.4.0
diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSecurityVotersPass.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSecurityVotersPass.php
index 497807174d24a..099b1b48b7261 100644
--- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSecurityVotersPass.php
+++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSecurityVotersPass.php
@@ -14,6 +14,7 @@
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
+use Symfony\Component\DependencyInjection\Exception\LogicException;
/**
* Adds all configured security voters to the access decision manager.
@@ -40,6 +41,10 @@ public function process(ContainerBuilder $container)
$voters = iterator_to_array($voters);
ksort($voters);
- $container->getDefinition('security.access.decision_manager')->replaceArgument(0, array_values($voters));
+ if (!$voters) {
+ throw new LogicException('No security voters found. You need to tag at least one with "security.voter"');
+ }
+
+ $container->getDefinition('security.access.decision_manager')->addMethodCall('setVoters', array(array_values($voters)));
}
}
diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php
index 1dea48728ed60..7b6ac4186ac03 100644
--- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php
+++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php
@@ -286,8 +286,22 @@ private function addFirewallsSection(ArrayNodeDefinition $rootNode, array $facto
->end()
->arrayNode('anonymous')
->canBeUnset()
+ ->beforeNormalization()
+ ->ifTrue(function ($v) { return isset($v['key']); })
+ ->then(function ($v) {
+ if (isset($v['secret'])) {
+ throw new \LogicException('Cannot set both key and secret options for security.firewall.anonymous, use only secret instead.');
+ }
+
+ @trigger_error('security.firewall.anonymous.key is deprecated since version 2.8 and will be removed in 3.0. Use security.firewall.anonymous.secret instead.', E_USER_DEPRECATED);
+
+ $v['secret'] = $v['key'];
+
+ unset($v['key']);
+ })
+ ->end()
->children()
- ->scalarNode('key')->defaultValue(uniqid('', true))->end()
+ ->scalarNode('secret')->defaultValue(uniqid('', true))->end()
->end()
->end()
->arrayNode('switch_user')
diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php
index 7aa4f5baa03eb..d8321f52456a2 100644
--- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php
+++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php
@@ -35,7 +35,7 @@ public function create(ContainerBuilder $container, $id, $config, $userProvider,
$authProviderId = 'security.authentication.provider.rememberme.'.$id;
$container
->setDefinition($authProviderId, new DefinitionDecorator('security.authentication.provider.rememberme'))
- ->addArgument($config['key'])
+ ->addArgument($config['secret'])
->addArgument($id)
;
@@ -56,7 +56,7 @@ public function create(ContainerBuilder $container, $id, $config, $userProvider,
}
$rememberMeServices = $container->setDefinition($rememberMeServicesId, new DefinitionDecorator($templateId));
- $rememberMeServices->replaceArgument(1, $config['key']);
+ $rememberMeServices->replaceArgument(1, $config['secret']);
$rememberMeServices->replaceArgument(2, $id);
if (isset($config['token_provider'])) {
@@ -120,10 +120,25 @@ public function getKey()
public function addConfiguration(NodeDefinition $node)
{
$node->fixXmlConfig('user_provider');
- $builder = $node->children();
+ $builder = $node
+ ->beforeNormalization()
+ ->ifTrue(function ($v) { return isset($v['key']); })
+ ->then(function ($v) {
+ if (isset($v['secret'])) {
+ throw new \LogicException('Cannot set both key and secret options for remember_me, use only secret instead.');
+ }
+
+ @trigger_error('remember_me.key is deprecated since version 2.8 and will be removed in 3.0. Use remember_me.secret instead.', E_USER_DEPRECATED);
+
+ $v['secret'] = $v['key'];
+
+ unset($v['key']);
+ })
+ ->end()
+ ->children();
$builder
- ->scalarNode('key')->isRequired()->cannotBeEmpty()->end()
+ ->scalarNode('secret')->isRequired()->cannotBeEmpty()->end()
->scalarNode('token_provider')->end()
->arrayNode('user_providers')
->beforeNormalization()
diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
index ce5d3f3e118c9..4fce6ebca3472 100644
--- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
+++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
@@ -410,7 +410,7 @@ private function createAuthenticationListeners($container, $id, $firewall, &$aut
$listenerId = 'security.authentication.listener.anonymous.'.$id;
$container
->setDefinition($listenerId, new DefinitionDecorator('security.authentication.listener.anonymous'))
- ->replaceArgument(1, $firewall['anonymous']['key'])
+ ->replaceArgument(1, $firewall['anonymous']['secret'])
;
$listeners[] = new Reference($listenerId);
@@ -418,7 +418,7 @@ private function createAuthenticationListeners($container, $id, $firewall, &$aut
$providerId = 'security.authentication.provider.anonymous.'.$id;
$container
->setDefinition($providerId, new DefinitionDecorator('security.authentication.provider.anonymous'))
- ->replaceArgument(0, $firewall['anonymous']['key'])
+ ->replaceArgument(0, $firewall['anonymous']['secret'])
;
$authenticationProviders[] = $providerId;
diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig
index 923be83810648..a495829d3e517 100644
--- a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig
+++ b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig
@@ -32,8 +32,7 @@
{% endset %}
{% set icon %}
-
- {% if collector.user %}
{{ collector.user }}
{% endif %}
+ {{ collector.user }}
{% endset %}
{% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url } %}
{% endblock %}
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php
index b16a46ff03457..4521c8cdcd227 100644
--- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php
+++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php
@@ -71,7 +71,7 @@
'x509' => true,
'remote_user' => true,
'logout' => true,
- 'remember_me' => array('key' => 'TheKey'),
+ 'remember_me' => array('secret' => 'TheSecret'),
),
'host' => array(
'pattern' => '/test',
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/remember_me_options.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/remember_me_options.php
index 61a2bc938f0d2..e0ca4f6dedf3e 100644
--- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/remember_me_options.php
+++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/remember_me_options.php
@@ -1,4 +1,5 @@
loadFromExtension('security', array(
'providers' => array(
'default' => array('id' => 'foo'),
@@ -8,7 +9,7 @@
'main' => array(
'form_login' => true,
'remember_me' => array(
- 'key' => 'TheyKey',
+ 'secret' => 'TheSecret',
'catch_exceptions' => false,
'token_provider' => 'token_provider_id',
),
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/container1.xml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/container1.xml
index 1a56aa88fda07..e5f5905fa7e0b 100644
--- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/container1.xml
+++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/container1.xml
@@ -56,7 +56,7 @@
-
+
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/remember_me_options.xml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/remember_me_options.xml
index 1674756891575..b6ade91a07970 100644
--- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/remember_me_options.xml
+++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/remember_me_options.xml
@@ -11,7 +11,7 @@
-
+
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/container1.yml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/container1.yml
index 93c231ea235f1..6b27806e564be 100644
--- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/container1.yml
+++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/container1.yml
@@ -55,7 +55,7 @@ security:
remote_user: true
logout: true
remember_me:
- key: TheKey
+ secret: TheSecret
host:
pattern: /test
host: foo\.example\.org
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/remember_me_options.yml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/remember_me_options.yml
index 3a38b33c521c6..a521c8c6a803d 100644
--- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/remember_me_options.yml
+++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/remember_me_options.yml
@@ -7,6 +7,6 @@ security:
main:
form_login: true
remember_me:
- key: TheKey
+ secret: TheSecret
catch_exceptions: false
token_provider: token_provider_id
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Form/UserLoginFormType.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Form/UserLoginFormType.php
index d76d8fd629bba..04d41752c83ea 100644
--- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Form/UserLoginFormType.php
+++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Form/UserLoginFormType.php
@@ -16,7 +16,7 @@
use Symfony\Component\Form\FormError;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormEvent;
-use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Security\Core\Security;
@@ -29,14 +29,14 @@
*/
class UserLoginFormType extends AbstractType
{
- private $request;
+ private $requestStack;
/**
- * @param Request $request A request instance
+ * @param RequestStack $requestStack A RequestStack instance
*/
- public function __construct(Request $request)
+ public function __construct(RequestStack $requestStack)
{
- $this->request = $request;
+ $this->requestStack = $requestStack;
}
/**
@@ -50,7 +50,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
->add('_target_path', 'hidden')
;
- $request = $this->request;
+ $request = $this->requestStack->getCurrentRequest();
/* Note: since the Security component's form login listener intercepts
* the POST request, this form will never really be bound to the
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/config.yml b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/config.yml
index e1e2b0e883933..2b97bd5a66384 100644
--- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/config.yml
+++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/config.yml
@@ -4,9 +4,8 @@ imports:
services:
csrf_form_login.form.type:
class: Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\CsrfFormLoginBundle\Form\UserLoginFormType
- scope: request
arguments:
- - @request
+ - @request_stack
tags:
- { name: form.type, alias: user_login }
diff --git a/src/Symfony/Bundle/SecurityBundle/composer.json b/src/Symfony/Bundle/SecurityBundle/composer.json
index 55c251a40be69..a929eb09b8887 100644
--- a/src/Symfony/Bundle/SecurityBundle/composer.json
+++ b/src/Symfony/Bundle/SecurityBundle/composer.json
@@ -17,25 +17,26 @@
],
"require": {
"php": ">=5.3.9",
- "symfony/security": "~2.7",
+ "symfony/security": "~2.8|~3.0.0",
"symfony/http-kernel": "~2.2"
},
"require-dev": {
- "symfony/phpunit-bridge": "~2.7",
- "symfony/browser-kit": "~2.4",
- "symfony/console": "~2.7",
- "symfony/css-selector": "~2.0,>=2.0.5",
- "symfony/dependency-injection": "~2.6,>=2.6.6",
- "symfony/dom-crawler": "~2.0,>=2.0.5",
+ "symfony/phpunit-bridge": "~2.7|~3.0.0",
+ "symfony/browser-kit": "~2.4|~3.0.0",
+ "symfony/config": "~2.8|~3.0.0",
+ "symfony/console": "~2.7|~3.0.0",
+ "symfony/css-selector": "~2.0,>=2.0.5|~3.0.0",
+ "symfony/dependency-injection": "~2.6,>=2.6.6|~3.0.0",
+ "symfony/dom-crawler": "~2.0,>=2.0.5|~3.0.0",
"symfony/form": "~2.7",
"symfony/framework-bundle": "~2.7",
- "symfony/http-foundation": "~2.3",
- "symfony/twig-bundle": "~2.7",
- "symfony/twig-bridge": "~2.7",
- "symfony/process": "~2.0,>=2.0.5",
- "symfony/validator": "~2.5",
- "symfony/yaml": "~2.0,>=2.0.5",
- "symfony/expression-language": "~2.6",
+ "symfony/http-foundation": "~2.4|~3.0.0",
+ "symfony/twig-bundle": "~2.7|~3.0.0",
+ "symfony/twig-bridge": "~2.7|~3.0.0",
+ "symfony/process": "~2.0,>=2.0.5|~3.0.0",
+ "symfony/validator": "~2.5|~3.0.0",
+ "symfony/yaml": "~2.0,>=2.0.5|~3.0.0",
+ "symfony/expression-language": "~2.6|~3.0.0",
"doctrine/doctrine-bundle": "~1.2",
"twig/twig": "~1.12",
"ircmaxell/password-compat": "~1.0"
@@ -46,7 +47,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "2.7-dev"
+ "dev-master": "2.8-dev"
}
}
}
diff --git a/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheCacheWarmer.php b/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheCacheWarmer.php
index 65827eba5a6b8..5dde9406914a4 100644
--- a/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheCacheWarmer.php
+++ b/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheCacheWarmer.php
@@ -11,9 +11,11 @@
namespace Symfony\Bundle\TwigBundle\CacheWarmer;
+use Symfony\Component\Finder\Finder;
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinderInterface;
+use Symfony\Component\Templating\TemplateReference;
/**
* Generates the Twig cache for all templates.
@@ -27,14 +29,16 @@ class TemplateCacheCacheWarmer implements CacheWarmerInterface
{
protected $container;
protected $finder;
+ private $paths;
/**
* Constructor.
*
* @param ContainerInterface $container The dependency injection container
* @param TemplateFinderInterface $finder The template paths cache warmer
+ * @param array $paths Additional twig paths to warm
*/
- public function __construct(ContainerInterface $container, TemplateFinderInterface $finder)
+ public function __construct(ContainerInterface $container, TemplateFinderInterface $finder, array $paths = array())
{
// We don't inject the Twig environment directly as it depends on the
// template locator (via the loader) which might be a cached one.
@@ -42,6 +46,7 @@ public function __construct(ContainerInterface $container, TemplateFinderInterfa
// has been warmed up
$this->container = $container;
$this->finder = $finder;
+ $this->paths = $paths;
}
/**
@@ -53,7 +58,13 @@ public function warmUp($cacheDir)
{
$twig = $this->container->get('twig');
- foreach ($this->finder->findAllTemplates() as $template) {
+ $templates = $this->finder->findAllTemplates();
+
+ foreach ($this->paths as $path => $namespace) {
+ $templates = array_merge($templates, $this->findTemplatesInFolder($namespace, $path));
+ }
+
+ foreach ($templates as $template) {
if ('twig' !== $template->get('engine')) {
continue;
}
@@ -75,4 +86,32 @@ public function isOptional()
{
return true;
}
+
+ /**
+ * Find templates in the given directory.
+ *
+ * @param string $namespace The namespace for these templates
+ * @param string $dir The folder where to look for templates
+ *
+ * @return array An array of templates of type TemplateReferenceInterface
+ */
+ private function findTemplatesInFolder($namespace, $dir)
+ {
+ if (!is_dir($dir)) {
+ return array();
+ }
+
+ $templates = array();
+ $finder = new Finder();
+
+ foreach ($finder->files()->followLinks()->in($dir) as $file) {
+ $name = $file->getRelativePathname();
+ $templates[] = new TemplateReference(
+ $namespace ? sprintf('@%s/%s', $namespace, $name) : $name,
+ 'twig'
+ );
+ }
+
+ return $templates;
+ }
}
diff --git a/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php b/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php
index 7b97e120baa4b..c0171219d0487 100644
--- a/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php
+++ b/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php
@@ -12,6 +12,7 @@
namespace Symfony\Bundle\TwigBundle\DependencyInjection;
use Symfony\Component\Config\FileLocator;
+use Symfony\Component\Config\Resource\FileExistenceResource;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
@@ -76,21 +77,29 @@ public function load(array $configs, ContainerBuilder $container)
}
}
+ $container->getDefinition('twig.cache_warmer')->replaceArgument(2, $config['paths']);
+
// register bundles as Twig namespaces
foreach ($container->getParameter('kernel.bundles') as $bundle => $class) {
- if (is_dir($dir = $container->getParameter('kernel.root_dir').'/Resources/'.$bundle.'/views')) {
+ $dir = $container->getParameter('kernel.root_dir').'/Resources/'.$bundle.'/views';
+ if (is_dir($dir)) {
$this->addTwigPath($twigFilesystemLoaderDefinition, $dir, $bundle);
}
+ $container->addResource(new FileExistenceResource($dir));
$reflection = new \ReflectionClass($class);
- if (is_dir($dir = dirname($reflection->getFileName()).'/Resources/views')) {
+ $dir = dirname($reflection->getFileName()).'/Resources/views';
+ if (is_dir($dir)) {
$this->addTwigPath($twigFilesystemLoaderDefinition, $dir, $bundle);
}
+ $container->addResource(new FileExistenceResource($dir));
}
- if (is_dir($dir = $container->getParameter('kernel.root_dir').'/Resources/views')) {
+ $dir = $container->getParameter('kernel.root_dir').'/Resources/views';
+ if (is_dir($dir)) {
$twigFilesystemLoaderDefinition->addMethodCall('addPath', array($dir));
}
+ $container->addResource(new FileExistenceResource($dir));
if (!empty($config['globals'])) {
$def = $container->getDefinition('twig');
diff --git a/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml b/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml
index 9e1a11777418c..c06a82f06ec64 100644
--- a/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml
+++ b/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml
@@ -48,6 +48,7 @@
+
diff --git a/src/Symfony/Bundle/TwigBundle/composer.json b/src/Symfony/Bundle/TwigBundle/composer.json
index 61c85d33e3ed0..1f73c781e9f3b 100644
--- a/src/Symfony/Bundle/TwigBundle/composer.json
+++ b/src/Symfony/Bundle/TwigBundle/composer.json
@@ -17,20 +17,20 @@
],
"require": {
"php": ">=5.3.9",
- "symfony/asset": "~2.7",
- "symfony/twig-bridge": "~2.7",
- "symfony/http-foundation": "~2.5",
+ "symfony/asset": "~2.7|~3.0.0",
+ "symfony/twig-bridge": "~2.7|~3.0.0",
+ "symfony/http-foundation": "~2.5|~3.0.0",
"symfony/http-kernel": "~2.7"
},
"require-dev": {
- "symfony/phpunit-bridge": "~2.7",
- "symfony/stopwatch": "~2.2",
- "symfony/dependency-injection": "~2.6,>=2.6.6",
- "symfony/expression-language": "~2.4",
- "symfony/config": "~2.2",
- "symfony/routing": "~2.1",
- "symfony/templating": "~2.1",
- "symfony/framework-bundle": "~2.7"
+ "symfony/phpunit-bridge": "~2.7|~3.0.0",
+ "symfony/stopwatch": "~2.2|~3.0.0",
+ "symfony/dependency-injection": "~2.6,>=2.6.6|~3.0.0",
+ "symfony/expression-language": "~2.4|~3.0.0",
+ "symfony/config": "~2.8|~3.0.0",
+ "symfony/routing": "~2.1|~3.0.0",
+ "symfony/templating": "~2.1|~3.0.0",
+ "symfony/framework-bundle": "~2.7|~3.0.0"
},
"autoload": {
"psr-4": { "Symfony\\Bundle\\TwigBundle\\": "" }
@@ -38,7 +38,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "2.7-dev"
+ "dev-master": "2.8-dev"
}
}
}
diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php
index 2748910a19ae8..cada4ee6ca435 100644
--- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php
+++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php
@@ -91,6 +91,10 @@ public function panelAction(Request $request, $token)
$panel = $request->query->get('panel', 'request');
$page = $request->query->get('page', 'home');
+ if ('latest' === $token && $latest = current($this->profiler->find(null, null, 1, null, null, null))) {
+ $token = $latest['token'];
+ }
+
if (!$profile = $this->profiler->loadProfile($token)) {
return new Response($this->twig->render('@WebProfiler/Profiler/info.html.twig', array('about' => 'no_token', 'token' => $token)), 200, array('Content-Type' => 'text/html'));
}
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 d25122b90bf27..485cb57c9bff6 100644
--- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig
+++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig
@@ -69,8 +69,7 @@
{% set debug_status_class %}sf-toolbar-status sf-toolbar-status-{{ collector.debug ? 'green' : 'red' }}{% endset %}
{% set icon %}
-
- {{ token }}
+ {{ token }}
{% if 'n/a' != collector.appname or 'n/a' != collector.env %}
{{ collector.appname }}
diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig
index 291a4eac110c0..a6707da12d77e 100644
--- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig
+++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig
@@ -87,20 +87,30 @@
{% if collector.logs %}
-
+
+
+
#
+
Priority
+
Channel
+
Message and context
+
+
{% set log_loop_index = 0 %}
{% for log in collector.logs %}
{% set is_deprecation = log.context.level is defined and log.context.type is defined and (constant('E_DEPRECATED') == log.context.type or constant('E_USER_DEPRECATED') == log.context.type) %}
{% if priority == '-100' ? is_deprecation : log.priority >= priority %}
{% set log_loop_index = log_loop_index + 1 %}
-
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.