diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000000000..b03e61ef338c1
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,11 @@
+| Q | A
+| ------------- | ---
+| Branch | master for features and deprecations / lowest applicable and maintained version otherwise
+| Bug fix? | yes/no
+| New feature? | yes/no
+| BC breaks? | yes/no
+| Deprecations? | yes/no
+| Tests pass? | yes/no
+| Fixed tickets | comma-separated list of tickets fixed by the PR, if any
+| License | MIT
+| Doc PR | reference to the documentation PR, if any
diff --git a/.travis.yml b/.travis.yml
index 99b2dc0671b9d..6d6101dccaf8d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,6 +2,9 @@ language: php
sudo: false
+git:
+ depth: 1
+
addons:
apt_packages:
- parallel
@@ -31,16 +34,19 @@ cache:
services: mongodb
before_install:
+ # Matrix lines for intermediate PHP versions are skipped for pull requests
- if [[ ! $deps && ! $TRAVIS_PHP_VERSION = ${MIN_PHP%.*} && $TRAVIS_PHP_VERSION != hhvm && $TRAVIS_PULL_REQUEST != false ]]; then deps=skip; fi;
+ # A sigchild-enabled-PHP is used to test the Process component on the lowest PHP matrix line
- if [[ ! $deps && $TRAVIS_PHP_VERSION = ${MIN_PHP%.*} && ! -d php-$MIN_PHP/sapi ]]; then wget http://museum.php.net/php5/php-$MIN_PHP.tar.bz2 -O - | tar -xj; (cd php-$MIN_PHP; ./configure --enable-sigchild --enable-pcntl; make -j2); fi;
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then INI_FILE=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; else INI_FILE=/etc/hhvm/php.ini; fi;
- echo memory_limit = -1 >> $INI_FILE
- echo session.gc_probability = 0 >> $INI_FILE
- if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then echo extension = mongo.so >> $INI_FILE; fi;
- if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then echo extension = memcache.so >> $INI_FILE; fi;
- - if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then (echo yes | pecl install -f apcu-4.0.10 && echo apc.enable_cli = 1 >> $INI_FILE) || echo "Let's continue without apcu extension"; fi;
- - if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then pecl install -f memcached-2.1.0 || echo "Let's continue without memcached extension"; fi;
+ - if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then (echo yes | pecl install -f apcu-4.0.10 && echo apc.enable_cli = 1 >> $INI_FILE); fi;
+ - if [[ $TRAVIS_PHP_VERSION = 7.* ]]; then (echo yes | pecl install -f apcu-5.1.2 && echo apc.enable_cli = 1 >> $INI_FILE); fi;
- if [[ $TRAVIS_PHP_VERSION = 5.* && ! $deps ]]; then (cd src/Symfony/Component/Debug/Resources/ext && phpize && ./configure && make && echo extension = $(pwd)/modules/symfony_debug.so >> $INI_FILE); fi;
+ - if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then pecl install -f memcached-2.1.0; fi;
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo extension = ldap.so >> $INI_FILE; fi;
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-rm xdebug.ini; fi;
- if [[ $TRAVIS_REPO_SLUG = symfony/symfony ]]; then cp .composer-auth.json ~/.composer/auth.json; fi;
@@ -50,9 +56,12 @@ before_install:
install:
- if [[ $deps != skip ]]; then COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n'); fi;
+ # Create local composer packages for each patched components and reference them in composer.json files when cross-testing components
- if [[ $deps != skip && $deps ]]; then php .travis.php $TRAVIS_COMMIT_RANGE $TRAVIS_BRANCH $COMPONENTS; fi;
+ # For the master branch when deps=high, the version before master is checked out and tested with the locally patched components
- if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then SYMFONY_VERSION=$(git ls-remote --heads | grep -o '/[1-9].*' | tail -n 1 | sed s/.//); else SYMFONY_VERSION=$(cat composer.json | grep '^ *"dev-master". *"[1-9]' | grep -o '[0-9.]*'); fi;
- - if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then git fetch origin $SYMFONY_VERSION; git checkout -m FETCH_HEAD; fi;
+ - if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then git fetch origin $SYMFONY_VERSION; git checkout -m FETCH_HEAD; COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n'); fi;
+ # Legacy tests are skipped when deps=high and when the current branch version has not the same major version number than the next one
- if [[ $deps = high && ${SYMFONY_VERSION%.*} != $(git show $(git ls-remote --heads | grep -FA1 /$SYMFONY_VERSION | tail -n 1):composer.json | grep '^ *"dev-master". *"[1-9]' | grep -o '[0-9]*' | head -n 1) ]]; then LEGACY=,legacy; fi;
- export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev;
- if [[ ! $deps ]]; then composer update --prefer-dist; else export SYMFONY_DEPRECATIONS_HELPER=weak; fi;
diff --git a/CHANGELOG-2.3.md b/CHANGELOG-2.3.md
index f520c60219662..c8daee4e9253b 100644
--- a/CHANGELOG-2.3.md
+++ b/CHANGELOG-2.3.md
@@ -7,6 +7,21 @@ 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.37 (2016-01-14)
+
+ * security #17359 do not ship with a custom rng implementation (xabbuh, fabpot)
+ * bug #17326 [Console] Display console application name even when no version set (polc)
+ * bug #17140 [Serializer] Remove normalizer cache in Serializer class (jvasseur)
+ * bug #17307 [FrameworkBundle] Fix paths with % in it (like urlencoded) (scaytrase)
+ * bug #17078 [Bridge] [Doctrine] [Validator] Added support \IteratorAggregate for UniqueEntityValidator (Disparity)
+ * bug #17287 [HttpKernel] Forcing string comparison on query parameters sort in UriSigner (Tim van Densen)
+ * bug #17278 [FrameworkBundle] Add case in Kernel directory guess for PHPUnit (tgalopin)
+ * bug #17276 [Process] Fix potential race condition (nicolas-grekas)
+ * bug #17183 [FrameworkBundle] Set the kernel.name properly after a cache warmup (jakzal)
+ * bug #17159 [Yaml] recognize when a block scalar is left (xabbuh)
+ * bug #17195 bug #14246 [Filesystem] dumpFile() non atomic (Hidde Boomsma)
+ * bug #17177 [Process] Fix potential race condition leading to transient tests (nicolas-grekas)
+
* 2.3.36 (2015-12-26)
* bug #16864 [Yaml] fix indented line handling in folded blocks (xabbuh)
@@ -14,7 +29,7 @@ To get the diff between two versions, go to https://github.com/symfony/symfony/c
* bug #17129 [Config] Fix array sort on normalization in edge case (romainneutron)
* bug #17094 [Process] More robustness and deterministic tests (nicolas-grekas)
* bug #17112 [PropertyAccess] Reorder elements array after PropertyPathBuilder::replace (alekitto)
- * bug #16797 [Filesystem] Recursivly widen non-executable directories (Slamdunk)
+ * bug #16797 [Filesystem] Recursively widen non-executable directories (Slamdunk)
* bug #17040 [Console] Avoid extra blank lines when rendering exceptions (ogizanagi)
* bug #17055 [Security] Verify if a password encoded with bcrypt is no longer than 72 characters (jakzal)
* bug #16959 [Form] fix #15544 when a collection type attribute "required" is false, "prototype" should too (HeahDude)
diff --git a/CHANGELOG-2.7.md b/CHANGELOG-2.7.md
index 0055a236352aa..c172caf540de5 100644
--- a/CHANGELOG-2.7.md
+++ b/CHANGELOG-2.7.md
@@ -7,6 +7,30 @@ in 2.7 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.7.0...v2.7.1
+* 2.7.9 (2016-01-14)
+
+ * security #17359 do not ship with a custom rng implementation (xabbuh, fabpot)
+ * bug #17314 Fix max width for multibyte keys in choice question (mheki)
+ * bug #17326 [Console] Display console application name even when no version set (polc)
+ * bug #17328 [Serializer] Allow to use proxies in object_to_populate (dunglas)
+ * bug #17347 Workaround https://bugs.php.net/63206 (nicolas-grekas)
+ * bug #17140 [Serializer] Remove normalizer cache in Serializer class (jvasseur)
+ * bug #17307 [FrameworkBundle] Fix paths with % in it (like urlencoded) (scaytrase)
+ * bug #17078 [Bridge] [Doctrine] [Validator] Added support \IteratorAggregate for UniqueEntityValidator (Disparity)
+ * bug #17298 [FrameworkBundle] Use proper class to fetch $versionStrategy property (dosten)
+ * bug #17287 [HttpKernel] Forcing string comparison on query parameters sort in UriSigner (Tim van Densen)
+ * bug #17279 [FrameworkBundle] Add case in Kernel directory guess for PHPUnit (tgalopin)
+ * bug #17278 [FrameworkBundle] Add case in Kernel directory guess for PHPUnit (tgalopin)
+ * bug #17275 [PhpUnitBridge] Re-enable the garbage collector (nicolas-grekas)
+ * bug #17276 [Process] Fix potential race condition (nicolas-grekas)
+ * bug #17183 [FrameworkBundle] Set the kernel.name properly after a cache warmup (jakzal)
+ * bug #17159 [Yaml] recognize when a block scalar is left (xabbuh)
+ * bug #17195 bug #14246 [Filesystem] dumpFile() non atomic (Hidde Boomsma)
+ * feature #16747 [Form] Improved performance of ChoiceType and its subtypes (webmozart)
+ * bug #17177 [Process] Fix potential race condition leading to transient tests (nicolas-grekas)
+ * bug #17163 [Form] fix Catchable Fatal Error if choices is not an array (Gladhon, nicolas-grekas)
+ * bug #17119 [Form] improve deprecation message for "empty_value" and "choice_list" options. (hhamon)
+
* 2.7.8 (2015-12-26)
* bug #16864 [Yaml] fix indented line handling in folded blocks (xabbuh)
@@ -16,7 +40,7 @@ To get the diff between two versions, go to https://github.com/symfony/symfony/c
* bug #17129 [Config] Fix array sort on normalization in edge case (romainneutron)
* bug #17094 [Process] More robustness and deterministic tests (nicolas-grekas)
* bug #17112 [PropertyAccess] Reorder elements array after PropertyPathBuilder::replace (alekitto)
- * bug #16797 [Filesystem] Recursivly widen non-executable directories (Slamdunk)
+ * bug #16797 [Filesystem] Recursively widen non-executable directories (Slamdunk)
* bug #17040 [Console] Avoid extra blank lines when rendering exceptions (ogizanagi)
* bug #17055 [Security] Verify if a password encoded with bcrypt is no longer than 72 characters (jakzal)
* bug #16959 [Form] fix #15544 when a collection type attribute "required" is false, "prototype" should too (HeahDude)
diff --git a/CHANGELOG-2.8.md b/CHANGELOG-2.8.md
index 3154c3ed85eae..38abdc97b27f1 100644
--- a/CHANGELOG-2.8.md
+++ b/CHANGELOG-2.8.md
@@ -7,6 +7,99 @@ in 2.8 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.8.0...v2.8.1
+* 2.8.3 (2016-02-28)
+
+ * bug #17947 Fix - #17676 (backport #17919 to 2.3) (Ocramius)
+ * bug #17942 Fix bug when using an private aliased factory service (WouterJ)
+ * bug #17798 [Form] Fix BC break by allowing 'choice_label' option to be 'false' in ChoiceType (HeahDude)
+ * bug #17542 ChoiceFormField of type "select" could be "disabled" (bouland)
+ * bug #17602 [HttpFoundation] Fix BinaryFileResponse incorrect behavior with if-range header (bburnichon)
+ * bug #17760 [Form] fix choice value "false" in ChoiceType (HeahDude)
+ * bug #17914 [Console] Fix escaping of trailing backslashes (nicolas-grekas)
+ * bug #17074 Fix constraint validator alias being required (Triiistan)
+ * bug #17866 [DependencyInjection] replace alias in factories (xabbuh)
+ * bug #17867 [DependencyInjection] replace alias in factory services (xabbuh)
+ * bug #17860 Fixed the antialiasing of the toolbar text (javiereguiluz)
+ * bug #17569 [FrameworkBundle] read commands from bundles when accessing list (havvg)
+ * bug #16987 [FileSystem] Windows fix (flip111)
+ * bug #17787 [Form] Fix choice placeholder edge cases (Tobion)
+ * bug #17835 [Yaml] fix default timezone to be UTC (xabbuh)
+ * bug #17823 [DependencyInjection] fix dumped YAML string (xabbuh)
+ * bug #17818 [Console] InvalidArgumentException is thrown under wrong condition (robinkanters)
+ * bug #17819 [HttpKernel] Prevent a fatal error when DebugHandlersListener is used with a kernel with no terminateWithException() method (jakzal)
+ * bug #17814 [DependencyInjection] fix dumped YAML snytax (xabbuh)
+ * bug #17099 [Form] Fixed violation mapping if multiple forms are using the same (or part of the same) property path (alekitto)
+ * bug #17694 [DoctrineBridge] [Form] fix choice_value in EntityType (HeahDude)
+ * bug #17790 [Config] Fix EnumNodeDefinition to allow building enum nodes with one element (ogizanagi)
+ * bug #17729 [Yaml] properly parse lists in object maps (xabbuh)
+ * bug #17719 [DependencyInjection] fixed exceptions thrown by get method of ContainerBuilder (lukaszmakuch)
+ * bug #17742 [DependencyInjection] Fix #16461 Container::set() replace aliases (mnapoli)
+ * bug #17745 Added more exceptions to singularify method (javiereguiluz)
+ * bug #17691 Fixed (string) catchable fatal error for PHP Incomplete Class instances (yceruto)
+ * bug #17766 Fixed (string) catchable fatal error for PHP Incomplete Class instances (yceruto)
+ * bug #17757 [HttpFoundation] BinaryFileResponse sendContent return as parent. (2.3) (SpacePossum)
+ * bug #17748 [DomCrawler] Remove the overridden getHash() method to prevent problems when cloning the crawler (jakzal)
+ * bug #17725 [WebProfilerBundle] Add width attribute on SVG - Fix toolbar profiler on microsoft edge (AlexandrePavy)
+ * bug #17703 [FrameworkBundle] Support autowiring for TranslationInterface (dunglas)
+ * bug #17613 [WebProfiler] Fixed logo and menu profiler for Microsoft Edge (WhiteEagle88)
+ * bug #17702 [TwigBridge] forward compatibility with Yaml 3.1 (xabbuh)
+ * bug #17673 [Routing] add files used in FileResource objects (xabbuh)
+ * bug #17672 [DependencyInjection][Routing] add files used in FileResource objects (xabbuh)
+ * bug #17669 [Console] remove readline support (xabbuh)
+ * bug #17600 Fixed the Bootstrap form theme for inlined checkbox/radio (javiereguiluz)
+ * bug #17596 [Translation] Add resources from fallback locale to parent catalogue (c960657)
+ * bug #17605 [FrameworkBundle] remove default null value for asset version (xabbuh)
+ * bug #17606 [DependencyInjection] pass triggerDeprecationError arg to parent class (xabbuh)
+ * bug #16956 [DependencyInjection] XmlFileLoader: enforce tags to have a name (xabbuh)
+ * bug #16265 [BrowserKit] Corrected HTTP_HOST logic (Naktibalda)
+ * bug #17559 [SecurityBundle] Fix HTTP Digest auth not being passed user checker (SamFleming)
+ * bug #17554 [DependencyInjection] resolve aliases in factories (xabbuh)
+ * bug #17555 [DependencyInjection] resolve aliases in factory services (xabbuh)
+ * bug #17511 [Form] ArrayChoiceList can now deal with a null in choices (issei-m)
+ * bug #17430 [Serializer] Ensure that groups are strings (dunglas)
+ * bug #15272 [FrameworkBundle] Fix template location for PHP templates (jakzal)
+ * bug #11232 [Routing] Fixes fatal errors with object resources in AnnotationDirectoryLoader::supports (Tischoi)
+ * bug #17526 Escape the delimiter in Glob::toRegex (javiereguiluz)
+ * bug #17527 fixed undefined variable (fabpot)
+ * bug #15706 [framework-bundle] Added support for the `0.0.0.0/0` trusted proxy (zerkms)
+ * bug #16274 [HttpKernel] Lookup the response even if the lock was released after two second wait (jakzal)
+ * bug #16954 [TranslationUpdateCommand] fixed undefined resultMessage var. (aitboudad)
+ * bug #17355 [DoctrineBridge][Validator] >= 2.3 Pass association instead of ID as argument (xavismeh)
+ * bug #17330 Limit the max height/width of icons in the profiler menu (javiereguiluz)
+ * bug #17454 Allow absolute URLs to be displayed in the debug toolbar (javiereguiluz)
+ * bug #16736 [Request] Ignore invalid IP addresses sent by proxies (GromNaN)
+ * bug #17459 [EventDispatcher] TraceableEventDispatcher resets event listener priorities (c960657)
+ * bug #17486 [FrameworkBundle] Throw for missing container extensions (kix)
+ * bug #16961 Overriding profiler position in CSS breaks JS positioning (aschempp)
+ * bug #16873 Able to load big xml files with DomCrawler (zorn-v)
+ * bug #16897 [Form] Fix constraints could be null if not set (DZunke)
+ * bug #16912 [Translation][Writer] avoid calling setBackup if the dumper is not FileDumper (aitboudad)
+ * bug #17505 sort bundles in config:dump-reference command (xabbuh)
+ * bug #17514 [Asset] Add defaultNull to version configuration (ewgRa)
+ * bug #16511 [Asset] Ability to set empty version strategy in packages (ewgRa)
+ * bug #17457 Display Ajax requests from newest to oldest in the toolbar (javiereguiluz)
+ * bug #17503 [Asset] CLI: use request context to generate absolute URLs (xabbuh)
+ * bug #17478 [HttpFoundation] Do not overwrite the Authorization header if it is already set (jakzal)
+ * bug #17461 [Yaml] tag for dumped PHP objects must be a local one (xabbuh)
+ * bug #16822 [FrameworkBundle][Validator] Fix apc cache service deprecation (ogizanagi)
+ * bug #17463 [Form] make tests compatible with Symfony 2.8 and 3.0 (xabbuh)
+ * bug #17456 [DX] Remove default match from AbstractConfigCommand::findExtension (kix)
+ * bug #17424 [Process] Update in 2.7 for stream-based output storage (romainneutron)
+ * bug #17417 Fixed the form profiler when using long form types (javiereguiluz)
+ * bug #17423 [Process] Use stream based storage to avoid memory issues (romainneutron)
+ * bug #17406 [Form] ChoiceType: Fix a notice when 'choices' normalizer is replaced (paradajozsef)
+ * bug #17433 [FrameworkBundle] Don't log twice with the error handler (nicolas-grekas)
+ * bug #17418 Fixed Bootstrap form theme form "reset" buttons (javiereguiluz)
+ * bug #17416 [PropertyInfo] PhpDocExtractor: Fix a notice when the property doesn'… (dunglas)
+ * bug #17404 fix merge 2.3 into 2.7 for SecureRandom dependency (Tobion)
+ * bug #17373 [SecurityBundle] fix SecureRandom service constructor args (Tobion)
+ * bug #17382 [TwigBridge] Use label_format option for checkbox and radio labels (enumag)
+ * bug #17380 [TwigBridge] Use label_format option for checkbox and radio labels (enumag)
+ * bug #17377 Fix performance (PHP5) and memory (PHP7) issues when using token_get_all (nicolas-grekas, peteward)
+ * bug #17389 [Routing] Fixed correct class name in thrown exception (fixes #17388) (robinvdvleuten)
+ * bug #17358 [ClassLoader] Use symfony/polyfill-apcu (nicolas-grekas)
+ * bug #17370 [HttpFoundation][Cookie] Cookie DateTimeInterface fix (wildewouter)
+
* 2.8.2 (2016-01-14)
* security #17359 do not ship with a custom rng implementation (xabbuh, fabpot)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 123d5aa755911..ae18925cb6e20 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -5,29 +5,20 @@ Symfony is an open source, community-driven project.
If you'd like to contribute, please read the following documents:
-* [Contributing Code][1]: The document index related to contributions;
-
-* [Submitting a Patch][2]: Guidelines for submitting a pull request;
-
-* [Pull Request Template][3]: Template header to use in your pull request
- description;
-
-```markdown
-| Q | A
-| ------------- | ---
-| Bug fix? | yes/no
-| New feature? | yes/no
-| BC breaks? | no
-| Deprecations? | no
-| Tests pass? | yes
-| Fixed tickets | #1234
-| License | MIT
-| Doc PR | symfony/symfony-docs#1234
-```
-
-* [Backwards Compatibility][4]: Backward compatibility rules.
-
-[1]: https://symfony.com/doc/current/contributing/code/index.html
-[2]: https://symfony.com/doc/current/contributing/code/patches.html#check-list
-[3]: https://symfony.com/doc/current/contributing/code/patches.html#make-a-pull-request
-[4]: https://symfony.com/doc/current/contributing/code/bc.html#working-on-symfony-code
+* [Reporting a Bug][1]
+* [Submitting a Patch][2]
+* [Symfony Core Team][3]
+* [Security Issues][4]
+* [Running Symfony Tests][5]
+* [Our Backwards Compatibility Promise][6]
+* [Coding Standards][7]
+* [Conventions][8]
+
+[1]: https://symfony.com/doc/current/contributing/code/bugs.html
+[2]: https://symfony.com/doc/current/contributing/code/patches.html
+[3]: https://symfony.com/doc/current/contributing/code/core_team.html
+[4]: https://symfony.com/doc/current/contributing/code/security.html
+[5]: https://symfony.com/doc/current/contributing/code/tests.html
+[6]: https://symfony.com/doc/current/contributing/code/bc.html
+[7]: https://symfony.com/doc/current/contributing/code/standards.html
+[8]: https://symfony.com/doc/current/contributing/code/conventions.html
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index e131844910157..5786f19dde7d6 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -75,45 +75,45 @@ Symfony is the result of the work of many people who made the code better
- Arnaud Le Blanc (arnaud-lb)
- Tim Nagel (merk)
- Brice BERNARD (brikou)
+ - Graham Campbell (graham)
- Jérôme Tamarelle (gromnan)
- marc.weistroff
+ - Michal Piotrowski (eventhorizon)
- lenar
- - Graham Campbell (graham)
- Włodzimierz Gajda (gajdaw)
- - Michal Piotrowski (eventhorizon)
- Florian Voutzinos (florianv)
- Peter Rehm (rpet)
- Colin Frei
+ - Dariusz Ruminski
- Adrien Brault (adrienbrault)
- excelwebzone
- Jacob Dreesen (jdreesen)
- - Dariusz Ruminski
- Peter Kokot (maastermedia)
- Fabien Pennequin (fabienpennequin)
- Pierre du Plessis (pierredup)
- Alexander Schwenn (xelaris)
- Gordon Franke (gimler)
+ - Iltar van der Berg (kjarli)
- Robert Schönthal (digitalkaoz)
- Jérémy DERUSSÉ (jderusse)
- Joshua Thijssen
- Stefano Sala (stefano.sala)
- David Buchmann (dbu)
- Issei Murasawa (issei_m)
- - Iltar van der Berg (kjarli)
- Juti Noppornpitak (shiroyuki)
- Eric GELOEN (gelo)
- Sebastian Hörl (blogsh)
- Daniel Gomes (danielcsgomes)
- Hidenori Goto (hidenorigoto)
+ - Vladimir Reznichenko (kalessil)
- Guilherme Blanco (guilhermeblanco)
- Pablo Godel (pgodel)
- - Vladimir Reznichenko (kalessil)
+ - Tigran Azatyan (tigranazatyan)
- Jérémie Augustin (jaugustin)
- Sebastiaan Stok (sstok)
- Rafael Dohms (rdohms)
- Arnaud Kleinpeter (nanocom)
- Alexander M. Turek (derrabus)
- - Tigran Azatyan (tigranazatyan)
- Richard Shank (iampersistent)
- Charles Sarrazin (csarrazi)
- Clemens Tolboom
@@ -149,6 +149,7 @@ Symfony is the result of the work of many people who made the code better
- sun (sun)
- Larry Garfield (crell)
- Martin Schuhfuß (usefulthink)
+ - Jáchym Toušek
- Matthieu Bontemps (mbontemps)
- Pierre Minnieur (pminnieur)
- fivestar
@@ -166,7 +167,6 @@ Symfony is the result of the work of many people who made the code better
- Rui Marinho (ruimarinho)
- Julien Brochet (mewt)
- Sergey Linnik (linniksa)
- - Jáchym Toušek
- Marcel Beerta (mazen)
- Vincent AUBERT (vincent)
- julien pauli (jpauli)
@@ -177,6 +177,7 @@ Symfony is the result of the work of many people who made the code better
- Elnur Abdurrakhimov (elnur)
- Manuel Reinhard (sprain)
- Danny Berger (dpb587)
+ - Diego Saint Esteben (dosten)
- Roman Marintšenko (inori)
- Xavier Montaña Carreras (xmontana)
- Chris Wilkinson (thewilkybarkid)
@@ -207,7 +208,6 @@ Symfony is the result of the work of many people who made the code better
- Ruben Gonzalez (rubenrua)
- Marcos Sánchez
- Kim Hemsø Rasmussen (kimhemsoe)
- - Diego Saint Esteben (dosten)
- Tom Van Looy (tvlooy)
- Wouter Van Hecke
- Peter Kruithof (pkruithof)
@@ -237,6 +237,7 @@ Symfony is the result of the work of many people who made the code better
- Jan Decavele (jandc)
- Gustavo Piltcher
- Stepan Tanasiychuk (stfalcon)
+ - Titouan Galopin (tgalopin)
- Tiago Ribeiro (fixe)
- Bob den Otter (bopp)
- Adrian Rudnik (kreischweide)
@@ -321,6 +322,7 @@ Symfony is the result of the work of many people who made the code better
- Jan Schumann
- Niklas Fiekas
- Mark Challoner (markchalloner)
+ - Gregor Harlan (gharlan)
- Markus Bachmann (baachi)
- lancergr
- Olivier Dolbeau (odolbeau)
@@ -337,6 +339,7 @@ Symfony is the result of the work of many people who made the code better
- cedric lombardot (cedriclombardot)
- Jonas Flodén (flojon)
- Christian Schmidt
+ - Jakub Kucharovic (jkucharovic)
- Marcin Sikoń (marphi)
- Dominik Zogg (dominik.zogg)
- Mathieu Lemoine
@@ -396,7 +399,6 @@ Symfony is the result of the work of many people who made the code better
- MatTheCat
- John Bafford (jbafford)
- Denis Gorbachev (starfall)
- - Titouan Galopin (tgalopin)
- Steven Surowiec
- Kevin Saliou (kbsali)
- Ryan
@@ -440,7 +442,6 @@ Symfony is the result of the work of many people who made the code better
- Wang Jingyu
- Åsmund Garfors
- Maxime Douailin
- - Gregor Harlan
- Michael Hirschler (mvhirsch)
- Javier López (loalf)
- Reinier Kip
@@ -457,7 +458,6 @@ Symfony is the result of the work of many people who made the code better
- Tristan Maindron (tmaindron)
- Ke WANG (yktd26)
- Strate
- - Jakub Kucharovic
- Miquel Rodríguez Telep (mrtorrent)
- Sergey Kolodyazhnyy (skolodyazhnyy)
- umpirski
@@ -507,6 +507,7 @@ Symfony is the result of the work of many people who made the code better
- Joshua Nye
- Dave Marshall (davedevelopment)
- avorobiev
+ - Gladhon
- Venu
- Lars Vierbergen
- Dennis Hotson
@@ -572,6 +573,7 @@ Symfony is the result of the work of many people who made the code better
- Aleksey Podskrebyshev
- Steffen Roßkamp
- David Marín Carreño (davefx)
+ - Hidde Boomsma (hboomsma)
- Jörn Lang (j.lang)
- mwsaz
- Benoît Bourgeois
@@ -615,6 +617,7 @@ Symfony is the result of the work of many people who made the code better
- Benoît Merlet (trompette)
- Koen Kuipers
- datibbaw
+ - Sébastien Santoro
- Raul Fraile (raulfraile)
- sensio
- Patrick Kaufmann
@@ -686,6 +689,7 @@ Symfony is the result of the work of many people who made the code better
- Max Beutel
- Michal Trojanowski
- Catalin Dan
+ - Mihai Stancu
- nacho
- Piotr Antosik (antek88)
- Artem Lopata
@@ -698,6 +702,7 @@ Symfony is the result of the work of many people who made the code better
- Max Grigorian (maxakawizard)
- benatespina (benatespina)
- Denis Kop
+ - EdgarPE
- jfcixmedia
- Martijn Evers
- Benjamin Paap (benjaminpaap)
@@ -980,6 +985,7 @@ Symfony is the result of the work of many people who made the code better
- Michal Gebauer
- Gleb Sidora
- David Stone
+ - Adrien Lucas (adrienlucas)
- Pablo Maria Martelletti (pmartelletti)
- Yassine Guedidi (yguedidi)
- Luis Muñoz
@@ -1056,6 +1062,7 @@ Symfony is the result of the work of many people who made the code better
- devel
- Trevor Suarez
- gedrox
+ - Mathieu MARCHOIS
- dropfen
- Andrey Chernykh
- Edvinas Klovas
@@ -1179,7 +1186,6 @@ Symfony is the result of the work of many people who made the code better
- srsbiz
- Taylan Kasap
- Nicolas A. Bérard-Nault
- - Gladhon
- Saem Ghani
- Stefan Oderbolz
- Curtis
@@ -1233,6 +1239,7 @@ Symfony is the result of the work of many people who made the code better
- Eric J. Duran
- cmfcmf
- Drew Butler
+ - pawel-lewtak
- Steve Müller
- Andras Ratz
- andreabreu98
@@ -1260,7 +1267,6 @@ Symfony is the result of the work of many people who made the code better
- Pierre-Louis LAUNAY
- djama
- Eduardo Conceição
- - Sébastien Santoro
- Jon Cave
- Sébastien HOUZE
- Abdulkadir N. A.
diff --git a/UPGRADE-2.7.md b/UPGRADE-2.7.md
index f52220fadc2ed..5de67ebede36c 100644
--- a/UPGRADE-2.7.md
+++ b/UPGRADE-2.7.md
@@ -596,11 +596,11 @@ TwigBundle
FrameworkBundle
---------------
- * The `templating.helper.assets` was refactored and returns now an object of the type
+ * The `templating.helper.assets` service was refactored and now returns an object of type
`Symfony\Bundle\FrameworkBundle\Templating\Helper\AssetsHelper` instead of
`Symfony\Component\Templating\Helper\CoreAssetsHelper`. You can update your class definition
or use the `assets.packages` service instead. Using the `assets.packages` service is the recommended
- way. The `templating.helper.assets` service will be removed in Symfony 3.0.
+ way.
Before:
diff --git a/UPGRADE-2.8.md b/UPGRADE-2.8.md
index 7acc2baa347b6..18ea4dbc8d217 100644
--- a/UPGRADE-2.8.md
+++ b/UPGRADE-2.8.md
@@ -18,6 +18,12 @@ All components
Form
----
+ * The `intention` option was deprecated and will be removed in 3.0 in favor
+ of the new `csrf_token_id` option.
+
+ * The `csrf_provider` option was deprecated and will be removed in 3.0 in favor
+ of the new `csrf_token_manager` option.
+
* 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,
@@ -203,7 +209,7 @@ Form
* In Symfony 2.7 a small BC break was introduced with the new choices_as_values
option. In order to have the choice values populated to the html value attribute
you had to define the choice_value option. This is now not any more needed.
-
+
Before:
```php
@@ -221,9 +227,9 @@ Form
},
));
```
-
+
After (Symfony 2.8+):
-
+
```php
$form->add('status', ChoiceType::class, array(
'choices' => array(
@@ -262,13 +268,13 @@ Form
}
}
```
-
+
* The option "options" of the CollectionType has been renamed to "entry_options".
The usage of the option "options" is deprecated and will be removed in Symfony 3.0.
* The option "type" of the CollectionType has been renamed to "entry_type".
The usage of the option "type" is deprecated and will be removed in Symfony 3.0.
- As a value for the option you should provide the fully-qualified class name (FQCN)
+ As a value for the option you should provide the fully-qualified class name (FQCN)
now as well.
* Passing type instances to `Form::add()`, `FormBuilder::add()` and the
@@ -409,8 +415,8 @@ DependencyInjection
```
- * `Symfony\Component\DependencyInjection\ContainerAware` has been deprecated, use
- `Symfony\Component\DependencyInjection\ContainerAwareTrait` or implement
+ * `Symfony\Component\DependencyInjection\ContainerAware` has been deprecated, use
+ `Symfony\Component\DependencyInjection\ContainerAwareTrait` or implement
`Symfony\Component\DependencyInjection\ContainerAwareInterface` manually
WebProfiler
@@ -506,6 +512,28 @@ FrameworkBundle
cookie_httponly: false
```
+ * The `validator.mapping.cache.apc` service is deprecated, and will be removed in 3.0.
+ Use `validator.mapping.cache.doctrine.apc` instead.
+
+ * The ability to pass `apc` as the `framework.validation.cache` configuration key value is deprecated,
+ and will be removed in 3.0. Use `validator.mapping.cache.doctrine.apc` instead:
+
+ Before:
+
+ ```yaml
+ framework:
+ validation:
+ cache: apc
+ ```
+
+ After:
+
+ ```yaml
+ framework:
+ validation:
+ cache: validator.mapping.cache.doctrine.apc
+ ```
+
Security
--------
@@ -522,12 +550,18 @@ Security
* The `intention` option is deprecated for all the authentication listeners,
and will be removed in 3.0. Use the `csrf_token_id` option instead.
+ * The `csrf_provider` option is deprecated for all the authentication listeners,
+ and will be removed in 3.0. Use the `csrf_token_generator` option instead.
+
SecurityBundle
--------------
* The `intention` firewall listener setting is deprecated, and will be removed in 3.0.
Use the `csrf_token_id` option instead.
+ * The `csrf_provider` firewall listener setting is deprecated, and will be removed in 3.0.
+ Use the `csrf_token_generator` option instead.
+
Config
------
diff --git a/UPGRADE-3.0.md b/UPGRADE-3.0.md
index a5f1f86c00419..6f77e27cc6c2e 100644
--- a/UPGRADE-3.0.md
+++ b/UPGRADE-3.0.md
@@ -20,6 +20,16 @@ UPGRADE FROM 2.x to 3.0
`DebugClassLoader`. The difference is that the constructor now takes a
loader to wrap.
+### Config
+
+ * `\Symfony\Component\Config\Resource\ResourceInterface::isFresh()` has been removed. Also,
+ cache validation through this method (which was still supported in 2.8 for BC) does no longer
+ work because the `\Symfony\Component\Config\Resource\BCResourceInterfaceChecker` helper class
+ has been removed as well.
+
+ * The `__toString()` method of the `\Symfony\Component\Config\ConfigCache` class
+ was removed in favor of the new `getPath()` method.
+
### Console
* The `dialog` helper has been removed in favor of the `question` helper.
@@ -90,6 +100,79 @@ UPGRADE FROM 2.x to 3.0
### DependencyInjection
+ * The concept of scopes was removed, the removed 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 removed.
+
+ * 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
+
+
+
+ ```
+
+ * `Symfony\Component\DependencyInjection\ContainerAware` was removed, use
+ `Symfony\Component\DependencyInjection\ContainerAwareTrait` or implement
+ `Symfony\Component\DependencyInjection\ContainerAwareInterface` manually
+
* The methods `Definition::setFactoryClass()`,
`Definition::setFactoryMethod()`, and `Definition::setFactoryService()` have
been removed in favor of `Definition::setFactory()`. Services defined using
@@ -99,6 +182,26 @@ UPGRADE FROM 2.x to 3.0
removed: `ContainerBuilder::synchronize()`, `Definition::isSynchronized()`,
and `Definition::setSynchronized()`.
+### DoctrineBridge
+
+ * The `property` option of `DoctrineType` was removed in favor of the `choice_label` option.
+
+ * The `loader` option of `DoctrineType` was removed. You now have to override the `getLoader()`
+ method in your custom type.
+
+ * The `Symfony\Bridge\Doctrine\Form\ChoiceList\EntityChoiceList` was removed in favor
+ of `Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader`.
+
+ * Passing a query builder closure to `ORMQueryBuilderLoader` is not supported anymore.
+ You should pass resolved query builders only.
+
+ Consequently, the arguments `$manager` and `$class` of `ORMQueryBuilderLoader`
+ have been removed as well.
+
+ Note that the `query_builder` option of `DoctrineType` *does* support
+ closures, but the closure is now resolved in the type instead of in the
+ loader.
+
### EventDispatcher
* The interface `Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcherInterface`
@@ -106,12 +209,175 @@ UPGRADE FROM 2.x to 3.0
### Form
+ * The option `options` of the `CollectionType` has been removed in favor
+ of the `entry_options` option.
+
+ * The `cascade_validation` option was removed. Use the `constraints` option
+ together with the `Valid` constraint instead.
+
+ * Type names were removed. Instead of referencing types by name, you must
+ reference them by their fully-qualified class name (FQCN) instead:
+
+ Before:
+
+ ```php
+ $form = $this->createFormBuilder()
+ ->add('name', 'text')
+ ->add('age', 'integer')
+ ->getForm();
+ ```
+
+ After:
+
+ ```php
+ use Symfony\Component\Form\Extension\Core\Type\IntegerType;
+ use Symfony\Component\Form\Extension\Core\Type\TextType;
+
+ $form = $this->createFormBuilder()
+ ->add('name', TextType::class)
+ ->add('age', IntegerType::class)
+ ->getForm();
+ ```
+
+ If you want to customize the block prefix of a type in Twig, you must now
+ implement `FormTypeInterface::getBlockPrefix()`:
+
+ Before:
+
+ ```php
+ class UserProfileType extends AbstractType
+ {
+ public function getName()
+ {
+ return 'profile';
+ }
+ }
+ ```
+
+ After:
+
+ ```php
+ class UserProfileType extends AbstractType
+ {
+ public function getBlockPrefix()
+ {
+ return 'profile';
+ }
+ }
+ ```
+
+ If you don't customize `getBlockPrefix()`, it defaults to the class name
+ without "Type" suffix in underscore notation (here: "user_profile").
+
+ Type extension must return the fully-qualified class name of the extended
+ type from `FormTypeExtensionInterface::getExtendedType()` now.
+
+ Before:
+
+ ```php
+ class MyTypeExtension extends AbstractTypeExtension
+ {
+ public function getExtendedType()
+ {
+ return 'form';
+ }
+ }
+ ```
+
+ After:
+
+ ```php
+ use Symfony\Component\Form\Extension\Core\Type\FormType;
+
+ class MyTypeExtension extends AbstractTypeExtension
+ {
+ public function getExtendedType()
+ {
+ return FormType::class;
+ }
+ }
+ ```
+
+ * The `FormTypeInterface::getName()` method was removed.
+
+ * Returning type instances from `FormTypeInterface::getParent()` is not
+ supported anymore. Return the fully-qualified class name of the parent
+ type class instead.
+
+ Before:
+
+ ```php
+ class MyType
+ {
+ public function getParent()
+ {
+ return new ParentType();
+ }
+ }
+ ```
+
+ After:
+
+ ```php
+ class MyType
+ {
+ public function getParent()
+ {
+ return ParentType::class;
+ }
+ }
+ ```
+
+ * The option `type` of the `CollectionType` has been removed in favor of
+ the `entry_type` option. The value for the `entry_type` option must be
+ the fully-qualified class name (FQCN).
+
+ * Passing type instances to `Form::add()`, `FormBuilder::add()` and the
+ `FormFactory::create*()` methods is not supported anymore. Pass the
+ fully-qualified class name of the type instead.
+
+ Before:
+
+ ```php
+ $form = $this->createForm(new MyType());
+ ```
+
+ After:
+
+ ```php
+ $form = $this->createForm(MyType::class);
+ ```
+
+ * The alias option of the `form.type_extension` tag was removed in favor of
+ the `extended_type`/`extended-type` option.
+
+ Before:
+ ```xml
+
+
+
+ ```
+
+ After:
+ ```xml
+
+
+
+ ```
+
+ * The `ChoiceToBooleanArrayTransformer`, `ChoicesToBooleanArrayTransformer`,
+ `FixRadioInputListener`, and `FixCheckboxInputListener` classes were removed.
+
+ * The `choice_list` option of `ChoiceType` was removed.
+
* The option "precision" was renamed to "scale".
Before:
```php
- $builder->add('length', 'number', array(
+ use Symfony\Component\Form\Extension\Core\Type\NumberType;
+
+ $builder->add('length', NumberType::class, array(
'precision' => 3,
));
```
@@ -119,7 +385,9 @@ UPGRADE FROM 2.x to 3.0
After:
```php
- $builder->add('length', 'number', array(
+ use Symfony\Component\Form\Extension\Core\Type\NumberType;
+
+ $builder->add('length', NumberType::class, array(
'scale' => 3,
));
```
@@ -129,7 +397,9 @@ UPGRADE FROM 2.x to 3.0
Before:
```php
- $builder->add('address', 'form', array(
+ use Symfony\Component\Form\Extension\Core\Type\FormType;
+
+ $builder->add('address', FormType::class, array(
'virtual' => true,
));
```
@@ -137,7 +407,9 @@ UPGRADE FROM 2.x to 3.0
After:
```php
- $builder->add('address', 'form', array(
+ use Symfony\Component\Form\Extension\Core\Type\FormType;
+
+ $builder->add('address', FormType::class, array(
'inherit_data' => true,
));
```
@@ -264,12 +536,12 @@ UPGRADE FROM 2.x to 3.0
// ...
}
```
-
+
* The option "options" of the CollectionType has been renamed to "entry_options".
* The option "type" of the CollectionType has been renamed to "entry_type".
- As a value for the option you must provide the fully-qualified class name (FQCN)
- now as well.
+ As a value for the option you must provide the fully-qualified class name (FQCN)
+ now as well.
* The `FormIntegrationTestCase` and `FormPerformanceTestCase` classes were moved form the `Symfony\Component\Form\Tests` namespace to the `Symfony\Component\Form\Test` namespace.
@@ -277,11 +549,11 @@ UPGRADE FROM 2.x to 3.0
`NumberToLocalizedStringTransformer` were renamed to `ROUND_HALF_EVEN`,
`ROUND_HALF_UP` and `ROUND_HALF_DOWN`.
- * The methods `ChoiceListInterface::getIndicesForChoices()` and
- `ChoiceListInterface::getIndicesForValues()` were removed. No direct
- replacement exists, although in most cases
- `ChoiceListInterface::getChoicesForValues()` and
- `ChoiceListInterface::getValuesForChoices()` should be sufficient.
+ * The `Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface` was
+ removed in favor of `Symfony\Component\Form\ChoiceList\ChoiceListInterface`.
+
+ * `Symfony\Component\Form\Extension\Core\View\ChoiceView` was removed in favor of
+ `Symfony\Component\Form\ChoiceList\View\ChoiceView`.
* The interface `Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface`
and all of its implementations were removed. Use the new interface
@@ -317,8 +589,8 @@ UPGRADE FROM 2.x to 3.0
* The `Symfony\Component\Form\Extension\Core\ChoiceList\SimpleChoiceList` class has been removed in
favor of `Symfony\Component\Form\ChoiceList\ArrayChoiceList`.
-
- * The `TimezoneType::getTimezones()` method was removed. You should not use
+
+ * The `TimezoneType::getTimezones()` method was removed. You should not use
this method.
* The `Symfony\Component\Form\ChoiceList\ArrayKeyChoiceList` class has been removed in
@@ -365,11 +637,11 @@ UPGRADE FROM 2.x to 3.0
}
}
```
-
+
* In Symfony 2.7 a small BC break was introduced with the new choices_as_values
option. In order to have the choice values populated to the html value attribute
you had to define the choice_value option. This is now not any more needed.
-
+
Before:
```php
@@ -389,9 +661,9 @@ UPGRADE FROM 2.x to 3.0
},
));
```
-
+
After:
-
+
```php
$form->add('status', ChoiceType::class, array(
'choices' => array(
@@ -400,56 +672,11 @@ UPGRADE FROM 2.x to 3.0
'Ignored' => Status::IGNORED,
)
));
- ```
+ ```
* The `request` service was removed. You must inject the `request_stack`
service instead.
- * The `templating.helper.assets` was removed in Symfony 3.0. You should
- use the `assets.package` service instead.
-
- Before:
-
- ```php
- use Symfony\Component\Templating\Helper\CoreAssetsHelper;
-
- class DemoService
- {
- private $assetsHelper;
-
- public function __construct(CoreAssetsHelper $assetsHelper)
- {
- $this->assetsHelper = $assetsHelper;
- }
-
- public function testMethod()
- {
- return $this->assetsHelper->getUrl('thumbnail.png', null, $this->assetsHelper->getVersion());
- }
- }
- ```
-
- After:
-
- ```php
- use Symfony\Component\Asset\Packages;
-
- class DemoService
- {
- private $assetPackages;
-
- public function __construct(Packages $assetPackages)
- {
- $this->assetPackages = $assetPackages;
- }
-
- public function testMethod()
- {
- return $this->assetPackages->getUrl('thumbnail.png').$this->assetPackages->getVersion();
- }
- }
- ```
-
* The `enctype` method of the `form` helper was removed. You should use the
new method `start` instead.
@@ -517,6 +744,27 @@ UPGRADE FROM 2.x to 3.0
interface.
The `security.csrf.token_manager` should be used instead.
+ * The `validator.mapping.cache.apc` service has been removed in favor of the `validator.mapping.cache.doctrine.apc` one.
+
+ * The ability to pass `apc` as the `framework.validation.cache` configuration key value has been removed.
+ Use `validator.mapping.cache.doctrine.apc` instead:
+
+ Before:
+
+ ```yaml
+ framework:
+ validation:
+ cache: apc
+ ```
+
+ After:
+
+ ```yaml
+ framework:
+ validation:
+ cache: validator.mapping.cache.doctrine.apc
+ ```
+
### HttpKernel
* The `Symfony\Component\HttpKernel\Log\LoggerInterface` has been removed in
@@ -592,7 +840,7 @@ UPGRADE FROM 2.x to 3.0
* Some route settings have been renamed:
- * The `pattern` setting for a route has been deprecated in favor of `path`
+ * The `pattern` setting has been removed in favor of `path`
* The `_scheme` and `_method` requirements have been moved to the `schemes` and `methods` settings
Before:
@@ -645,6 +893,9 @@ UPGRADE FROM 2.x to 3.0
the performance gains were minimal and it's hard to replicate the behaviour
of PHP implementation.
+ * The `getMatcherDumperInstance()` and `getGeneratorDumperInstance()` methods in the
+ `Symfony\Component\Routing\Router` have been changed from `public` to `protected`.
+
### Security
* The `Resources/` directory was moved to `Core/Resources/`
@@ -738,8 +989,15 @@ UPGRADE FROM 2.x to 3.0
));
```
- * The `AbstractVoter::getSupportedAttributes()` and `AbstractVoter::getSupportedClasses()`
- methods have been removed in favor of `AbstractVoter::supports()`.
+ * The `AbstractVoter` class was removed. Instead, extend the new `Voter` class,
+ introduced in 2.8, and move your voting logic to the to the `supports($attribute, $subject)`
+ and `voteOnAttribute($attribute, $object, TokenInterface $token)` methods.
+
+ * The `vote()` method from the `VoterInterface` was changed to now accept arbitrary
+ types, and not only objects.
+
+ * The `supportsClass` and `supportsAttribute` methods were
+ removed from the `VoterInterface` interface.
Before:
@@ -763,22 +1021,51 @@ UPGRADE FROM 2.x to 3.0
After:
```php
- class MyVoter extends AbstractVoter
+ use Symfony\Component\Security\Core\Authorization\Voter\Voter;
+
+ class MyVoter extends Voter
{
protected function supports($attribute, $object)
{
return $object instanceof Post && in_array($attribute, array('CREATE', 'EDIT'));
}
- // ...
+ protected function voteOnAttribute($attribute, $object, TokenInterface $token)
+ {
+ // Return true or false
+ }
}
```
+ * The `intention` option was renamed to `csrf_token_id` for all the authentication listeners.
+
+ * The `csrf_provider` option was renamed to `csrf_token_generator` for all the authentication listeners.
+
+### SecurityBundle
+
+ * The `intention` firewall listener setting was renamed to `csrf_token_id`.
+
+ * The `csrf_provider` firewall listener setting was renamed to `csrf_token_generator`.
+
+### Serializer
+
+ * The `setCamelizedAttributes()` method of the
+ `Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer` and
+ `Symfony\Component\Serializer\Normalizer\PropertyNormalizer` classes
+ was removed.
+
+ * The `Symfony\Component\Serializer\Exception\Exception` interface was removed
+ in favor of the new `Symfony\Component\Serializer\Exception\ExceptionInterface`.
+
### Translator
* The `Translator::setFallbackLocale()` method has been removed in favor of
`Translator::setFallbackLocales()`.
+ * The `getMessages()` method of the `Symfony\Component\Translation\Translator`
+ class was removed. You should use the `getCatalogue()` method of the
+ `Symfony\Component\Translation\TranslatorBagInterface`.
+
### Twig Bridge
* The `twig:lint` command has been deprecated since Symfony 2.7 and will be
@@ -838,11 +1125,18 @@ UPGRADE FROM 2.x to 3.0
### TwigBundle
+ * The `Symfony\Bundle\TwigBundle\TwigDefaultEscapingStrategy` was removed
+ in favor of `Twig_FileExtensionEscapingStrategy`.
+
* The `twig:debug` command has been deprecated since Symfony 2.7 and will be
removed in Symfony 3.0. Use the `debug:twig` command instead.
### Validator
+ * The PHP7-incompatible constraints (`Null`, `True`, `False`) and their related
+ validators (`NullValidator`, `TrueValidator`, `FalseValidator`) have been
+ removed in favor of their `Is`-prefixed equivalent.
+
* The class `Symfony\Component\Validator\Mapping\Cache\ApcCache` has been removed in favor
of `Symfony\Component\Validator\Mapping\Cache\DoctrineCache`.
@@ -1308,15 +1602,25 @@ UPGRADE FROM 2.x to 3.0
Yaml::parse(file_get_contents($fileName));
```
+### WebProfiler
+
+ * The `profiler:import` and `profiler:export` commands have been deprecated and
+ will be removed in 3.0.
+
+ * All the profiler storages different than `FileProfilerStorage` have been
+ removed. The removed classes are:
+
+ - `Symfony\Component\HttpKernel\Profiler\BaseMemcacheProfilerStorage`
+ - `Symfony\Component\HttpKernel\Profiler\MemcachedProfilerStorage`
+ - `Symfony\Component\HttpKernel\Profiler\MemcacheProfilerStorage`
+ - `Symfony\Component\HttpKernel\Profiler\MongoDbProfilerStorage`
+ - `Symfony\Component\HttpKernel\Profiler\MysqlProfilerStorage`
+ - `Symfony\Component\HttpKernel\Profiler\PdoProfilerStorage`
+ - `Symfony\Component\HttpKernel\Profiler\RedisProfilerStorage`
+ - `Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage`
+
### Process
* `Process::setStdin()` and `Process::getStdin()` have been removed. Use
`Process::setInput()` and `Process::getInput()` that works the same way.
* `Process::setInput()` and `ProcessBuilder::setInput()` do not accept non-scalar types.
-
-### Config
-
- * `\Symfony\Component\Config\Resource\ResourceInterface::isFresh()` has been removed. Also,
- cache validation through this method (which was still supported in 2.8 for BC) does no longer
- work because the `\Symfony\Component\Config\Resource\BCResourceInterfaceChecker` helper class
- has been removed as well.
diff --git a/appveyor.yml b/appveyor.yml
index 9cd1d0b10e6a1..89a66df7625d5 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,6 +1,5 @@
build: false
-shallow_clone: true
-platform: x86
+clone_depth: 1
clone_folder: c:\projects\symfony
cache:
@@ -14,6 +13,7 @@ init:
- SET PHP=1
- SET ANSICON=121x90 (121x90)
- SET SYMFONY_PHPUNIT_SKIPPED_TESTS=phpunit.skipped
+ - REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /v DelayedExpansion /t REG_DWORD /d 1 /f
install:
- IF EXIST c:\php (SET PHP=0) ELSE (mkdir c:\php)
@@ -58,7 +58,6 @@ install:
test_script:
- cd c:\projects\symfony
- - Setlocal EnableDelayedExpansion
- SET X=0
- copy /Y c:\php\php.ini-min c:\php\php.ini
- php phpunit symfony --exclude-group benchmark,intl-data || SET X=!errorlevel!
diff --git a/composer.json b/composer.json
index 5fcec2e747e42..d438762932821 100644
--- a/composer.json
+++ b/composer.json
@@ -21,6 +21,7 @@
"twig/twig": "~1.23|~2.0",
"psr/log": "~1.0",
"symfony/security-acl": "~2.7",
+ "symfony/polyfill-apcu": "~1.1",
"symfony/polyfill-intl-icu": "~1.0",
"symfony/polyfill-mbstring": "~1.0",
"symfony/polyfill-php54": "~1.0",
@@ -83,7 +84,7 @@
"doctrine/orm": "~2.4,>=2.4.5",
"doctrine/doctrine-bundle": "~1.2",
"monolog/monolog": "~1.11",
- "ocramius/proxy-manager": "~0.4|~1.0",
+ "ocramius/proxy-manager": "~0.4|~1.0|~2.0",
"egulias/email-validator": "~1.2",
"phpdocumentor/reflection": "^1.0.7"
},
diff --git a/phpunit b/phpunit
index 0517719add9e6..9cf03f071ecbf 100755
--- a/phpunit
+++ b/phpunit
@@ -27,7 +27,7 @@ if ('phpdbg' === PHP_SAPI) {
$PHP .= ' -qrr';
}
-$COMPOSER = file_exists($COMPOSER = __DIR__.'/composer.phar') || ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? `where.exe composer.phar` : `which composer.phar`))
+$COMPOSER = file_exists($COMPOSER = __DIR__.'/composer.phar') || ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer.phar`) : `which composer.phar`))
? $PHP.' '.ProcessUtils::escapeArgument($COMPOSER)
: 'composer';
@@ -160,8 +160,8 @@ if (isset($argv[1]) && 'symfony' === $argv[1]) {
unlink($file);
}
- // Fail on any individual component failures but ignore STATUS_STACK_BUFFER_OVERRUN (-1073740791) on Windows when APCu is enabled
- if ($procStatus && ('\\' !== DIRECTORY_SEPARATOR || !extension_loaded('apcu') || !ini_get('apc.enable_cli') || -1073740791 !== $procStatus)) {
+ // Fail on any individual component failures but ignore STATUS_STACK_BUFFER_OVERRUN (-1073740791/0xC0000409) and STATUS_ACCESS_VIOLATION (-1073741819/0xC0000005) on Windows when APCu is enabled
+ if ($procStatus && ('\\' !== DIRECTORY_SEPARATOR || !extension_loaded('apcu') || !ini_get('apc.enable_cli') || (-1073740791 !== $procStatus && -1073741819 !== $procStatus))) {
$exit = $procStatus;
echo "\033[41mKO\033[0m $component\n\n";
} else {
diff --git a/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php b/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php
index 063b9359c7978..af584579c8a6c 100644
--- a/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php
+++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php
@@ -153,7 +153,7 @@ protected function setMappingDriverConfig(array $mappingConfig, $mappingName)
*/
protected function getMappingDriverBundleConfigDefaults(array $bundleConfig, \ReflectionClass $bundle, ContainerBuilder $container)
{
- $bundleDir = dirname($bundle->getFilename());
+ $bundleDir = dirname($bundle->getFileName());
if (!$bundleConfig['type']) {
$bundleConfig['type'] = $this->detectMetadataDriver($bundleDir, $container);
diff --git a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php
index de35c55219f2e..96f05eb5b60c9 100644
--- a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php
+++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php
@@ -60,7 +60,7 @@ private function updateValidatorMappingFiles(ContainerBuilder $container, $mappi
foreach ($container->getParameter('kernel.bundles') as $bundle) {
$reflection = new \ReflectionClass($bundle);
- if (is_file($file = dirname($reflection->getFilename()).'/'.$validationPath)) {
+ if (is_file($file = dirname($reflection->getFileName()).'/'.$validationPath)) {
$files[] = realpath($file);
$container->addResource(new FileResource($file));
}
diff --git a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php
index 1a09609b28556..2dc8c2cb2b28d 100644
--- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php
+++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php
@@ -146,7 +146,7 @@ public function loadChoicesForValues(array $values, $value = null)
// Optimize performance in case we have an object loader and
// a single-field identifier
- if (!$this->choiceList && $this->objectLoader && $this->idReader->isSingleId()) {
+ if (null === $value && !$this->choiceList && $this->objectLoader && $this->idReader->isSingleId()) {
$unorderedObjects = $this->objectLoader->getEntitiesByIds($this->idReader->getIdField(), $values);
$objectsById = array();
$objects = array();
diff --git a/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php b/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php
index 51f9f75e4b62c..18fb341e5b74c 100644
--- a/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php
+++ b/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php
@@ -49,12 +49,8 @@ public function startQuery($sql, array $params = null, array $types = null)
$this->stopwatch->start('doctrine', 'doctrine');
}
- if (is_array($params)) {
- $params = $this->normalizeParams($params);
- }
-
if (null !== $this->logger) {
- $this->log($sql, null === $params ? array() : $params);
+ $this->log($sql, null === $params ? array() : $this->normalizeParams($params));
}
}
diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php
index fa0bd27fd3d6c..bdcea8ae638a7 100644
--- a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php
+++ b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php
@@ -766,6 +766,55 @@ public function testOverrideChoices()
$this->assertSame('2', $field->getViewData());
}
+ public function testOverrideChoicesValues()
+ {
+ $entity1 = new SingleIntIdEntity(1, 'Foo');
+ $entity2 = new SingleIntIdEntity(2, 'Bar');
+
+ $this->persist(array($entity1, $entity2));
+
+ $field = $this->factory->createNamed('name', 'Symfony\Bridge\Doctrine\Form\Type\EntityType', null, array(
+ 'em' => 'default',
+ 'class' => self::SINGLE_IDENT_CLASS,
+ 'choice_label' => 'name',
+ 'choice_value' => 'name',
+ ));
+
+ $field->submit('Bar');
+
+ $this->assertEquals(array('Foo' => new ChoiceView($entity1, 'Foo', 'Foo'), 'Bar' => new ChoiceView($entity2, 'Bar', 'Bar')), $field->createView()->vars['choices']);
+ $this->assertTrue($field->isSynchronized(), 'Field should be synchronized.');
+ $this->assertSame($entity2, $field->getData(), 'Entity should be loaded by custom value.');
+ $this->assertSame('Bar', $field->getViewData());
+ }
+
+ public function testOverrideChoicesValuesWithCallable()
+ {
+ $entity1 = new GroupableEntity(1, 'Foo', 'BazGroup');
+ $entity2 = new GroupableEntity(2, 'Bar', 'BooGroup');
+
+ $this->persist(array($entity1, $entity2));
+
+ $field = $this->factory->createNamed('name', 'Symfony\Bridge\Doctrine\Form\Type\EntityType', null, array(
+ 'em' => 'default',
+ 'class' => self::ITEM_GROUP_CLASS,
+ 'choice_label' => 'name',
+ 'choice_value' => function (GroupableEntity $entity) {
+ return $entity->groupName.'/'.$entity->name;
+ },
+ ));
+
+ $field->submit('BooGroup/Bar');
+
+ $this->assertEquals(array(
+ 'BazGroup/Foo' => new ChoiceView($entity1, 'BazGroup/Foo', 'Foo'),
+ 'BooGroup/Bar' => new ChoiceView($entity2, 'BooGroup/Bar', 'Bar'),
+ ), $field->createView()->vars['choices']);
+ $this->assertTrue($field->isSynchronized(), 'Field should be synchronized.');
+ $this->assertSame($entity2, $field->getData(), 'Entity should be loaded by custom value.');
+ $this->assertSame('BooGroup/Bar', $field->getViewData());
+ }
+
public function testGroupByChoices()
{
$item1 = new GroupableEntity(1, 'Foo', 'Group1');
diff --git a/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php b/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php
index 376208088c1d1..ac1bb5f96e41b 100644
--- a/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php
+++ b/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php
@@ -26,7 +26,7 @@ class DoctrineExtractorTest extends \PHPUnit_Framework_TestCase
*/
private $extractor;
- public function setUp()
+ protected function setUp()
{
$config = Setup::createAnnotationMetadataConfiguration(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures'), true);
$entityManager = EntityManager::create(array('driver' => 'pdo_sqlite'), $config);
diff --git a/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php b/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php
index c54556b243475..33e484320a56a 100644
--- a/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php
+++ b/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php
@@ -16,7 +16,6 @@
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Common\Persistence\ObjectRepository;
use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper;
-use Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeIntIdEntity;
use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity;
use Symfony\Bridge\Doctrine\Tests\Fixtures\DoubleNameEntity;
use Symfony\Bridge\Doctrine\Tests\Fixtures\AssociationEntity;
@@ -404,7 +403,7 @@ public function testAssociatedEntity()
$this->buildViolation('myMessage')
->atPath('property.path.single')
- ->setInvalidValue(1)
+ ->setInvalidValue($entity1)
->assertRaised();
}
@@ -428,29 +427,6 @@ public function testAssociatedEntityWithNull()
$this->assertNoViolation();
}
- /**
- * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
- * @expectedExceptionMessage Associated entities are not allowed to have more than one identifier field
- */
- public function testAssociatedCompositeEntity()
- {
- $constraint = new UniqueEntity(array(
- 'message' => 'myMessage',
- 'fields' => array('composite'),
- 'em' => self::EM_NAME,
- ));
-
- $composite = new CompositeIntIdEntity(1, 1, 'test');
- $associated = new AssociationEntity();
- $associated->composite = $composite;
-
- $this->em->persist($composite);
- $this->em->persist($associated);
- $this->em->flush();
-
- $this->validator->validate($associated, $constraint);
- }
-
/**
* @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
* @expectedExceptionMessage Object manager "foo" does not exist.
diff --git a/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php
index edd972b9831fe..f4c8671abae9a 100644
--- a/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php
+++ b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php
@@ -97,17 +97,6 @@ public function validate($entity, Constraint $constraint)
* getter methods in the Proxy are being bypassed.
*/
$em->initializeObject($criteria[$fieldName]);
-
- $relatedClass = $em->getClassMetadata($class->getAssociationTargetClass($fieldName));
- $relatedId = $relatedClass->getIdentifierValues($criteria[$fieldName]);
-
- if (count($relatedId) > 1) {
- throw new ConstraintDefinitionException(
- 'Associated entities are not allowed to have more than one identifier field to be '.
- 'part of a unique constraint in: '.$class->getName().'#'.$fieldName
- );
- }
- $criteria[$fieldName] = array_pop($relatedId);
}
}
diff --git a/src/Symfony/Bridge/PhpUnit/ClockMock.php b/src/Symfony/Bridge/PhpUnit/ClockMock.php
index b81fee965880a..fe5cd851258d2 100644
--- a/src/Symfony/Bridge/PhpUnit/ClockMock.php
+++ b/src/Symfony/Bridge/PhpUnit/ClockMock.php
@@ -109,5 +109,4 @@ function usleep(\$us)
);
}
}
-
}
diff --git a/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php b/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php
index e1ec80608c633..417d94e47215e 100644
--- a/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php
+++ b/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php
@@ -74,16 +74,22 @@ public function getProxyFactoryCode(Definition $definition, $id)
if (defined('Symfony\Component\DependencyInjection\ContainerInterface::SCOPE_CONTAINER') && ContainerInterface::SCOPE_CONTAINER !== $scope = $definition->getScope(false)) {
$instantiation .= " \$this->scopedServices['$scope']['$id'] =";
}
- }
+ }
$methodName = 'get'.Container::camelize($id).'Service';
$proxyClass = $this->getProxyClassName($definition);
+ $generatedClass = $this->generateProxyClass($definition);
+
+ $constructorCall = $generatedClass->hasMethod('staticProxyConstructor')
+ ? $proxyClass.'::staticProxyConstructor'
+ : 'new '.$proxyClass;
+
return <<$methodName(false);
@@ -103,11 +109,7 @@ function (&\$wrappedInstance, \ProxyManager\Proxy\LazyLoadingInterface \$proxy)
*/
public function getProxyCode(Definition $definition)
{
- $generatedClass = new ClassGenerator($this->getProxyClassName($definition));
-
- $this->proxyGenerator->generate(new \ReflectionClass($definition->getClass()), $generatedClass);
-
- return $this->classGenerator->generate($generatedClass);
+ return $this->classGenerator->generate($this->generateProxyClass($definition));
}
/**
@@ -121,4 +123,18 @@ private function getProxyClassName(Definition $definition)
{
return str_replace('\\', '', $definition->getClass()).'_'.spl_object_hash($definition).$this->salt;
}
+
+ /**
+ * @param Definition $definition
+ *
+ * @return ClassGenerator
+ */
+ private function generateProxyClass(Definition $definition)
+ {
+ $generatedClass = new ClassGenerator($this->getProxyClassName($definition));
+
+ $this->proxyGenerator->generate(new \ReflectionClass($definition->getClass()), $generatedClass);
+
+ return $generatedClass;
+ }
}
diff --git a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Dumper/PhpDumperTest.php b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Dumper/PhpDumperTest.php
index 412674ee3f680..5e451c122f3c4 100644
--- a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Dumper/PhpDumperTest.php
+++ b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Dumper/PhpDumperTest.php
@@ -49,7 +49,12 @@ public function testDumpContainerWithProxyService()
*/
public function testDumpContainerWithProxyServiceWillShareProxies()
{
- require_once __DIR__.'/../Fixtures/php/lazy_service.php';
+ // detecting ProxyManager v2
+ if (class_exists('ProxyManager\ProxyGenerator\LazyLoading\MethodGenerator\StaticProxyConstructor')) {
+ require_once __DIR__.'/../Fixtures/php/lazy_service_with_hints.php';
+ } else {
+ require_once __DIR__.'/../Fixtures/php/lazy_service.php';
+ }
$container = new \LazyServiceProjectServiceContainer();
diff --git a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service_structure.txt b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service_structure.txt
index 332370c87eb11..e2775cfa5f3d3 100644
--- a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service_structure.txt
+++ b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service_structure.txt
@@ -8,7 +8,7 @@ class ProjectServiceContainer extends Container
if ($lazyLoad) {
$container = $this;
- return $this->services['foo'] = new stdClass_%s(
+ return $this->services['foo'] =%sstdClass_%s(
function (&$wrappedInstance, \ProxyManager\Proxy\LazyLoadingInterface $proxy) use ($container) {
$wrappedInstance = $container->getFooService(false);
@@ -23,5 +23,5 @@ class ProjectServiceContainer extends Container
}
}
-class stdClass_%s extends \stdClass implements \ProxyManager\Proxy\VirtualProxyInterface
+class stdClass_%s extends \stdClass implements \ProxyManager\%s
{%a}%A
\ No newline at end of file
diff --git a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service_with_hints.php b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service_with_hints.php
new file mode 100644
index 0000000000000..349d899649c92
--- /dev/null
+++ b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service_with_hints.php
@@ -0,0 +1,189 @@
+services = array();
+ }
+
+ /**
+ * Gets the 'foo' service.
+ *
+ * This service is shared.
+ * This method always returns the same instance of the service.
+ *
+ * @param bool $lazyLoad whether to try lazy-loading the service with a proxy
+ *
+ * @return stdClass A stdClass instance.
+ */
+ public function getFooService($lazyLoad = true)
+ {
+ if ($lazyLoad) {
+ $container = $this;
+
+ return $this->services['foo'] = new stdClass_c1d194250ee2e2b7d2eab8b8212368a8(
+ function (&$wrappedInstance, \ProxyManager\Proxy\LazyLoadingInterface $proxy) use ($container) {
+ $wrappedInstance = $this->getFooService(false);
+
+ $proxy->setProxyInitializer(null);
+
+ return true;
+ }
+ );
+ }
+
+ return new \stdClass();
+ }
+}
+
+class stdClass_c1d194250ee2e2b7d2eab8b8212368a8 extends \stdClass implements \ProxyManager\Proxy\LazyLoadingInterface, \ProxyManager\Proxy\ValueHolderInterface
+{
+ /**
+ * @var \Closure|null initializer responsible for generating the wrapped object
+ */
+ private $valueHolder5157dd96e88c0 = null;
+
+ /**
+ * @var \Closure|null initializer responsible for generating the wrapped object
+ */
+ private $initializer5157dd96e8924 = null;
+
+ /**
+ * @override constructor for lazy initialization
+ *
+ * @param \Closure|null $initializer
+ */
+ public function __construct($initializer)
+ {
+ $this->initializer5157dd96e8924 = $initializer;
+ }
+
+ /**
+ * @param string $name
+ */
+ public function __get($name)
+ {
+ $this->initializer5157dd96e8924 && $this->initializer5157dd96e8924->__invoke($this->valueHolder5157dd96e88c0, $this, '__get', array('name' => $name));
+
+ return $this->valueHolder5157dd96e88c0->$name;
+ }
+
+ /**
+ * @param string $name
+ * @param mixed $value
+ */
+ public function __set($name, $value)
+ {
+ $this->initializer5157dd96e8924 && $this->initializer5157dd96e8924->__invoke($this->valueHolder5157dd96e88c0, $this, '__set', array('name' => $name, 'value' => $value));
+
+ $this->valueHolder5157dd96e88c0->$name = $value;
+ }
+
+ /**
+ * @param string $name
+ *
+ * @return bool
+ */
+ public function __isset($name)
+ {
+ $this->initializer5157dd96e8924 && $this->initializer5157dd96e8924->__invoke($this->valueHolder5157dd96e88c0, $this, '__isset', array('name' => $name));
+
+ return isset($this->valueHolder5157dd96e88c0->$name);
+ }
+
+ /**
+ * @param string $name
+ */
+ public function __unset($name)
+ {
+ $this->initializer5157dd96e8924 && $this->initializer5157dd96e8924->__invoke($this->valueHolder5157dd96e88c0, $this, '__unset', array('name' => $name));
+
+ unset($this->valueHolder5157dd96e88c0->$name);
+ }
+
+ /**
+ *
+ */
+ public function __clone()
+ {
+ $this->initializer5157dd96e8924 && $this->initializer5157dd96e8924->__invoke($this->valueHolder5157dd96e88c0, $this, '__clone', array());
+
+ $this->valueHolder5157dd96e88c0 = clone $this->valueHolder5157dd96e88c0;
+ }
+
+ /**
+ *
+ */
+ public function __sleep()
+ {
+ $this->initializer5157dd96e8924 && $this->initializer5157dd96e8924->__invoke($this->valueHolder5157dd96e88c0, $this, '__sleep', array());
+
+ return array('valueHolder5157dd96e88c0');
+ }
+
+ /**
+ *
+ */
+ public function __wakeup()
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setProxyInitializer(\Closure $initializer = null)
+ {
+ $this->initializer5157dd96e8924 = $initializer;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getProxyInitializer()
+ {
+ return $this->initializer5157dd96e8924;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function initializeProxy() : bool
+ {
+ return $this->initializer5157dd96e8924 && $this->initializer5157dd96e8924->__invoke($this->valueHolder5157dd96e88c0, $this, 'initializeProxy', array());
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function isProxyInitialized() : bool
+ {
+ return null !== $this->valueHolder5157dd96e88c0;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getWrappedValueHolderValue()
+ {
+ return $this->valueHolder5157dd96e88c0;
+ }
+}
diff --git a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php
index fd20192d86e4f..0b98419f16203 100644
--- a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php
+++ b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php
@@ -69,7 +69,7 @@ public function testGetProxyFactoryCode()
$code = $this->dumper->getProxyFactoryCode($definition, 'foo');
$this->assertStringMatchesFormat(
- '%wif ($lazyLoad) {%w$container = $this;%wreturn $this->services[\'foo\'] = new '
+ '%wif ($lazyLoad) {%w$container = $this;%wreturn $this->services[\'foo\'] =%s'
.'SymfonyBridgeProxyManagerTestsLazyProxyPhpDumperProxyDumperTest_%s(%wfunction '
.'(&$wrappedInstance, \ProxyManager\Proxy\LazyLoadingInterface $proxy) use ($container) {'
.'%w$wrappedInstance = $container->getFooService(false);%w$proxy->setProxyInitializer(null);'
diff --git a/src/Symfony/Bridge/ProxyManager/composer.json b/src/Symfony/Bridge/ProxyManager/composer.json
index 2a9fd8c0cfa55..7b560bd6e0dda 100644
--- a/src/Symfony/Bridge/ProxyManager/composer.json
+++ b/src/Symfony/Bridge/ProxyManager/composer.json
@@ -18,7 +18,7 @@
"require": {
"php": ">=5.3.9",
"symfony/dependency-injection": "~2.8|~3.0.0",
- "ocramius/proxy-manager": "~0.4|~1.0"
+ "ocramius/proxy-manager": "~0.4|~1.0|~2.0"
},
"require-dev": {
"symfony/config": "~2.3|~3.0.0"
diff --git a/src/Symfony/Bridge/Twig/Extension/HttpFoundationExtension.php b/src/Symfony/Bridge/Twig/Extension/HttpFoundationExtension.php
index ad7949dfaa682..69d6d326f4d08 100644
--- a/src/Symfony/Bridge/Twig/Extension/HttpFoundationExtension.php
+++ b/src/Symfony/Bridge/Twig/Extension/HttpFoundationExtension.php
@@ -13,6 +13,7 @@
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\RequestContext;
/**
* Twig extension for the Symfony HttpFoundation component.
@@ -22,10 +23,12 @@
class HttpFoundationExtension extends \Twig_Extension
{
private $requestStack;
+ private $requestContext;
- public function __construct(RequestStack $requestStack)
+ public function __construct(RequestStack $requestStack, RequestContext $requestContext = null)
{
$this->requestStack = $requestStack;
+ $this->requestContext = $requestContext;
}
/**
@@ -57,6 +60,23 @@ public function generateAbsoluteUrl($path)
}
if (!$request = $this->requestStack->getMasterRequest()) {
+ if (null !== $this->requestContext && '' !== $host = $this->requestContext->getHost()) {
+ $scheme = $this->requestContext->getScheme();
+ $port = '';
+
+ if ('http' === $scheme && 80 != $this->requestContext->getHttpPort()) {
+ $port = ':'.$this->requestContext->getHttpPort();
+ } elseif ('https' === $scheme && 443 != $this->requestContext->getHttpsPort()) {
+ $port = ':'.$this->requestContext->getHttpsPort();
+ }
+
+ if ('/' !== $path[0]) {
+ $path = rtrim($this->requestContext->getBaseUrl(), '/').'/'.$path;
+ }
+
+ return $scheme.'://'.$host.$port.$path;
+ }
+
return $path;
}
diff --git a/src/Symfony/Bridge/Twig/Extension/YamlExtension.php b/src/Symfony/Bridge/Twig/Extension/YamlExtension.php
index fc9bf0e9e3308..2d46795b4a81e 100644
--- a/src/Symfony/Bridge/Twig/Extension/YamlExtension.php
+++ b/src/Symfony/Bridge/Twig/Extension/YamlExtension.php
@@ -12,6 +12,7 @@
namespace Symfony\Bridge\Twig\Extension;
use Symfony\Component\Yaml\Dumper as YamlDumper;
+use Symfony\Component\Yaml\Yaml;
/**
* Provides integration of the Yaml component with Twig.
@@ -39,6 +40,10 @@ public function encode($input, $inline = 0, $dumpObjects = false)
$dumper = new YamlDumper();
}
+ if (defined('Symfony\Component\Yaml\Yaml::DUMP_OBJECT')) {
+ return $dumper->dump($input, $inline, 0, is_bool($dumpObjects) ? Yaml::DUMP_OBJECT : 0);
+ }
+
return $dumper->dump($input, $inline, 0, false, $dumpObjects);
}
diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_horizontal_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_horizontal_layout.html.twig
index e997615d11378..5de20b1b8f181 100644
--- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_horizontal_layout.html.twig
+++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_horizontal_layout.html.twig
@@ -65,6 +65,17 @@ col-sm-2
{% endspaceless %}
{% endblock submit_row %}
+{% block reset_row -%}
+{% spaceless %}
+
+
+
+ {{ form_widget(form) }}
+
+
+{% endspaceless %}
+{% endblock reset_row %}
+
{% block form_group_class -%}
col-sm-10
{%- endblock form_group_class %}
diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig
index 165236ef613ec..dfb1965ca1048 100644
--- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig
+++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig
@@ -115,7 +115,7 @@
{%- endblock choice_widget_expanded %}
{% block checkbox_widget -%}
- {% set parent_label_class = parent_label_class|default('') -%}
+ {%- set parent_label_class = parent_label_class|default(label_attr.class|default('')) -%}
{% if 'checkbox-inline' in parent_label_class %}
{{- form_label(form, null, { widget: parent() }) -}}
{% else -%}
@@ -126,7 +126,7 @@
{%- endblock checkbox_widget %}
{% block radio_widget -%}
- {%- set parent_label_class = parent_label_class|default('') -%}
+ {%- set parent_label_class = parent_label_class|default(label_attr.class|default('')) -%}
{% if 'radio-inline' in parent_label_class %}
{{- form_label(form, null, { widget: parent() }) -}}
{% else -%}
@@ -167,7 +167,14 @@
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' ' ~ parent_label_class)|trim}) %}
{% endif %}
{% if label is not same as(false) and label is empty %}
- {% set label = name|humanize %}
+ {%- if label_format is not empty -%}
+ {% set label = label_format|replace({
+ '%name%': name,
+ '%id%': id,
+ }) %}
+ {%- else -%}
+ {% set label = name|humanize %}
+ {%- endif -%}
{% endif %}