Merge branch '2.6' into 2.7

* 2.6: (21 commits)
  bumped Symfony version to 2.6.8
  updated VERSION for 2.6.7
  updated CHANGELOG for 2.6.7
  bumped Symfony version to 2.3.29
  updated VERSION for 2.3.28
  update CONTRIBUTORS for 2.3.28
  updated CHANGELOG for 2.3.28
  [Debug] Fixed ClassNotFoundFatalErrorHandlerTest
  [SecurityBundle] use access decision constants in config
  [SecurityBundle] use session auth constants in config
  PhpDoc fix in AbstractRememberMeServices
  [Filesystem] Simplified an if statement
  [SecurityBundle] Use Enum Nodes Instead Of Scalar
  [Debug 2.3] Fix test for PHP7
  [HttpKernel] Check if "symfony/proxy-manager-bridge" package is installed
  [Translation] simplify getMessages.
  [Framework][Translation] added test for debug command.
  Run tests on hhvm instead of hhvm-nightly
  Use HTTPS in README and some other fixes
  add more entropy to generated classnames
  ...

Conflicts:
	.travis.yml
	src/Symfony/Component/HttpKernel/Kernel.php
This commit is contained in:
Fabien Potencier 2015-05-11 04:35:29 +02:00
commit daf4a03e5d
21 changed files with 456 additions and 100 deletions

View File

@ -11,10 +11,10 @@ matrix:
- php: 5.6
env: deps=high
- php: nightly
- php: hhvm-nightly
- php: hhvm
allow_failures:
- php: nightly
- php: hhvm-nightly
- php: hhvm
fast_finish: true
services: mongodb
@ -27,12 +27,12 @@ env:
before_install:
- travis_retry sudo apt-get install parallel
- composer self-update
- if [[ "$TRAVIS_PHP_VERSION" != *"nightly" ]]; then phpenv config-rm xdebug.ini; fi;
- if [[ "$TRAVIS_PHP_VERSION" != *"nightly" ]]; then echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
- if [[ "$TRAVIS_PHP_VERSION" != *"nightly" ]] && [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
- if [[ "$TRAVIS_PHP_VERSION" != *"nightly" ]]; then (pecl install -f memcached-2.1.0 && echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini) || echo "Let's continue without memcache extension"; fi;
- if [[ "$TRAVIS_PHP_VERSION" != *"nightly" ]]; then (cd src/Symfony/Component/Debug/Resources/ext && phpize && ./configure && make && echo "extension = $(pwd)/modules/symfony_debug.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini); fi;
- if [[ "$TRAVIS_PHP_VERSION" != *"nightly" ]]; then php -i; fi;
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]]; then phpenv config-rm xdebug.ini; fi;
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]]; then echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]]; then (pecl install -f memcached-2.1.0 && echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini) || echo "Let's continue without memcache extension"; fi;
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]]; then (cd src/Symfony/Component/Debug/Resources/ext && phpize && ./configure && make && echo "extension = $(pwd)/modules/symfony_debug.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini); fi;
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]]; then php -i; fi;
- sudo locale-gen fr_FR.UTF-8 && sudo update-locale
# Set the COMPOSER_ROOT_VERSION to the right version according to the branch being built
- if [ "$TRAVIS_BRANCH" = "master" ]; then export COMPOSER_ROOT_VERSION=dev-master; else export COMPOSER_ROOT_VERSION="$TRAVIS_BRANCH".x-dev; fi;

View File

@ -7,6 +7,25 @@ in 2.3 minor versions.
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.3.0...v2.3.1
* 2.3.28 (2015-05-10)
* bug #14266 [HttpKernel] Check if "symfony/proxy-manager-bridge" package is installed (hason)
* bug #14501 [ProxyBridge] Fix proxy classnames generation (xphere)
* bug #14498 [FrameworkBundle] Added missing log in server:run command (lyrixx)
* bug #14484 [SecurityBundle][WebProfiler] check authenticated user by tokenClass instead of username. (aitboudad)
* bug #14497 [HttpFoundation] Allow curly braces in trusted host patterns (sgrodzicki)
* bug #14436 Show a better error when the port is in use (dosten)
* bug #14463 [Validator] Fixed Choice when an empty array is used in the "choices" option (webmozart)
* bug #14402 [FrameworkBundle][Translation] Check for 'xlf' instead of 'xliff' (xelaris)
* bug #14272 [FrameworkBundle] Workaround php -S ignoring auto_prepend_file (nicolas-grekas)
* bug #14345 [FrameworkBundle] Fix Routing\DelegatingLoader resiliency to fatal errors (nicolas-grekas)
* bug #14325 [Routing][DependencyInjection] Support .yaml extension in YAML loaders (thunderer)
* bug #14344 [Translation][fixed test] refresh cache when resources are no longer fresh. (aitboudad)
* bug #14268 [Translator] Cache does not take fallback locales into consideration (sf2.3) (mpdude)
* bug #14192 [HttpKernel] Embed the original exception as previous to bounced exceptions (nicolas-grekas)
* bug #14102 [Enhancement] netbeans - force interactive shell when limited detection (cordoval)
* bug #14191 [StringUtil] Fixed singularification of 'movies' (GerbenWijnja)
* 2.3.27 (2015-04-01)
* security #14167 CVE-2015-2308 (nicolas-grekas)

View File

