diff --git a/.gitignore b/.gitignore index f16d739d03..76f1ab9a39 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,7 @@ -.php_cs.cache -autoload.php +vendor/ composer.lock -composer.phar -package*.tar -packages.json phpunit.xml -/vendor/ +.php_cs.cache +composer.phar +package.tar +/packages.json diff --git a/.travis.php b/.travis.php new file mode 100644 index 0000000000..c27942913a --- /dev/null +++ b/.travis.php @@ -0,0 +1,45 @@ + $_SERVER['argc']) { + echo "Usage: commit-range branch dir1 dir2 ... dirN\n"; + exit(1); +} + +$dirs = $_SERVER['argv']; +array_shift($dirs); +$range = array_shift($dirs); +$branch = array_shift($dirs); + +$packages = array(); +$flags = PHP_VERSION_ID >= 50400 ? JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE : 0; + +foreach ($dirs as $dir) { + if (!`git diff --name-only $range -- $dir`) { + continue; + } + echo "$dir\n"; + + $package = json_decode(file_get_contents($dir.'/composer.json')); + + $package->repositories = array(array( + 'type' => 'composer', + 'url' => 'file://'.__DIR__.'/', + )); + file_put_contents($dir.'/composer.json', json_encode($package, $flags)); + passthru("cd $dir && tar -cf package.tar --exclude='package.tar' *"); + + $package->version = $branch.'.x-dev'; + $package->dist['type'] = 'tar'; + $package->dist['url'] = 'file://'.__DIR__."/$dir/package.tar"; + + $packages[$package->name][$package->version] = $package; + + $versions = file_get_contents('https://packagist.org/packages/'.$package->name.'.json'); + $versions = json_decode($versions); + + foreach ($versions->package->versions as $version => $package) { + $packages[$package->name] += array($version => $package); + } +} + +file_put_contents('packages.json', json_encode(compact('packages'), $flags)); diff --git a/.travis.sh b/.travis.sh deleted file mode 100644 index 55020cb012..0000000000 --- a/.travis.sh +++ /dev/null @@ -1,24 +0,0 @@ -branch=$1 -if [ -z "$branch" ]; then - echo 'Usage: branch dir1 dir2 ... dirN' - exit 1 -fi -shift -components=$* -if [ -z "$components" ]; then - echo 'Usage: branch dir1 dir2 ... dirN' - exit 1 -fi -echo '{"packages": {' > packages.json -for c in $components; do - sed -i ':a;N;$!ba;s#^{\n\(\s*\)\("name"\)#{\n\1"repositories": \[{ "type": "composer", "url": "file://'$(pwd)'/" }\],\n\1\2#' $c/composer.json - n=$(php -r '$n=json_decode(file_get_contents("'$c'/composer.json"));echo $n->name;') - echo '"'$n'": {"'$branch'.x-dev": ' >> packages.json - cat $c/composer.json >> packages.json - echo '"version": "'$branch.x-dev'",\n "dist": {"type": "tar", "url": "file://'$(pwd)/$c'/package'$branch'.tar"}\n}},' >> packages.json -done; -sed -i ':a;N;$!ba;s/\n}\n"/,\n "/g' packages.json -sed -i ':a;N;$!ba;s/}},$/\n}}\n}}/' packages.json -for c in $components; do - (cd $c && tar -cf package$branch.tar --exclude='package*.tar' *) -done diff --git a/.travis.yml b/.travis.yml index d8ab3e1bab..425aeb9eaf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,6 +32,7 @@ env: before_install: - composer self-update + - if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then echo "memory_limit = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; 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; @@ -45,7 +46,7 @@ install: - if [ "$deps" = "no" ]; then export SYMFONY_DEPRECATIONS_HELPER=strict; fi; - if [ "$deps" = "no" ]; then composer --prefer-source install; fi; - components=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n') - - if [ "$deps" != "no" ]; then sh .travis.sh $TRAVIS_BRANCH $components; fi; + - if [ "$deps" != "no" ]; then php .travis.php $TRAVIS_COMMIT_RANGE $TRAVIS_BRANCH $components; fi; script: - if [ "$deps" = "no" ]; then echo "$components" | parallel --gnu --keep-order 'echo -e "\\nRunning {} tests"; phpunit --exclude-group tty,benchmark,intl-data {} || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi; diff --git a/CHANGELOG-2.3.md b/CHANGELOG-2.3.md index 84a17f9fdc..e261767b55 100644 --- a/CHANGELOG-2.3.md +++ b/CHANGELOG-2.3.md @@ -7,6 +7,37 @@ 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.31 (2015-07-13) + + * bug #15248 Added 'default' color (jaytaph) + * bug #15243 Reload the session after regenerating its id (jakzal) + * bug #15202 [Security] allow to use `method` in XML configs (xabbuh) + * bug #15223 [Finder] Command::addAtIndex() fails with Command instance argument (thunderer) + * bug #15220 [DependencyInjection] Freeze also FrozenParameterBag::remove (lyrixx) + * bug #15110 Add a way to reset the singleton (dawehner) + * bug #15163 Update DateTimeToArrayTransformer.php (zhil) + * bug #15150 [Translation] Azerbaijani language pluralization rule is wrong (shehi) + * bug #15146 Towards 100% HHVM compat (nicolas-grekas) + * bug #15069 [Form] Fixed: Data mappers always receive forms indexed by their names (webmozart) + * bug #15137 [Security] Initialize SwitchUserEvent::targetUser on attemptExitUser (Rvanlaak, xabbuh) + * bug #15083 [DependencyInjection] Fail when dumping a Definition with no class nor factory (nicolas-grekas) + * bug #15127 [Validator] fix validation for Maestro UK card numbers (xabbuh) + * bug #15128 DbalLogger: Small nonutf8 array fix (vpetrovych, weaverryan) + * bug #15048 [Translation][Form][choice] empty_value shouldn't be translated when it has an empty value (Restless-ET) + * bug #15117 [Form] fixed sending non array data on submit to ResizeListener (BruceWouaigne) + * bug #15086 Fixed the regexp for the validator of Maestro-based credit/debit cards (javiereguiluz) + * bug #15058 [Console] Fix STDERR output text on IBM iSeries OS400 (johnkary) + * bug #15065 [Form] Fixed: remove quoted strings from Intl date formats (e.g. es_ES full pattern) (webmozart) + * bug #15039 [Translation][update cmd] taken account into bundle overrides path. (aitboudad) + * bug #14964 [bugfix][MonologBridge] WebProcessor: passing $extraFields to BaseWebProcessor (MacDada) + * bug #15027 [Form] Fixed: Filter non-integers when selecting entities by int ID (webmozart, nicolas-grekas) + * bug #15000 [Debug] Fix fatal-errors handling on HHVM (nicolas-grekas) + * bug #14897 Allow new lines in Messages translated with transchoice() (replacement for #14867) (azine) + * bug #14895 [Form] Support DateTimeImmutable in transform() (c960657) + * bug #14859 Improve the config validation in TwigBundle (stof) + * bug #14785 [BrowserKit] Fix bug when uri starts with http. (amouhzi) + * bug #14807 [Security][Acl] enforce string identifiers (xabbuh) + * 2.3.30 (2015-05-30) * bug #14262 [REVERTED] [TwigBundle] Refresh twig paths when resources change. (aitboudad) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index f3397b53ec..af5724f4a7 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -15,11 +15,11 @@ Symfony is the result of the work of many people who made the code better - Christophe Coevoet (stof) - Jakub Zalas (jakubzalas) - Pascal Borreli (pborreli) + - Christian Flothmann (xabbuh) - Hugo Hamon (hhamon) - Joseph Bielawski (stloyd) - Karma Dordrak (drak) - Ryan Weaver (weaverryan) - - Christian Flothmann (xabbuh) - Lukas Kahwe Smith (lsmith) - Romain Neutron (romain) - Jeremy Mikola (jmikola) @@ -27,22 +27,23 @@ Symfony is the result of the work of many people who made the code better - Benjamin Eberlei (beberlei) - Igor Wiedler (igorw) - Martin Hasoň (hason) - - Eriksen Costa (eriksencosta) - Abdellatif Ait boudad (aitboudad) + - Eriksen Costa (eriksencosta) - Grégoire Pineau (lyrixx) - Wouter De Jong (wouterj) - Jonathan Wage (jwage) - Alexandre Salomé (alexandresalome) - William Durand (couac) + - Kévin Dunglas (dunglas) - ornicar - stealth35 ‏ (stealth35) - Alexander Mols (asm89) - - Kévin Dunglas (dunglas) - Bulat Shakirzyanov (avalanche123) - Francis Besset (francisbesset) - Saša Stamenković (umpirsky) - Henrik Bjørnskov (henrikbjorn) - Miha Vrhovnik + - Diego Saint Esteben (dii3g0) - Sarah Khalil (saro0h) - Konstantin Kudryashov (everzet) - Bilal Amarni (bamarni) @@ -55,15 +56,14 @@ Symfony is the result of the work of many people who made the code better - Arnout Boks (aboks) - Christian Raue - Michel Weimerskirch (mweimerskirch) - - Diego Saint Esteben (dii3g0) - Lee McDermott - Brandon Turner - Luis Cordova (cordoval) - Douglas Greenshields (shieldo) + - Kevin Bond (kbond) - Daniel Holmes (dholmes) - Bart van den Burg (burgov) - Jordan Alliot (jalliot) - - Kevin Bond (kbond) - John Wards (johnwards) - Fran Moreno (franmomu) - Antoine Hérault (herzult) @@ -71,6 +71,7 @@ Symfony is the result of the work of many people who made the code better - Gábor Egyed (1ed) - Arnaud Le Blanc (arnaud-lb) - Tim Nagel (merk) + - Maxime Steinhausser (ogizanagi) - Brice BERNARD (brikou) - marc.weistroff - lenar @@ -83,16 +84,16 @@ Symfony is the result of the work of many people who made the code better - excelwebzone - Jacob Dreesen (jdreesen) - Matthias Pigulla (mpdude) - - Fabien Pennequin (fabienpennequin) - - Peter Kokot (maastermedia) - - Peter Rehm (rpet) - - Michal Piotrowski (eventhorizon) - - Stefano Sala (stefano.sala) - Javier Eguiluz (javier.eguiluz) + - Fabien Pennequin (fabienpennequin) + - Peter Rehm (rpet) + - Peter Kokot (maastermedia) - Gordon Franke (gimler) - Robert Schönthal (digitalkaoz) - - Juti Noppornpitak (shiroyuki) - Dariusz Ruminski + - Michal Piotrowski (eventhorizon) + - Stefano Sala (stefano.sala) + - Juti Noppornpitak (shiroyuki) - Sebastian Hörl (blogsh) - Daniel Gomes (danielcsgomes) - Hidenori Goto (hidenorigoto) @@ -102,10 +103,13 @@ Symfony is the result of the work of many people who made the code better - Pablo Godel (pgodel) - Eric GELOEN (gelo) - Jérémie Augustin (jaugustin) - - Rafael Dohms (rdohms) - - Tigran Azatyan (tigranazatyan) - Alexander Schwenn (xelaris) + - Rafael Dohms (rdohms) - Arnaud Kleinpeter (nanocom) + - Joshua Thijssen + - Vladimir Reznichenko (kalessil) + - Tigran Azatyan (tigranazatyan) + - Issei Murasawa (issei_m) - Richard Shank (iampersistent) - Clemens Tolboom - Helmer Aaviksoo @@ -113,15 +117,16 @@ Symfony is the result of the work of many people who made the code better - Hiromi Hishida (77web) - Matthieu Ouellette-Vachon (maoueh) - Michał Pipa (michal.pipa) - - Issei Murasawa (issei_m) - Amal Raghav (kertz) - Jonathan Ingram (jonathaningram) - Artur Kotyrba + - Iltar van der Berg - Rouven Weßling (realityking) - Andréia Bohner (andreia) - Dmitrii Chekaliuk (lazyhammer) - Clément JOBEILI (dator) - Dorian Villet (gnutix) + - Javier Spagnoletti (phansys) - Richard Miller (mr_r_miller) - hacfi (hifi) - Mario A. Alvarez Garcia (nomack84) @@ -136,21 +141,17 @@ Symfony is the result of the work of many people who made the code better - Larry Garfield (crell) - Martin Schuhfuß (usefulthink) - Thomas Rabaix (rande) - - Javier Spagnoletti (phansys) - Matthieu Bontemps (mbontemps) - Pierre Minnieur (pminnieur) - fivestar - Dominique Bongiraud - - Iltar van der Berg - Leszek Prabucki (l3l0) - François Zaninotto (fzaninotto) - Dustin Whittle (dustinwhittle) - jeff - - Maxime Steinhausser (ogizanagi) - - Joshua Thijssen - Justin Hileman (bobthecow) - Sven Paulus (subsven) - - Vladimir Reznichenko (kalessil) + - Warnar Boekkooi (boekkooi) - Lars Strojny (lstrojny) - Rui Marinho (ruimarinho) - Mikael Pajunen @@ -158,11 +159,14 @@ Symfony is the result of the work of many people who made the code better - Tugdual Saunier (tucksaun) - Sergey Linnik (linniksa) - Marcel Beerta (mazen) + - Vincent AUBERT (vincent) - julien pauli (jpauli) - Francois Zaninotto - Alexander Kotynia (olden) - Daniel Tschinder + - Alexander M. Turek (derrabus) - Elnur Abdurrakhimov (elnur) + - John Kary (johnkary) - Manuel Reinhard (sprain) - Danny Berger (dpb587) - Roman Marintšenko (inori) @@ -187,11 +191,10 @@ Symfony is the result of the work of many people who made the code better - Jeremy Livingston (jeremylivingston) - Nikita Konstantinov - Wodor Wodorski - - Vincent AUBERT (vincent) - Matthieu Auger (matthieuauger) + - Sébastien Lavoie (lavoiesl) - Beau Simensen (simensen) - Robert Kiss (kepten) - - John Kary (johnkary) - Ruben Gonzalez (rubenrua) - Kim Hemsø Rasmussen (kimhemsoe) - Florian Lonqueu-Brochard (florianlb) @@ -199,8 +202,8 @@ Symfony is the result of the work of many people who made the code better - Wouter Van Hecke - Peter Kruithof (pkruithof) - Michael Holm (hollo) - - Warnar Boekkooi (boekkooi) - Marc Weistroff (futurecat) + - Kristen Gilden (kgilden) - Chris Smith (cs278) - Florian Klein (docteurklein) - Manuel Kiessling (manuelkiessling) @@ -226,6 +229,7 @@ Symfony is the result of the work of many people who made the code better - Julien Galenski (ruian) - Bongiraud Dominique - janschoenherr + - Thomas Schulz (king2500) - Marco Pivetta (ocramius) - Ricard Clau (ricardclau) - Erin Millard @@ -235,18 +239,18 @@ Symfony is the result of the work of many people who made the code better - Vitaliy Zakharov (zakharovvi) - Tobias Sjösten (tobiassjosten) - Gyula Sallai (salla) - - Alexander M. Turek (derrabus) - Konstantin Myakshin (koc) - Inal DJAFAR (inalgnu) - Christian Gärtner (dagardner) + - Tomasz Kowalczyk (thunderer) + - Daniel Wehner - Felix Labrecque - Yaroslav Kiliba - - Sébastien Lavoie (lavoiesl) - Stepan Anchugov (kix) - Terje Bråten - - Kristen Gilden (kgilden) - Robbert Klarenbeek (robbertkl) - Blanchon Vincent (blanchonvincent) + - Dawid Nowak - hossein zolfi (ocean) - Clément Gautier (clementgautier) - Eduardo Gulias (egulias) @@ -261,6 +265,7 @@ Symfony is the result of the work of many people who made the code better - Loïc Chardonnet (gnusat) - Marek Kalnik (marekkalnik) - Vyacheslav Salakhutdinov (megazoll) + - Hassan Amouhzi - Tamas Szijarto - Pavel Volokitin (pvolok) - Endre Fejes @@ -283,9 +288,9 @@ Symfony is the result of the work of many people who made the code better - Oscar Cubo Medina (ocubom) - Karel Souffriau - Christophe L. (christophelau) + - Massimiliano Arione (garak) - Anthon Pang (robocoder) - Jáchym Toušek - - Thomas Schulz (king2500) - Jannik Zschiesche (apfelbox) - Emanuele Gaspari (inmarelibero) - Dariusz Rumiński @@ -304,7 +309,6 @@ Symfony is the result of the work of many people who made the code better - Asier Illarramendi (doup) - Chris Sedlmayr (catchamonkey) - Seb Koelen - - Daniel Wehner - Christoph Mewes (xrstf) - Vitaliy Tverdokhlib (vitaliytv) - Ariel Ferrandini (aferrandini) @@ -313,7 +317,9 @@ Symfony is the result of the work of many people who made the code better - Jonas Flodén (flojon) - Christian Schmidt - Marcin Sikoń (marphi) + - Dominik Zogg (dominik.zogg) - franek (franek) + - Damien Alexandre (damienalexandre) - Adam Harvey - Alex Bakhturin - François-Xavier de Guillebon (de-gui_f) @@ -322,7 +328,6 @@ Symfony is the result of the work of many people who made the code better - Jérôme Macias (jeromemacias) - Fabian Lange (codingfabian) - Yoshio HANAWA - - Tomasz Kowalczyk (thunderer) - Sebastian Bergmann - Pablo Díez (pablodip) - Kevin McBride @@ -359,6 +364,7 @@ Symfony is the result of the work of many people who made the code better - Nils Adermann (naderman) - Gábor Fási - Benjamin Leveque (benji07) + - Ivan Kurnosov - sasezaki - Dawid Pakuła (zulusx) - Florian Rey (nervo) @@ -369,13 +375,14 @@ Symfony is the result of the work of many people who made the code better - Daniel Tschinder - Ryan - Alexander Deruwe (aderuwe) + - Dave Hulbert (dave1010) - François Pluchino (francoispluchino) - - Massimiliano Arione (garak) - Ivan Rey (ivanrey) - Marcin Chyłek (songoq) - Ned Schwartz - Ziumin - Lenar Lõhmus + - Benjamin Laugueux (yzalis) - Zach Badgett (zachbadgett) - Aurélien Fredouelle - Pavel Campr (pcampr) @@ -416,6 +423,7 @@ Symfony is the result of the work of many people who made the code better - David Fuhr - Kamil Kokot (pamil) - Rostyslav Kinash + - Maciej Malarz (malarzm) - Daisuke Ohata - Vincent Simonin - Stefan Warman @@ -428,7 +436,6 @@ Symfony is the result of the work of many people who made the code better - umpirski - Chris Heng (gigablah) - Ulumuddin Yunus (joenoez) - - Dominik Zogg (dominik.zogg) - Luc Vieillescazes (iamluc) - Johann Saunier (prophet777) - Antoine Corcy @@ -461,9 +468,11 @@ Symfony is the result of the work of many people who made the code better - Alexander Volochnev (exelenz) - Michael Piecko - yclian + - Sergio Santoro - Sebastian Grodzicki (sgrodzicki) - Pascal Helfenstein - Baldur Rensch (brensch) + - Vladyslav Petrovych - Alex Xandra Albert Sim - Yuen-Chi Lian - Besnik Br @@ -485,6 +494,7 @@ Symfony is the result of the work of many people who made the code better - Marc Morera (mmoreram) - Andrew Hilobok (hilobok) - Christian Soronellas (theunic) + - Romain Gautier (mykiwi) - Yosmany Garcia (yosmanyga) - Degory Valentine - Benoit Lévêque (benoit_leveque) @@ -501,7 +511,7 @@ Symfony is the result of the work of many people who made the code better - fago - Harm van Tilborg - Jan Prieser - - Damien Alexandre (damienalexandre) + - Artur Melo (restless) - James Michael DuPont - Tom Klingenberg - Christopher Hall (mythmakr) @@ -510,14 +520,17 @@ Symfony is the result of the work of many people who made the code better - Berny Cantos (xphere81) - Reen Lokum - Martin Parsiegla (spea) + - Possum + - Denis Charrier (brucewouaigne) - Quentin Schuler - Pierre Vanliefland (pvanliefland) - frost-nzcr4 + - Oskar Stark (oskarstark) - Abhoryo - Fabian Vogler (fabian) - Korvin Szanto + - MatTheCat - Maksim Kotlyar (makasim) - - Ivan Kurnosov - Neil Ferreira - Dmitry Parnas (parnas) - DQNEO @@ -541,10 +554,11 @@ Symfony is the result of the work of many people who made the code better - Shin Ohno (ganchiku) - Geert De Deckere (geertdd) - Jan Kramer (jankramer) + - Jean-Baptiste GOMOND (mjbgo) + - Richard van Laak (rvanlaak) - abdul malik ikhsan (samsonasik) - Henry Snoek (snoek09) - Timothée Barray (tyx) - - Benjamin Laugueux (yzalis) - Christian Morgan - Alexander Miehe (engerim) - Morgan Auchede (mauchede) @@ -578,6 +592,7 @@ Symfony is the result of the work of many people who made the code better - Raul Fraile (raulfraile) - sensio - Patrick Kaufmann + - Reece Fowell (reecefowell) - stefan.r - Matthieu Napoli (mnapoli) - Ben Ramsey (ramsey) @@ -594,22 +609,26 @@ Symfony is the result of the work of many people who made the code better - Michael Tibben - Sander Marechal - Radosław Benkel + - Gennady Telegin (gtelegin) - Marcos Sánchez - ttomor - Mei Gwilym (meigwilym) - Michael H. Arieli (excelwebzone) - Luciano Mammino (loige) - fabios + - Jérôme Vasseur - Sander Coolen (scoolen) - Nicolas Le Goff (nlegoff) - Manuele Menozzi - Anton Babenko (antonbabenko) - Irmantas Šiupšinskas (irmantas) + - Charles-Henri Bruyand - Danilo Silva - Zachary Tong (polyfractal) - Hryhorii Hrebiniuk - dantleech - Xavier Leune + - Christian Schmidt - Tero Alén (tero) - DerManoMann - Guillaume Royer @@ -671,12 +690,12 @@ Symfony is the result of the work of many people who made the code better - Marcin Chwedziak - Roland Franssen (ro0) - Tony Cosentino (tony-co) - - Maciej Malarz - Rodrigo Díez Villamuera (rodrigodiez) - e-ivanov - Jochen Bayer (jocl) - Jeremy Bush - wizhippo + - Diego Saint Esteben (dosten) - rpg600 - Péter Buri (burci) - Davide Borsatto (davide.borsatto) @@ -701,6 +720,7 @@ Symfony is the result of the work of many people who made the code better - Brooks Boyd - Roger Webb - Dmitriy Simushev + - Martin Hujer (martinhujer) - Max Voloshin (maxvoloshin) - Nicolas Fabre (nfabre) - Raul Rodriguez (raul782) @@ -747,6 +767,7 @@ Symfony is the result of the work of many people who made the code better - Tatsuya Tsuruoka - Ross Tuck - Kévin Gomez (kevin) + - azine - Dawid Sajdak - Ludek Stepan - Geoffrey Brier @@ -769,6 +790,7 @@ Symfony is the result of the work of many people who made the code better - Cédric Lahouste (rapotor) - Samuel Vogel (samuelvogel) - Berat Doğan + - twifty - Anthony Ferrara - ShiraNai7 - Janusz Jabłoński (yanoosh) @@ -812,6 +834,7 @@ Symfony is the result of the work of many people who made the code better - Samuel Gordalina (gordalina) - Max Romanovsky (maxromanovsky) - Mathieu Morlon + - Daniel Tschinder - Rafał Muszyński (rafmus90) - Timothy Anido (xanido) - Rick Prent @@ -829,7 +852,6 @@ Symfony is the result of the work of many people who made the code better - Thomas Chmielowiec (chmielot) - Jānis Lukss - rkerner - - Vladyslav Petrovych - Matthew J Mucklo - fdgdfg (psampaz) - Stéphane Seng @@ -846,6 +868,7 @@ Symfony is the result of the work of many people who made the code better - Jonathan Gough - Benjamin Bender - Konrad Mohrfeldt + - Lance Chen - kor3k kor3k (kor3k) - Stelian Mocanita (stelian) - Flavian (2much) @@ -877,7 +900,6 @@ Symfony is the result of the work of many people who made the code better - Adrian Olek (adrianolek) - Przemysław Piechota (kibao) - Leonid Terentyev (li0n) - - Oskar Stark (oskarstark) - Adam Prager (padam87) - ryunosuke - victoria @@ -892,7 +914,6 @@ 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) @@ -930,6 +951,7 @@ Symfony is the result of the work of many people who made the code better - Grayson Koonce (breerly) - Karim Cassam Chenaï (ka) - Nicolas Bastien (nicolas_bastien) + - Andrew Zhilin (zhil) - Andy Stanberry - Luiz “Felds” Liscia - Thomas Rothe @@ -937,11 +959,13 @@ Symfony is the result of the work of many people who made the code better - avi123 - alsar - Mike Meier + - michalmarcinkowski - Warwick - Chris - efeen - Michał Dąbrowski (defrag) - Simone Fumagalli (hpatoio) + - Brian Graham (incognito) - Kevin Vergauwen (innocenzo) - Alessio Baglio (ioalessio) - John Bafford (jbafford) @@ -960,7 +984,6 @@ 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) @@ -989,7 +1012,6 @@ Symfony is the result of the work of many people who made the code better - Mark de Haan (markdehaan) - Dan Patrick (mdpatrick) - Rares Vlaseanu (raresvla) - - Artur Melo (restless) - Sofiane HADDAG (sofhad) - tante kinast (tante) - Vincent LEFORT (vlefort) @@ -1013,7 +1035,6 @@ Symfony is the result of the work of many people who made the code better - Florian Pfitzer (marmelatze) - Martin Mayer (martin) - Grzegorz Łukaszewicz (newicz) - - Richard van Laak (rvanlaak) - grifx - Robert Campbell - Matt Lehner @@ -1022,6 +1043,7 @@ Symfony is the result of the work of many people who made the code better - Ruben Kruiswijk - Michael J - Joseph Maarek + - Alexander Menk - Alex Pods - timaschew - Ian Phillips @@ -1040,6 +1062,7 @@ Symfony is the result of the work of many people who made the code better - Maerlyn - Even André Fiskvik - Diego Agulló + - Gerrit Drost - Lenar Lõhmus - Cristian Gonzalez - Juan M Martínez @@ -1056,7 +1079,6 @@ Symfony is the result of the work of many people who made the code better - Jeroen Thora (bolle) - Masao Maeda (brtriver) - Darius Leskauskas (darles) - - Dave Hulbert (dave1010) - David Joos (djoos) - Denis Klementjev (dklementjev) - Tomáš Polívka (draczris) @@ -1085,6 +1107,7 @@ Symfony is the result of the work of many people who made the code better - akimsko - Youpie - srsbiz + - Taylan Kasap - Nicolas A. Bérard-Nault - Gladhon - Saem Ghani @@ -1108,6 +1131,7 @@ Symfony is the result of the work of many people who made the code better - Wotre - goohib - Xavier HAUSHERR + - Mantas Urnieža - Cas - Dusan Kasan - Myke79 @@ -1142,6 +1166,7 @@ Symfony is the result of the work of many people who made the code better - andreabreu98 - Michael Schneider - n-aleha + - Şəhriyar İmanov - Kaipi Yann - Sam Williams - Adrian Philipp @@ -1150,6 +1175,7 @@ Symfony is the result of the work of many people who made the code better - Ondrej Slinták - vlechemin - Brian Corrigan + - Ladislav Tánczos - Brian Freytag - Skorney - mieszko4 @@ -1175,6 +1201,7 @@ Symfony is the result of the work of many people who made the code better - Sergiy Sokolenko - dinitrol - Penny Leach + - Richard Trebichavský - g123456789l - Giorgio Premi - oscartv @@ -1200,6 +1227,7 @@ Symfony is the result of the work of many people who made the code better - Alex Olmos (alexolmos) - Antonio Mansilla (amansilla) - Juan Ases García (ases) + - Siragusa (asiragusa) - Daniel Basten (axhm3a) - DUPUCH (bdupuch) - Bill Hance (billhance) @@ -1239,6 +1267,7 @@ Symfony is the result of the work of many people who made the code better - Adam Monsen (meonkeys) - Ala Eddine Khefifi (nayzo) - emilienbouard (neime) + - Nicholas Byfleet (nickbyfleet) - ollie harridge (ollietb) - Paul Andrieux (paulandrieux) - Paweł Szczepanek (pauluz) @@ -1270,6 +1299,7 @@ Symfony is the result of the work of many people who made the code better - Jesper Søndergaard Pedersen (zerrvox) - Florent Cailhol - szymek + - Kovacs Nicolas - craigmarvelley - Stano Turza - simpson @@ -1281,6 +1311,7 @@ Symfony is the result of the work of many people who made the code better - fh-github@fholzhauer.de - Mark Topper - Xavier REN + - Zander Baldwin - Philipp Scheit - max - Mohamed Karnichi (amiral) diff --git a/UPGRADE-2.7.md b/UPGRADE-2.7.md index ab1021fcdc..8fd61b41fd 100644 --- a/UPGRADE-2.7.md +++ b/UPGRADE-2.7.md @@ -599,7 +599,7 @@ FrameworkBundle * The `templating.helper.assets` was refactored and returns now an object of the type `Symfony\Bundle\FrameworkBundle\Templating\Helper\AssetsHelper` instead of `Symfony\Component\Templating\Helper\CoreAssetsHelper`. You can update your class definition - or use the `assets.package` service instead. Using the `assets.package` service is the recommended + 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. Before: diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json index e3e5d77230..3253eb1891 100644 --- a/src/Symfony/Bundle/FrameworkBundle/composer.json +++ b/src/Symfony/Bundle/FrameworkBundle/composer.json @@ -18,8 +18,8 @@ "require": { "php": ">=5.3.9", "symfony/asset": "~2.7|~3.0.0", - "symfony/dependency-injection" : "~2.8", - "symfony/config" : "~2.4", + "symfony/dependency-injection": "~2.8", + "symfony/config": "~2.4", "symfony/event-dispatcher": "~2.8|~3.0.0", "symfony/http-foundation": "~2.4.9|~2.5,>=2.5.4|~3.0.0", "symfony/http-kernel": "~2.7|~3.0.0", diff --git a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php index fe3555874c..15b6e60366 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php @@ -49,7 +49,7 @@ class XmlFileLoader extends FileLoader $this->parseImports($xml, $path); // parameters - $this->parseParameters($xml, $path); + $this->parseParameters($xml); // extensions $this->loadFromExtensions($xml); @@ -70,9 +70,8 @@ class XmlFileLoader extends FileLoader * Parses parameters. * * @param \DOMDocument $xml - * @param string $file */ - private function parseParameters(\DOMDocument $xml, $file) + private function parseParameters(\DOMDocument $xml) { if ($parameters = $this->getChildren($xml->documentElement, 'parameters')) { $this->container->getParameterBag()->add($this->getArgumentsAsPhp($parameters[0], 'parameter')); diff --git a/src/Symfony/Component/Form/ButtonBuilder.php b/src/Symfony/Component/Form/ButtonBuilder.php index 255b2a0b9c..b34b4bb863 100644 --- a/src/Symfony/Component/Form/ButtonBuilder.php +++ b/src/Symfony/Component/Form/ButtonBuilder.php @@ -498,7 +498,7 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface */ public function setRequestHandler(RequestHandlerInterface $requestHandler) { - throw new BadMethodCallException('Buttons do not support form processors.'); + throw new BadMethodCallException('Buttons do not support request handlers.'); } /** diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index 7c4afb03bd..c6d1e31ab3 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -224,13 +224,13 @@ class Request /** * Constructor. * - * @param array $query The GET parameters - * @param array $request The POST parameters - * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) - * @param array $cookies The COOKIE parameters - * @param array $files The FILES parameters - * @param array $server The SERVER parameters - * @param string $content The raw body data + * @param array $query The GET parameters + * @param array $request The POST parameters + * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) + * @param array $cookies The COOKIE parameters + * @param array $files The FILES parameters + * @param array $server The SERVER parameters + * @param string|resource $content The raw body data * * @api */ @@ -244,13 +244,13 @@ class Request * * This method also re-initializes all properties. * - * @param array $query The GET parameters - * @param array $request The POST parameters - * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) - * @param array $cookies The COOKIE parameters - * @param array $files The FILES parameters - * @param array $server The SERVER parameters - * @param string $content The raw body data + * @param array $query The GET parameters + * @param array $request The POST parameters + * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) + * @param array $cookies The COOKIE parameters + * @param array $files The FILES parameters + * @param array $server The SERVER parameters + * @param string|resource $content The raw body data * * @api */ @@ -1563,16 +1563,38 @@ class Request */ public function getContent($asResource = false) { - if (PHP_VERSION_ID < 50600 && (false === $this->content || (true === $asResource && null !== $this->content))) { + $currentContentIsResource = is_resource($this->content); + if (PHP_VERSION_ID < 50600 && false === $this->content) { throw new \LogicException('getContent() can only be called once when using the resource return type and PHP below 5.6.'); } if (true === $asResource) { + if ($currentContentIsResource) { + rewind($this->content); + + return $this->content; + } + + // Content passed in parameter (test) + if (is_string($this->content)) { + $resource = fopen('php://temp','r+'); + fwrite($resource, $this->content); + rewind($resource); + + return $resource; + } + $this->content = false; return fopen('php://input', 'rb'); } + if ($currentContentIsResource) { + rewind($this->content); + + return stream_get_contents($this->content); + } + if (null === $this->content) { $this->content = file_get_contents('php://input'); } @@ -1902,7 +1924,8 @@ class Request $requestUri = substr($requestUri, 0, $pos); } - if (null !== $baseUrl && false === $pathInfo = substr($requestUri, strlen($baseUrl))) { + $pathInfo = substr($requestUri, strlen($baseUrl)); + if (null !== $baseUrl && (false === $pathInfo || '' === $pathInfo)) { // If substr() returns false then PATH_INFO is set to an empty string return '/'; } elseif (null === $baseUrl) { diff --git a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php index 45574df4c4..ed46999e87 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php @@ -969,6 +969,26 @@ class RequestTest extends \PHPUnit_Framework_TestCase $this->assertTrue(feof($retval)); } + public function testGetContentReturnsResourceWhenContentSetInConstructor() + { + $req = new Request(array(), array(), array(), array(), array(), array(), 'MyContent'); + $resource = $req->getContent(true); + + $this->assertTrue(is_resource($resource)); + $this->assertEquals('MyContent', stream_get_contents($resource)); + } + + public function testContentAsResource() + { + $resource = fopen('php://memory','r+'); + fwrite($resource, 'My other content'); + rewind($resource); + + $req = new Request(array(), array(), array(), array(), array(), array(), $resource); + $this->assertEquals('My other content', stream_get_contents($req->getContent(true))); + $this->assertEquals('My other content', $req->getContent()); + } + /** * @expectedException \LogicException * @dataProvider getContentCantBeCalledTwiceWithResourcesProvider @@ -1013,7 +1033,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase return array( 'Resource then fetch' => array(true, false), 'Resource then resource' => array(true, true), - 'Fetch then resource' => array(false, true), ); } diff --git a/src/Symfony/Component/HttpKernel/composer.json b/src/Symfony/Component/HttpKernel/composer.json index 2a1c05216b..a3439e2903 100644 --- a/src/Symfony/Component/HttpKernel/composer.json +++ b/src/Symfony/Component/HttpKernel/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=5.3.9", - "symfony/event-dispatcher": "~2.5.9|~2.6,>=2.6.2|~3.0.0", + "symfony/event-dispatcher": "~2.6,>=2.6.7|~3.0.0", "symfony/http-foundation": "~2.5,>=2.5.4|~3.0.0", "symfony/debug": "~2.6,>=2.6.2", "psr/log": "~1.0" diff --git a/src/Symfony/Component/Security/Acl/Domain/UserSecurityIdentity.php b/src/Symfony/Component/Security/Acl/Domain/UserSecurityIdentity.php index 3bf277f364..ea17c635d5 100644 --- a/src/Symfony/Component/Security/Acl/Domain/UserSecurityIdentity.php +++ b/src/Symfony/Component/Security/Acl/Domain/UserSecurityIdentity.php @@ -36,7 +36,7 @@ final class UserSecurityIdentity implements SecurityIdentityInterface */ public function __construct($username, $class) { - if (empty($username)) { + if ('' === $username || null === $username) { throw new \InvalidArgumentException('$username must not be empty.'); } if (empty($class)) { diff --git a/src/Symfony/Component/Security/Core/Authentication/Provider/UserAuthenticationProvider.php b/src/Symfony/Component/Security/Core/Authentication/Provider/UserAuthenticationProvider.php index ded53e40b1..26740883cf 100644 --- a/src/Symfony/Component/Security/Core/Authentication/Provider/UserAuthenticationProvider.php +++ b/src/Symfony/Component/Security/Core/Authentication/Provider/UserAuthenticationProvider.php @@ -62,7 +62,7 @@ abstract class UserAuthenticationProvider implements AuthenticationProviderInter } $username = $token->getUsername(); - if (empty($username)) { + if ('' === $username || null === $username) { $username = 'NONE_PROVIDED'; } diff --git a/src/Symfony/Component/Security/Core/Authentication/RememberMe/PersistentToken.php b/src/Symfony/Component/Security/Core/Authentication/RememberMe/PersistentToken.php index 92fcb4f2f7..d85572d0e0 100644 --- a/src/Symfony/Component/Security/Core/Authentication/RememberMe/PersistentToken.php +++ b/src/Symfony/Component/Security/Core/Authentication/RememberMe/PersistentToken.php @@ -40,7 +40,7 @@ final class PersistentToken implements PersistentTokenInterface if (empty($class)) { throw new \InvalidArgumentException('$class must not be empty.'); } - if (empty($username)) { + if ('' === $username || null === $username) { throw new \InvalidArgumentException('$username must not be empty.'); } if (empty($series)) { diff --git a/src/Symfony/Component/Security/Core/User/User.php b/src/Symfony/Component/Security/Core/User/User.php index d458b72d5a..bc81f7ffa7 100644 --- a/src/Symfony/Component/Security/Core/User/User.php +++ b/src/Symfony/Component/Security/Core/User/User.php @@ -30,7 +30,7 @@ final class User implements AdvancedUserInterface public function __construct($username, $password, array $roles = array(), $enabled = true, $userNonExpired = true, $credentialsNonExpired = true, $userNonLocked = true) { - if (empty($username)) { + if ('' === $username || null === $username) { throw new \InvalidArgumentException('The username cannot be empty.'); } diff --git a/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php index 78c82ff990..4de4771770 100644 --- a/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php @@ -272,19 +272,7 @@ abstract class AbstractNormalizer extends SerializerAwareNormalizer implements N */ protected function prepareForDenormalization($data) { - if (is_array($data) || is_object($data) && $data instanceof \ArrayAccess) { - $normalizedData = $data; - } elseif (is_object($data)) { - $normalizedData = array(); - - foreach ($data as $attribute => $value) { - $normalizedData[$attribute] = $value; - } - } else { - $normalizedData = array(); - } - - return $normalizedData; + return (array) $data; } /**