From afc39ee11f28c133e20c6e331991fff8ac8fa5af Mon Sep 17 00:00:00 2001 From: Berny Cantos Date: Sat, 2 May 2015 20:46:11 +0200 Subject: [PATCH 1/4] add more entropy to generated classnames - use proxy destination filename to create and md5 salt - apply fabbot patch - inline salt generation --- .../ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php | 12 ++++++++++-- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php b/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php index 2865879ec1..bba5055d00 100644 --- a/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php +++ b/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php @@ -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; } } diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 42a3f3b3f6..e021cf2704 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -243,7 +243,7 @@ abstract class Kernel implements KernelInterface, TerminableInterface } /** - * {@inheritDoc} + * {@inheritdoc} * * @throws \RuntimeException if a custom resource is hidden by a resource in a derived bundle */ @@ -683,7 +683,7 @@ abstract class Kernel implements KernelInterface, TerminableInterface $dumper = new PhpDumper($container); if (class_exists('ProxyManager\Configuration')) { - $dumper->setProxyDumper(new ProxyDumper()); + $dumper->setProxyDumper(new ProxyDumper(md5((string) $cache))); } $content = $dumper->dump(array('class' => $class, 'base_class' => $baseClass, 'file' => (string) $cache)); From 89a1903ac669fbc3d0e410c6855578e6dd5af94d Mon Sep 17 00:00:00 2001 From: Wouter J Date: Mon, 4 May 2015 12:21:54 +0200 Subject: [PATCH 2/4] Use HTTPS in README and some other fixes --- README.md | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 42607fbbfa..f07f64d466 100644 --- a/README.md +++ b/README.md @@ -34,34 +34,33 @@ Installation ------------ The best way to install Symfony is to download the Symfony Standard Edition -available at [http://symfony.com/download][1]. +available at . 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 From 583b488ae2fe3bdee846488229571eeecb8c6099 Mon Sep 17 00:00:00 2001 From: Diego Saint Esteben Date: Mon, 4 May 2015 10:28:20 -0300 Subject: [PATCH 3/4] Run tests on hhvm instead of hhvm-nightly --- .travis.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index a949e64237..2039040abb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,10 +12,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 @@ -28,11 +28,11 @@ 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 php -i; fi; + - if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then phpenv config-rm xdebug.ini; fi; + - if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi; + - if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] && [ $(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" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; 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" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; 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; From fafcb64d00700b31e0d1cd6b481f9eedc8e385c4 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 6 May 2015 12:13:27 +0200 Subject: [PATCH 4/4] [Debug 2.3] Fix test for PHP7 --- src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php b/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php index 7f04d4c3d4..40b726b5e8 100644 --- a/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php +++ b/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php @@ -59,9 +59,14 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase $that = $this; $exceptionCheck = function ($exception) use ($that) { $that->assertInstanceOf('Symfony\Component\Debug\Exception\ContextErrorException', $exception); - $that->assertEquals(E_STRICT, $exception->getSeverity()); $that->assertEquals(2, $exception->getLine()); - $that->assertStringStartsWith('Runtime Notice: Declaration of _CompileTimeError::foo() should be compatible with', $exception->getMessage()); + if (PHP_VERSION_ID < 70000) { + $that->assertEquals(E_STRICT, $exception->getSeverity()); + $that->assertStringStartsWith('Runtime Notice: Declaration of _CompileTimeError::foo() should be compatible with', $exception->getMessage()); + } else { + $that->assertEquals(E_WARNING, $exception->getSeverity()); + $that->assertStringStartsWith('Warning: Declaration of _CompileTimeError::foo() should be compatible with', $exception->getMessage()); + } $that->assertArrayHasKey('bar', $exception->getContext()); };