@ -7,6 +7,49 @@ in 2.6 minor versions.
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.6.0...v2.6.1
* 2.6.7 (2015-05-11)
* bug #14266 [HttpKernel] Check if "symfony/proxy-manager-bridge" package is installed (hason)
* bug #14478 [DebugBundle] Fix dump() output in API / No-Toolbar context (nicolas-grekas)
* bug #14501 [ProxyBridge] Fix proxy classnames generation (xphere)
* bug #14527 Fix getOrigin (WouterJ)
* bug #14498 [FrameworkBundle] Added missing log in server:run command (lyrixx)
* bug #14503 [Finder] Only use GLOB_BRACE when available (dosten)
* bug #14484 [SecurityBundle][WebProfiler] check authenticated user by tokenClass instead of username. (aitboudad)
* bug #14497 [HttpFoundation] Allow curly braces in trusted host patterns (sgrodzicki)
* bug #14480 [TwigBundle] Fix deprecated use of FlattenException (alOneh)
* bug #14469 [Debug] BaseException compatibility for PHP7 (nicolas-grekas)
* bug #14466 [WebProfiler] fix html syntax for input types (Tobion)
* bug #14436 Show a better error when the port is in use (dosten)
* bug #14463 [Validator] Fixed Choice when an empty array is used in the "choices" option (webmozart)
* bug #14446 [DependencyInjection] resolve circular reference (xabbuh)
* bug #14448 [Validator] Fixed Choice when an empty array is used in the "choices" option (webmozart)
* bug #14451 [Debug] Fix ClassNotFoundFatalErrorHandler candidates lookups (nicolas-grekas)
* bug #14355 [EventDispatcher] make listeners removable from an executed listener (xabbuh)
* bug #14402 [FrameworkBundle][Translation] Check for 'xlf' instead of 'xliff' (xelaris)
* bug #14272 [FrameworkBundle] Workaround php -S ignoring auto_prepend_file (nicolas-grekas)
* bug #14362 [Debug] Scream as LogLevel::DEBUG (but for fatal errors / uncaught exceptions) (nicolas-grekas)
* bug #14345 [FrameworkBundle] Fix Routing\DelegatingLoader resiliency to fatal errors (nicolas-grekas)
* bug #14381 [FrameworkBundle] Initialize translator with the default locale. (aitboudad)
* bug #14325 [Routing][DependencyInjection] Support .yaml extension in YAML loaders (thunderer)
* bug #14344 [Translation][fixed test] refresh cache when resources are no longer fresh. (aitboudad)
* bug #14346 [WebProfilerBundle] Fix resiliency to exceptions thrown by the url generator (nicolas-grekas)
* bug #14338 [FrameworkBundle] improve usage of Table helper (xabbuh)
* bug #14129 [FrameworkBundle] Fixed server:start --router relative path issue #14124 (abulford)
* bug #14271 [VarDumper] Fix call site detection (nicolas-grekas)
* bug #14277 [Translator] Cache does not take fallback locales into consideration (mpdude)
* bug #14268 [Translator] Cache does not take fallback locales into consideration (sf2.3) (mpdude)
* bug #14256 [Form] Fixed DateType/TimeType (webmozart)
* bug #14226 [Profiler][Logger] fixed cycle odd/even. (aitboudad)
* bug #14204 [VarDumper] Towards PHP7 support (nicolas-grekas)
* bug #14205 Fix currently broken tests (mpdude)
* bug #14192 [HttpKernel] Embed the original exception as previous to bounced exceptions (nicolas-grekas)
* bug #14102 [Enhancement] netbeans - force interactive shell when limited detection (cordoval)
* bug #14191 [StringUtil] Fixed singularification of 'movies' (GerbenWijnja)
* bug #14182 [FrameworkBundle] fixes displaying of deprecation notices. (hhamon)
* feature #14186 [Debug] Renamed "context" key to "scope_vars" to avoid any ambiguity (lyrixx)
* bug #14170 Fix the AJAX profiling (stof)
* 2.6.6 (2015-04-01)
* security #14167 CVE-2015-2308 (nicolas-grekas)

View File

@ -9,15 +9,15 @@ Symfony is the result of the work of many people who made the code better
- Victor Berchet (victor)
- Tobias Schultze (tobion)
- Jordi Boggiano (seldaek)
- Nicolas Grekas (nicolas-grekas)
- Johannes S (johannes)
- Kris Wallsmith (kriswallsmith)
- Nicolas Grekas (nicolas-grekas)
- Christophe Coevoet (stof)
- Jakub Zalas (jakubzalas)
- Pascal Borreli (pborreli)
- Hugo Hamon (hhamon)
- Karma Dordrak (drak)
- Joseph Bielawski (stloyd)
- Karma Dordrak (drak)
- Ryan Weaver (weaverryan)
- Lukas Kahwe Smith (lsmith)
- Romain Neutron (romain)
@ -29,20 +29,20 @@ Symfony is the result of the work of many people who made the code better
- Martin Hasoň (hason)
- Eriksen Costa (eriksencosta)
- Grégoire Pineau (lyrixx)
- Jonathan Wage (jwage)
- Abdellatif Ait boudad (aitboudad)
- Wouter De Jong (wouterj)
- Jonathan Wage (jwage)
- Alexandre Salomé (alexandresalome)
- William Durand (couac)
- ornicar
- stealth35 (stealth35)
- Alexander Mols (asm89)
- Bulat Shakirzyanov (avalanche123)
- Abdellatif Ait boudad (aitboudad)
- Francis Besset (francisbesset)
- Kévin Dunglas (dunglas)
- Saša Stamenković (umpirsky)
- Henrik Bjørnskov (henrikbjorn)
- Miha Vrhovnik
- Kévin Dunglas (dunglas)
- Sarah Khalil (saro0h)
- Konstantin Kudryashov (everzet)
- Bilal Amarni (bamarni)
@ -57,6 +57,7 @@ Symfony is the result of the work of many people who made the code better
- Michel Weimerskirch (mweimerskirch)
- Lee McDermott
- Brandon Turner
- Luis Cordova (cordoval)
- Douglas Greenshields (shieldo)
- Daniel Holmes (dholmes)
- Bart van den Burg (burgov)
@ -64,11 +65,10 @@ Symfony is the result of the work of many people who made the code better
- Kevin Bond (kbond)
- John Wards (johnwards)
- Fran Moreno (franmomu)
- Luis Cordova (cordoval)
- Antoine Hérault (herzult)
- Toni Uebernickel (havvg)
- Arnaud Le Blanc (arnaud-lb)
- Gábor Egyed (1ed)
- Arnaud Le Blanc (arnaud-lb)
- Tim Nagel (merk)
- Brice BERNARD (brikou)
- marc.weistroff
@ -82,10 +82,13 @@ Symfony is the result of the work of many people who made the code better
- excelwebzone
- Jacob Dreesen (jdreesen)
- Fabien Pennequin (fabienpennequin)
- Matthias Pigulla (mpdude)
- Peter Kokot (maastermedia)
- Peter Rehm (rpet)
- Diego Saint Esteben (dii3g0)
- Michal Piotrowski (eventhorizon)
- Stefano Sala (stefano.sala)
- Javier Eguiluz (javier.eguiluz)
- Gordon Franke (gimler)
- Robert Schönthal (digitalkaoz)
- Juti Noppornpitak (shiroyuki)
@ -99,11 +102,10 @@ Symfony is the result of the work of many people who made the code better
- Eric GELOEN (gelo)
- Jérémie Augustin (jaugustin)
- Rafael Dohms (rdohms)
- Dariusz Ruminski
- Tigran Azatyan (tigranazatyan)
- Javier Eguiluz (javier.eguiluz)
- Arnaud Kleinpeter (nanocom)
- Richard Shank (iampersistent)
- Dariusz Ruminski
- Clemens Tolboom
- Helmer Aaviksoo
- Sebastiaan Stok (sstok)
@ -124,7 +126,7 @@ Symfony is the result of the work of many people who made the code better
- Mario A. Alvarez Garcia (nomack84)
- Dennis Benkert (denderello)
- Benjamin Dulau (dbenjamin)
- Matthias Pigulla (mpdude)
- Alexander Schwenn (xelaris)
- Andreas Hucks (meandmymonkey)
- Noel Guilbert (noel)
- Joel Wurtz (brouznouf)
@ -143,9 +145,10 @@ Symfony is the result of the work of many people who made the code better
- François Zaninotto (fzaninotto)
- Dustin Whittle (dustinwhittle)
- jeff
- Joshua Thijssen
- Justin Hileman (bobthecow)
- Sven Paulus (subsven)
- Alexander Schwenn (xelaris)
- Vladimir Reznichenko (kalessil)
- Lars Strojny (lstrojny)
- Rui Marinho (ruimarinho)
- Mikael Pajunen
@ -154,6 +157,7 @@ Symfony is the result of the work of many people who made the code better
- Sergey Linnik (linniksa)
- Marcel Beerta (mazen)
- Javier Spagnoletti (phansys)
- julien pauli (jpauli)
- Francois Zaninotto
- Alexander Kotynia (olden)
- Daniel Tschinder
@ -164,7 +168,6 @@ Symfony is the result of the work of many people who made the code better
- Xavier Montaña Carreras (xmontana)
- Michele Orselli (orso)
- Chris Wilkinson (thewilkybarkid)
- Joshua Thijssen
- Xavier Perez
- Arjen Brouwer (arjenjb)
- Katsuhiro OGAWA
@ -184,9 +187,9 @@ Symfony is the result of the work of many people who made the code better
- Nikita Konstantinov
- Wodor Wodorski
- Matthieu Auger (matthieuauger)
- julien pauli (jpauli)
- Beau Simensen (simensen)
- Robert Kiss (kepten)
- Maxime Steinhausser (ogizanagi)
- John Kary (johnkary)
- Ruben Gonzalez (rubenrua)
- Kim Hemsø Rasmussen (kimhemsoe)
@ -194,7 +197,6 @@ Symfony is the result of the work of many people who made the code better
- Tom Van Looy (tvlooy)
- Wouter Van Hecke
- Peter Kruithof (pkruithof)
- Vladimir Reznichenko (kalessil)
- Michael Holm (hollo)
- Warnar Boekkooi (boekkooi)
- Marc Weistroff (futurecat)
@ -311,14 +313,15 @@ Symfony is the result of the work of many people who made the code better
- Marcin Sikoń (marphi)
- franek (franek)
- Adam Harvey
- Diego Saint Esteben (dii3g0)
- Alex Bakhturin
- François-Xavier de Guillebon (de-gui_f)
- boombatower
- Fabrice Bernhard (fabriceb)
- Jérôme Macias (jeromemacias)
- Vincent AUBERT (vincent)
- Fabian Lange (codingfabian)
- Yoshio HANAWA
- Tomasz Kowalczyk (thunderer)
- Sebastian Bergmann
- Pablo Díez (pablodip)
- Kevin McBride
@ -329,6 +332,7 @@ Symfony is the result of the work of many people who made the code better
- Iker Ibarguren (ikerib)
- Ricardo Oliveira (ricardolotr)
- ondrowan
- Barry vd. Heuvel (barryvdh)
- Jerzy Zawadzki (jzawadzki)
- Evan S Kaufman (evanskaufman)
- mcben
@ -374,7 +378,6 @@ Symfony is the result of the work of many people who made the code better
- Zach Badgett (zachbadgett)
- Aurélien Fredouelle
- Pavel Campr (pcampr)
- Maxime Steinhausser (ogizanagi)
- Disquedur
- Geoffrey Tran (geoff)
- Jan Behrens
@ -446,8 +449,6 @@ Symfony is the result of the work of many people who made the code better
- Tiago Brito (blackmx)
- Richard van den Brand (ricbra)
- develop
- Vincent AUBERT (vincent)
- Tomasz Kowalczyk (thunderer)
- Mark Sonnabaum
- Alexander Obuhovich (aik099)
- Mathieu Lemoine
@ -459,7 +460,6 @@ Symfony is the result of the work of many people who made the code better
- yclian
- Pascal Helfenstein
- Baldur Rensch (brensch)
- Barry vd. Heuvel (barryvdh)
- Alex Xandra Albert Sim
- Yuen-Chi Lian
- Besnik Br
@ -602,6 +602,7 @@ Symfony is the result of the work of many people who made the code better
- Zachary Tong (polyfractal)
- Hryhorii Hrebiniuk
- dantleech
- Xavier Leune
- Tero Alén (tero)
- DerManoMann
- Guillaume Royer
@ -684,10 +685,12 @@ Symfony is the result of the work of many people who made the code better
- Yannick
- Eduardo García Sanz (coma)
- Sebastian Grodzicki (sgrodzicki)
- James Gilliland
- Michael Lee (zerustech)
- Roy Van Ginneken
- David de Boer (ddeboer)
- Gilles Doge (gido)
- abulford
- Brooks Boyd
- Roger Webb
- Dmitriy Simushev
@ -722,6 +725,7 @@ Symfony is the result of the work of many people who made the code better
- Jeroen van den Enden (stoefke)
- origaminal
- Quique Porta (quiqueporta)
- Gregor Harlan
- Tomasz Szymczyk (karion)
- ConneXNL
- Aharon Perkel
@ -752,6 +756,7 @@ Symfony is the result of the work of many people who made the code better
- Karol Sójko (karolsojko)
- sl_toto (sl_toto)
- Sébastien HOUZÉ
- Jingyu Wang
- steveYeah
- Samy Dindane (dinduks)
- Keri Henare (kerihenare)
@ -881,6 +886,7 @@ Symfony is the result of the work of many people who made the code better
- catch
- Alexandre Segura
- Josef Cech
- Possum
- Arnau González (arnaugm)
- Nate (frickenate)
- Matthew Foster (mfoster)
@ -948,6 +954,7 @@ Symfony is the result of the work of many people who made the code better
- Daan van Renterghem
- Bram Van der Sype (brammm)
- Julien Moulin (lizjulien)
- Romain Gautier (mykiwi)
- Nikita Nefedov (nikita2206)
- Mauro Foti (skler)
- Yannick Warnier (ywarnier)
@ -1015,6 +1022,7 @@ Symfony is the result of the work of many people who made the code better
- Matthieu Prat
- Grummfy
- Filipe Guerra
- Gerben Wijnja
- Rowan Manning
- David Windell
- Gabriel Birke
@ -1243,6 +1251,7 @@ Symfony is the result of the work of many people who made the code better
- Guillermo Gisinger (t3chn0r)
- Markus Tacker (tacker)
- Tyler Stroud (tystr)
- Moritz Kraft (userfriendly)
- Víctor Mateo (victormateo)
- Vincent (vincent1870)
- Eugene Babushkin (warl)
@ -1266,6 +1275,7 @@ Symfony is the result of the work of many people who made the code better
- Mohamed Karnichi (amiral)
- Daniel Kolvik (dkvk)
- Jeroen De Dauw (jeroendedauw)
- Maxime COLIN (maximecolin)
- Muharrem Demirci (mdemirci)
- Evgeny Z (meze)
- Michiel Boeckaert (milio)

View File

@ -23,34 +23,33 @@ Installation
------------
The best way to install Symfony is to download the Symfony Standard Edition
available at [http://symfony.com/download][1].
available at <https://symfony.com/download>.
Documentation
-------------
The "[Quick Tour][2]" tutorial gives you a first feeling of the framework. If,
The "[Quick Tour][1]" tutorial gives you a first feeling of the framework. If,
like us, you think that Symfony can help speed up your development and take
the quality of your work to the next level, read the official
[Symfony documentation][3].
[Symfony documentation][2].
Contributing
------------
Symfony is an open source, community-driven project. If you'd like to contribute,
please read the [Contributing Code][4] part of the documentation. If you're submitting
a pull request, please follow the guidelines in the [Submitting a Patch][5] section
and use [Pull Request Template][6].
please read the [Contributing Code][3] part of the documentation. If you're submitting
a pull request, please follow the guidelines in the [Submitting a Patch][4] section
and use [Pull Request Template][5].
Running Symfony Tests
----------------------
Information on how to run the Symfony test suite can be found in the
[Running Symfony Tests][7] section.
[Running Symfony Tests][6] section.
[1]: http://symfony.com/download
[2]: http://symfony.com/get_started
[3]: http://symfony.com/doc/current/
[4]: http://symfony.com/doc/current/contributing/code/index.html
[5]: http://symfony.com/doc/current/contributing/code/patches.html#check-list
[6]: http://symfony.com/doc/current/contributing/code/patches.html#make-a-pull-request
[7]: http://symfony.com/doc/master/contributing/code/tests.html
[1]: https://symfony.com/get_started
[2]: https://symfony.com/doc/current/
[3]: https://symfony.com/doc/current/contributing/code/index.html
[4]: https://symfony.com/doc/current/contributing/code/patches.html#check-list
[5]: https://symfony.com/doc/current/contributing/code/patches.html#make-a-pull-request
[6]: https://symfony.com/doc/master/contributing/code/tests.html

View File

@ -26,6 +26,11 @@ use Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface;
*/
class ProxyDumper implements DumperInterface
{
/**
* @var string
*/
private $salt;
/**
* @var LazyLoadingValueHolderGenerator
*/
@ -38,9 +43,12 @@ class ProxyDumper implements DumperInterface
/**
* Constructor.
*
* @param string $salt
*/
public function __construct()
public function __construct($salt = '')
{
$this->salt = $salt;
$this->proxyGenerator = new LazyLoadingValueHolderGenerator();
$this->classGenerator = new BaseGeneratorStrategy();
}
@ -109,6 +117,6 @@ EOF;
*/
private function getProxyClassName(Definition $definition)
{
return str_replace('\\', '', $definition->getClass()).'_'.spl_object_hash($definition);
return str_replace('\\', '', $definition->getClass()).'_'.spl_object_hash($definition).$this->salt;
}
}

View File

@ -11,6 +11,7 @@
namespace Symfony\Bundle\DebugBundle\DependencyInjection\Compiler;
use Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@ -35,5 +36,9 @@ class DumpDataCollectorPass implements CompilerPassInterface
if ($container->hasParameter('templating.helper.code.file_link_format')) {
$definition->replaceArgument(1, $container->getParameter('templating.helper.code.file_link_format'));
}
if (!$container->hasParameter('web_profiler.debug_toolbar.mode') || WebDebugToolbarListener::DISABLED === $container->getParameter('web_profiler.debug_toolbar.mode')) {
$definition->replaceArgument(3, null);
}
}
}

View File

@ -15,6 +15,7 @@
<argument type="service" id="debug.stopwatch" on-invalid="ignore" />
<argument>null</argument><!-- %templating.helper.code.file_link_format% -->
<argument>%kernel.charset%</argument>
<argument type="service" id="request_stack" />
</service>
<service id="debug.dump_listener" class="Symfony\Component\HttpKernel\EventListener\DumpListener">

View File

@ -12,8 +12,10 @@
namespace Symfony\Bundle\DebugBundle\Tests\DependencyInjection\Compiler;
use Symfony\Bundle\DebugBundle\DependencyInjection\Compiler\DumpDataCollectorPass;
use Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\HttpFoundation\RequestStack;
class DumpDataCollectorPassTest extends \PHPUnit_Framework_TestCase
{
@ -23,7 +25,7 @@ class DumpDataCollectorPassTest extends \PHPUnit_Framework_TestCase
$container->addCompilerPass(new DumpDataCollectorPass());
$container->setParameter('templating.helper.code.file_link_format', 'file-link-format');
$definition = new Definition('Symfony\Component\HttpKernel\DataCollector\DumpDataCollector', array(null, null));
$definition = new Definition('Symfony\Component\HttpKernel\DataCollector\DumpDataCollector', array(null, null, null, null));
$container->setDefinition('data_collector.dump', $definition);
$container->compile();
@ -36,11 +38,53 @@ class DumpDataCollectorPassTest extends \PHPUnit_Framework_TestCase
$container = new ContainerBuilder();
$container->addCompilerPass(new DumpDataCollectorPass());
$definition = new Definition('Symfony\Component\HttpKernel\DataCollector\DumpDataCollector', array(null, null));
$definition = new Definition('Symfony\Component\HttpKernel\DataCollector\DumpDataCollector', array(null, null, null, null));
$container->setDefinition('data_collector.dump', $definition);
$container->compile();
$this->assertNull($definition->getArgument(1));
}
public function testProcessWithToolbarEnabled()
{
$container = new ContainerBuilder();
$container->addCompilerPass(new DumpDataCollectorPass());
$requestStack = new RequestStack();
$definition = new Definition('Symfony\Component\HttpKernel\DataCollector\DumpDataCollector', array(null, null, null, $requestStack));
$container->setDefinition('data_collector.dump', $definition);
$container->setParameter('web_profiler.debug_toolbar.mode', WebDebugToolbarListener::ENABLED);
$container->compile();
$this->assertSame($requestStack, $definition->getArgument(3));
}
public function testProcessWithToolbarDisabled()
{
$container = new ContainerBuilder();
$container->addCompilerPass(new DumpDataCollectorPass());
$definition = new Definition('Symfony\Component\HttpKernel\DataCollector\DumpDataCollector', array(null, null, null, new RequestStack()));
$container->setDefinition('data_collector.dump', $definition);
$container->setParameter('web_profiler.debug_toolbar.mode', WebDebugToolbarListener::DISABLED);
$container->compile();
$this->assertNull($definition->getArgument(3));
}
public function testProcessWithoutToolbar()
{
$container = new ContainerBuilder();
$container->addCompilerPass(new DumpDataCollectorPass());
$definition = new Definition('Symfony\Component\HttpKernel\DataCollector\DumpDataCollector', array(null, null, null, new RequestStack()));
$container->setDefinition('data_collector.dump', $definition);
$container->compile();
$this->assertNull($definition->getArgument(3));
}
}

View File

@ -24,7 +24,8 @@
"require-dev": {
"symfony/phpunit-bridge": "~2.7",
"symfony/config": "~2.3",
"symfony/dependency-injection": "~2.3"
"symfony/dependency-injection": "~2.3",
"symfony/web-profiler-bundle": "~2.3"
},
"suggest": {
"symfony/config": "For service container configuration",

View File

@ -0,0 +1,147 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\FrameworkBundle\Tests\Command;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Bundle\FrameworkBundle\Command\TranslationDebugCommand;
use Symfony\Component\Filesystem\Filesystem;
class TranslationDebugCommandTest extends \PHPUnit_Framework_TestCase
{
private $fs;
private $translationDir;
public function testDebugMissingMessages()
{
$tester = $this->createCommandTester($this->getContainer(array('foo' => 'foo')));
$tester->execute(array('locale' => 'en', 'bundle' => 'foo'));
$this->assertRegExp('/x (\s|\|)+foo/', $tester->getDisplay(), 'Display x in case of missing message');
}
public function testDebugUnusedMessages()
{
$tester = $this->createCommandTester($this->getContainer(array(), array('foo' => 'foo')));
$tester->execute(array('locale' => 'en', 'bundle' => 'foo'));
$this->assertRegExp('/o (\s|\|)+foo/', $tester->getDisplay(), 'Display o in case of unused message');
}
public function testDebugFallbackMessages()
{
$tester = $this->createCommandTester($this->getContainer(array(), array('foo' => 'foo')));
$tester->execute(array('locale' => 'fr', 'bundle' => 'foo'));
$this->assertRegExp('/= (\s|\|)+foo/', $tester->getDisplay(), 'Display = in case of fallback message');
}
public function testNoDefinedMessages()
{
$tester = $this->createCommandTester($this->getContainer());
$tester->execute(array('locale' => 'fr', 'bundle' => 'test'));
$this->assertRegExp('/^No defined or extracted messages for locale "fr"/', $tester->getDisplay());
}
protected function setUp()
{
$this->fs = new Filesystem();
$this->translationDir = sys_get_temp_dir().'/'.uniqid('sf2_translation');
$this->fs->mkdir($this->translationDir.'/Resources/translations');
}
protected function tearDown()
{
$this->fs->remove($this->translationDir);
}
/**
* @return CommandTester
*/
private function createCommandTester($container)
{
$command = new TranslationDebugCommand();
$command->setContainer($container);
$application = new Application();
$application->add($command);
return new CommandTester($application->find('debug:translation'));
}
private function getContainer($extractedMessages = array(), $loadedMessages = array())
{
$translator = $this->getMockBuilder('Symfony\Component\Translation\Translator')
->disableOriginalConstructor()
->getMock();
$translator
->expects($this->any())
->method('getFallbackLocales')
->will($this->returnValue(array('en')));
$extractor = $this->getMock('Symfony\Component\Translation\Extractor\ExtractorInterface');
$extractor
->expects($this->any())
->method('extract')
->will(
$this->returnCallback(function ($path, $catalogue) use ($extractedMessages) {
$catalogue->add($extractedMessages);
})
);
$loader = $this->getMock('Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader');
$loader
->expects($this->any())
->method('loadMessages')
->will(
$this->returnCallback(function ($path, $catalogue) use ($loadedMessages) {
$catalogue->add($loadedMessages);
})
);
$kernel = $this->getMock('Symfony\Component\HttpKernel\KernelInterface');
$kernel
->expects($this->any())
->method('getBundle')
->will($this->returnValueMap(array(
array('foo', true, $this->getBundle($this->translationDir)),
array('test', true, $this->getBundle('test')),
)));
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
$container
->expects($this->any())
->method('get')
->will($this->returnValueMap(array(
array('translation.extractor', 1, $extractor),
array('translation.loader', 1, $loader),
array('translator', 1, $translator),
array('kernel', 1, $kernel),
)));
return $container;
}
private function getBundle($path)
{
$bundle = $this->getMock('Symfony\Component\HttpKernel\Bundle\BundleInterface');
$bundle
->expects($this->any())
->method('getPath')
->will($this->returnValue($path))
;
return $bundle;
}
}

View File

@ -16,6 +16,7 @@ use Symfony\Component\Security\Core\Authorization\AccessDecisionManager;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy;
/**
* This class contains the configuration information.
@ -60,14 +61,20 @@ class MainConfiguration implements ConfigurationInterface
$rootNode
->children()
->scalarNode('access_denied_url')->defaultNull()->example('/foo/error403')->end()
->scalarNode('session_fixation_strategy')->cannotBeEmpty()->info('strategy can be: none, migrate, invalidate')->defaultValue('migrate')->end()
->enumNode('session_fixation_strategy')
->values(array(SessionAuthenticationStrategy::NONE, SessionAuthenticationStrategy::MIGRATE, SessionAuthenticationStrategy::INVALIDATE))
->defaultValue(SessionAuthenticationStrategy::MIGRATE)
->end()
->booleanNode('hide_user_not_found')->defaultTrue()->end()
->booleanNode('always_authenticate_before_granting')->defaultFalse()->end()
->booleanNode('erase_credentials')->defaultTrue()->end()
->arrayNode('access_decision_manager')
->addDefaultsIfNotSet()
->children()
->scalarNode('strategy')->defaultValue(AccessDecisionManager::STRATEGY_AFFIRMATIVE)->end()
->enumNode('strategy')
->values(array(AccessDecisionManager::STRATEGY_AFFIRMATIVE, AccessDecisionManager::STRATEGY_CONSENSUS, AccessDecisionManager::STRATEGY_UNANIMOUS))
->defaultValue(AccessDecisionManager::STRATEGY_AFFIRMATIVE)
->end()
->booleanNode('allow_if_all_abstain')->defaultFalse()->end()
->booleanNode('allow_if_equal_granted_denied')->defaultTrue()->end()
->end()

View File

@ -181,11 +181,11 @@ class ClassNotFoundFatalErrorHandlerTest extends \PHPUnit_Framework_TestCase
public function testCannotRedeclareClass()
{
if (!file_exists(__DIR__.'/../FIXTURES/REQUIREDTWICE.PHP')) {
if (!file_exists(__DIR__.'/../FIXTURES2/REQUIREDTWICE.PHP')) {
$this->markTestSkipped('Can only be run on case insensitive filesystems');
}
require_once __DIR__.'/../FIXTURES/REQUIREDTWICE.PHP';
require_once __DIR__.'/../FIXTURES2/REQUIREDTWICE.PHP';
$error = array(
'type' => 1,

View File

@ -1,7 +0,0 @@
<?php
namespace Symfony\Component\Debug\Tests\Fixtures;
class RequiredTwice
{
}

View File

@ -0,0 +1,7 @@
<?php
namespace Symfony\Component\Debug\Tests\Fixtures2;
class RequiredTwice
{
}

View File

@ -439,17 +439,13 @@ class Filesystem
*/
public function isAbsolutePath($file)
{
if (strspn($file, '/\\', 0, 1)
return (strspn($file, '/\\', 0, 1)
|| (strlen($file) > 3 && ctype_alpha($file[0])
&& substr($file, 1, 1) === ':'
&& (strspn($file, '/\\', 2, 1))
)
|| null !== parse_url($file, PHP_URL_SCHEME)
) {
return true;
}
return false;
);
}
/**

View File

@ -12,6 +12,7 @@
namespace Symfony\Component\HttpKernel\DataCollector;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Stopwatch\Stopwatch;
use Symfony\Component\VarDumper\Cloner\Data;
@ -33,12 +34,14 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
private $clonesIndex = 0;
private $rootRefs;
private $charset;
private $dumper;
public function __construct(Stopwatch $stopwatch = null, $fileLinkFormat = null, $charset = null)
public function __construct(Stopwatch $stopwatch = null, $fileLinkFormat = null, $charset = null, RequestStack $requestStack = null)
{
$this->stopwatch = $stopwatch;
$this->fileLinkFormat = $fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
$this->charset = $charset ?: ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8';
$this->requestStack = $requestStack;
// All clones share these properties by reference:
$this->rootRefs = array(
@ -118,8 +121,12 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
$name = substr($name, strrpos($name, '/') + 1);
}
$this->data[] = compact('data', 'name', 'file', 'line', 'fileExcerpt');
++$this->dataCount;
if ($this->dumper) {
$this->doDump($data, $name, $file, $line);
} else {
$this->data[] = compact('data', 'name', 'file', 'line', 'fileExcerpt');
++$this->dataCount;
}
if ($this->stopwatch) {
$this->stopwatch->stop('dump');
@ -128,6 +135,33 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
public function collect(Request $request, Response $response, \Exception $exception = null)
{
if ($this->requestStack && $this->requestStack->getMasterRequest() !== $request) {
return;
}
// In all conditions that remove the web debug toolbar, dumps are written on the output.
if (!$this->requestStack
|| $request->isXmlHttpRequest()
|| !$response->headers->has('X-Debug-Token')
|| $response->isRedirection()
|| ($response->headers->has('Content-Type') && false === strpos($response->headers->get('Content-Type'), 'html'))
|| 'html' !== $request->getRequestFormat()
|| false === strripos($response->getContent(), '</body>')
) {
if ($response->headers->has('Content-Type') && false !== strpos($response->headers->get('Content-Type'), 'html')) {
$this->dumper = new HtmlDumper('php://output', $this->charset);
} else {
$this->dumper = new CliDumper('php://output', $this->charset);
}
foreach ($this->data as $i => $dump) {
$this->data[$i] = null;
$this->doDump($dump['data'], $dump['name'], $dump['file'], $dump['line']);
}
$this->data = array();
$this->dataCount = 0;
}
}
public function serialize()
@ -140,6 +174,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
$this->data = array();
$this->dataCount = 0;
$this->isCollected = true;
$this->dumper = null;
return $ser;
}
@ -203,31 +238,14 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
}
if ('cli' !== PHP_SAPI && stripos($h[$i], 'html')) {
$dumper = new HtmlDumper('php://output', $this->charset);
$this->dumper = new HtmlDumper('php://output', $this->charset);
} else {
$dumper = new CliDumper('php://output', $this->charset);
$dumper->setColors(false);
$this->dumper = new CliDumper('php://output', $this->charset);
}
foreach ($this->data as $i => $dump) {
$this->data[$i] = null;
if ($dumper instanceof HtmlDumper) {
$dump['name'] = $this->htmlEncode($dump['name']);
$dump['file'] = $this->htmlEncode($dump['file']);
if ('' !== $dump['file']) {
if ($this->fileLinkFormat) {
$link = strtr($this->fileLinkFormat, array('%f' => $dump['file'], '%l' => $dump['line']));
$dump['name'] = sprintf('<a href="%s" title="%s">%s</a>', $link, $dump['file'], $dump['name']);
} else {
$dump['name'] = sprintf('<abbr title="%s">%s</abbr>', $dump['file'], $dump['name']);
}
}
echo "\n<span class=\"sf-dump-meta\">{$dump['name']} on line {$dump['line']}:</span>";
} else {
echo "{$dump['name']} on line {$dump['line']}:\n";
}
$dumper->dump($dump['data']);
$this->doDump($dump['data'], $dump['name'], $dump['file'], $dump['line']);
}
$this->data = array();
@ -235,6 +253,26 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
}
}
private function doDump($data, $name, $file, $line)
{
if ($this->dumper instanceof HtmlDumper) {
$name = $this->htmlEncode($name);
$file = $this->htmlEncode($file);
if ('' !== $file) {
if ($this->fileLinkFormat) {
$link = strtr($this->fileLinkFormat, array('%f' => $file, '%l' => $line));
$name = sprintf('<a href="%s" title="%s">%s</a>', $link, $file, $name);
} else {
$name = sprintf('<abbr title="%s">%s</abbr>', $file, $name);
}
}
echo "\n<span class=\"sf-dump-meta\">{$name} on line {$line}:</span>";
} else {
echo "{$name} on line {$line}:\n";
}
$this->dumper->dump($data);
}
private function htmlEncode($s)
{
$html = '';

View File

@ -674,7 +674,7 @@ abstract class Kernel implements KernelInterface, TerminableInterface
{
$container = new ContainerBuilder(new ParameterBag($this->getKernelParameters()));
if (class_exists('ProxyManager\Configuration')) {
if (class_exists('ProxyManager\Configuration') && class_exists('Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator')) {
$container->setProxyInstantiator(new RuntimeInstantiator());
}
@ -694,8 +694,8 @@ abstract class Kernel implements KernelInterface, TerminableInterface
// cache the container
$dumper = new PhpDumper($container);
if (class_exists('ProxyManager\Configuration')) {
$dumper->setProxyDumper(new ProxyDumper());
if (class_exists('ProxyManager\Configuration') && class_exists('Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper')) {
$dumper->setProxyDumper(new ProxyDumper(md5((string) $cache)));
}
$content = $dumper->dump(array('class' => $class, 'base_class' => $baseClass, 'file' => $cache->getPath()));

View File

@ -12,11 +12,11 @@
namespace Symfony\Component\HttpKernel\Tests\DataCollector;
use Symfony\Component\HttpKernel\DataCollector\DumpDataCollector;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\VarDumper\Cloner\Data;
/**
* DumpDataCollectorTest
*
* @author Nicolas Grekas <p@tchwork.com>
*/
class DumpDataCollectorTest extends \PHPUnit_Framework_TestCase
@ -58,6 +58,49 @@ class DumpDataCollectorTest extends \PHPUnit_Framework_TestCase
$this->assertSame('a:0:{}', $collector->serialize());
}
public function testCollectDefault()
{
$data = new Data(array(array(123)));
$collector = new DumpDataCollector();
$collector->dump($data);
$line = __LINE__ - 1;
ob_start();
$collector->collect(new Request(), new Response());
$output = ob_get_clean();
$this->assertSame("DumpDataCollectorTest.php on line {$line}:\n123\n", $output);
}
public function testCollectHtml()
{
$data = new Data(array(array(123)));
$collector = new DumpDataCollector(null, 'test://%f:%l');
$collector->dump($data);
$line = __LINE__ - 1;
$file = __FILE__;
$xOutput = <<<EOTXT
<span class="sf-dump-meta"><a href="test://{$file}:{$line}" title="{$file}">DumpDataCollectorTest.php</a> on line {$line}:</span> <pre class=sf-dump id=sf-dump data-indent-pad=" "><span class=sf-dump-num>123</span>
</pre>
EOTXT;
ob_start();
$response = new Response();
$response->headers->set('Content-Type', 'text/html');
$collector->collect(new Request(), $response);
$output = ob_get_clean();
$output = preg_replace('#<(script|style).*?</\1>#s', '', $output);
$output = preg_replace('/sf-dump-\d+/', 'sf-dump', $output);
$this->assertSame($xOutput, $output);
}
public function testFlush()
{
$data = new Data(array(array(456)));

View File

@ -217,7 +217,7 @@ abstract class AbstractRememberMeServices implements RememberMeServicesInterface
* @param array $cookieParts
* @param Request $request
*
* @return TokenInterface
* @return UserInterface
*/
abstract protected function processAutoLoginCookie(array $cookieParts, Request $request);

View File

@ -292,15 +292,10 @@ class Translator implements TranslatorInterface, TranslatorBagInterface
*/
public function getMessages($locale = null)
{
$catalogues = array();
$catalogues[] = $catalogue = $this->getCatalogue($locale);
$catalogue = $this->getCatalogue($locale);
$messages = $catalogue->all();
while ($catalogue = $catalogue->getFallbackCatalogue()) {
$catalogues[] = $catalogue;
}
$messages = array();
for ($i = count($catalogues) - 1; $i >= 0; $i--) {
$localeMessages = $catalogues[$i]->all();
$messages = array_replace_recursive($messages, $localeMessages);
$messages = array_replace_recursive($catalogue->all(), $messages);
}
return $messages;