10000 Merge branch '2.8' into 3.2 · symfony/symfony@94d059d · GitHub
[go: up one dir, main page]

Skip to content

Commit 94d059d

Browse files
committed
Merge branch '2.8' into 3.2
* 2.8: respect the umask argument in dumpFile() dumpFile(), preserve existing file permissions Add validate method to mockec validator in form TypeTestCase bumped Symfony version to 2.8.19 updated VERSION for 2.8.18 updated CHANGELOG for 2.8.18 bumped Symfony version to 2.7.26 updated VERSION for 2.7.25 update CONTRIBUTORS for 2.7.25 updated CHANGELOG for 2.7.25 [HttpKernel] fixed Kernel name when stored in a directory starting with a number context listener: hardening user provider handling [Console] Do not squash input changes made from console.command event
2 parents eae7695 + 2a7e385 commit 94d059d

File tree

12 files changed

+254
-27
lines changed

12 files changed

+254
-27
lines changed

CONTRIBUTORS.md

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,34 +29,34 @@ Symfony is the result of the work of many people who made the code better
2929
- Grégoire Pineau (lyrixx)
3030
- Martin Hasoň (hason)
3131
- Jeremy Mikola (jmikola)
32+
- Maxime Steinhausser (ogizanagi)
3233
- Jean-François Simon (jfsimon)
3334
- Benjamin Eberlei (beberlei)
3435
- Igor Wiedler (igorw)
35-
- Maxime Steinhausser (ogizanagi)
36-
- Eriksen Costa (eriksencosta)
3736
- Robin Chalas (chalas_r)
37+
- Eriksen Costa (eriksencosta)
3838
- Jules Pietri (heah)
3939
- Sarah Khalil (saro0h)
4040
- Jonathan Wage (jwage)
4141
- Diego Saint Esteben (dosten)
4242
- Alexandre Salomé (alexandresalome)
4343
- William Durand (couac)
44+
- Guilhem Niot (energetick)
4445
- ornicar
4546
- Francis Besset (francisbesset)
4647
- stealth35 ‏ (stealth35)
4748
- Alexander Mols (asm89)
4849
- Bulat Shakirzyanov (avalanche123)
49-
- Ener-Getick (energetick)
50+
- Peter Rehm (rpet)
5051
- Saša Stamenković (umpirsky)
5152
- Henrik Bjørnskov (henrikbjorn)
53+
- Roland Franssen (ro0)
5254
- Miha Vrhovnik
5355
- Roland Franssen (ro0)
5456
- Diego Saint Esteben (dii3g0)
5557
- Konstantin Kudryashov (everzet)
56-
- Iltar van der Berg (kjarli)
5758
- Bilal Amarni (bamarni)
5859
- Florin Patan (florinpatan)
59-
- Peter Rehm (rpet)
6060
- Kevin Bond (kbond)
6161
- Andrej Hudec (pulzarraider)
6262
- Gábor Egyed (1ed)
@@ -91,43 +91,44 @@ Symfony is the result of the work of many people who made the code better
9191
- Jérôme Tamarelle (gromnan)
9292
- Michal Piotrowski (eventhorizon)
9393
- Tim Nagel (merk)
94+
- Maxime STEINHAUSSER
95+
- Issei Murasawa (issei_m)
9496
- Brice BERNARD (brikou)
9597
- Alexander M. Turek (derrabus)
9698
- marc.weistroff
97-
- Issei Murasawa (issei_m)
9899
- lenar
99100
- Włodzimierz Gajda (gajdaw)
100101
- Baptiste Clavié (talus)
101-
- Maxime STEINHAUSSER
102+
- Vladimir Reznichenko (kalessil)
102103
- Alexander Schwenn (xelaris)
103104
- Florian Voutzinos (florianv)
104105
- Colin Frei
105106
- Jérémy DERUSSÉ (jderusse)
106107
- Adrien Brault (adrienbrault)
107108
- Joshua Thijssen
108109
- Peter Kokot (maastermedia)
110+
- David Buchmann (dbu)
109111
- excelwebzone
110112
- Jacob Dreesen (jdreesen)
111-
- Vladimir Reznichenko (kalessil)
113+
- Tobias Nyholm (tobias)
112114
- Tomáš Votruba (tomas_votruba)
113-
- David Buchmann (dbu)
114115
- Fabien Pennequin (fabienpennequin)
115116
- Gordon Franke (gimler)
116-
- Tobias Nyholm (tobias)
117117
- Eric GELOEN (gelo)
118+
- Daniel Wehner (dawehner)
118119
- Tugdual Saunier (tucksaun)
119120
- Théo FIDRY (theofidry)
120121
- Robert Schönthal (digitalkaoz)
121122
- Florian Lonqueu-Brochard (florianlb)
122123
- Stefano Sala (stefano.sala)
124+
- Yonel Ceruto González (yonelceruto)
123125
- Evgeniy (ewgraf)
124126
- Juti Noppornpitak (shiroyuki)
125127
- Tigran Azatyan (tigranazatyan)
126128
- Sebastian Hörl (blogsh)
127129
- Daniel Gomes (danielcsgomes)
128130
- Hidenori Goto (hidenorigoto)
129131
- Sebastiaan Stok (sstok)
130-
- Yonel Ceruto González (yonelceruto)
131132
- Guilherme Blanco (guilhermeblanco)
132133
- Pablo Godel (pgodel)
133134
- Jérémie Augustin (jaugustin)
@@ -155,10 +156,11 @@ Symfony is the result of the work of many people who made the code better
155156
- Jonathan Ingram (jonathaningram)
156157
- Artur Kotyrba
157158
- jeremyFreeAgent (Jérémy Romey) (jeremyfreeagent)
159+
- James Halsall (jaitsu)
158160
- Warnar Boekkooi (boekkooi)
159161
- Dmitrii Chekaliuk (lazyhammer)
160162
- Clément JOBEILI (dator)
161-
- Daniel Wehner
163+
- Grégoire Paris (greg0ire)
162164
- Possum
163165
- Dorian Villet (gnutix)
164166
- Richard Miller (mr_r_miller)
@@ -172,6 +174,7 @@ Symfony is the result of the work of many people who made the code better
172174
- Lars Strojny (lstrojny)
173175
- Stepan Anchugov (kix)
174176
- bronze1man
177+
- Daniel Espendiller
175178
- sun (sun)
176179
- Larry Garfield (crell)
177180
- Martin Schuhfuß (usefulthink)
@@ -190,11 +193,11 @@ Symfony is the result of the work of many people who made the code better
190193
- Justin Hileman (bobthecow)
191194
- Blanchon Vincent (blanchonvincent)
192195
- Chris Wilkinson (thewilkybarkid)
196+
- Christian Schmidt
193197
- Michele Orselli (orso)
194198
- Tom Van Looy (tvlooy)
195199
- Sven Paulus (subsven)
196200
- Rui Marinho (ruimarinho)
197-
- Daniel Espendiller
198201
- SpacePossum
199202
- Dawid Nowak
200203
- Eugene Wissner
@@ -220,7 +223,6 @@ Symfony is the result of the work of many people who made the code better
220223
- Jérôme Vasseur
221224
- Adam Prager (padam87)
222225
- Roman Marintšenko (inori)
223-
- Christian Schmidt
224226
- Xavier Montaña Carreras (xmontana)
225227
- Mickaël Andrieu (mickaelandrieu)
226228
- Xavier Perez
@@ -235,6 +237,7 @@ Symfony is the result of the work of many people who made the code better
235237
- Uwe Jäger (uwej711)
236238
- Eugene Leonovich (rybakit)
237239
- Filippo Tessarotto
240+
- Julien Falque (julienfalque)
238241
- Joseph Rouff (rouffj)
239242
- Félix Labrecque (woodspire)
240243
- GordonsLondon
@@ -256,21 +259,20 @@ Symfony is the result of the work of many people who made the code better
256259
- Beau Simensen (simensen)
257260
- Michael Hirschler (mvhirsch)
258261
- Robert Kiss (kepten)
259-
- Ruben Gonzalez (rubenrua)
262+
- David Maicher (dmaicher)
260263
- Roumen Damianoff (roumen)
261264
- Antonio J. García Lagar (ajgarlag)
262265
- Kim Hemsø Rasmussen (kimhemsoe)
263266
- Wouter Van Hecke
264267
- Peter Kruithof (pkruithof)
265268
- Michael Holm (hollo)
266269
- Marc Weistroff (futurecat)
270+
- Christian Schmidt
267271
- Hidde Wieringa (hiddewie)
268272
- Chris Smith (cs278)
269273
- Florian Klein (docteurklein)
270-
- Julien Falque (julienfalque)
271274
- Oleg Voronkovich
272275
- Manuel Kiessling (manuelkiessling)
273-
- Daniel Wehner
274276
- Atsuhiro KUBO (iteman)
275277
- Andrew Moore (finewolf)
276278
- Bertrand Zuchuat (garfield-fr)
@@ -314,7 +316,6 @@ Symfony is the result of the work of many people who made the code better
314316
- Vitaliy Zakharov (zakharovvi)
315317
- Tobias Sjösten (tobiassjosten)
316318
- Gyula Sallai (salla)
317-
- David Maicher (dmaicher)
318319
- Inal DJAFAR (inalgnu)
319320
- Christian Gärtner (dagardner)
320321
- Tomasz Kowalczyk (thunderer)
@@ -342,6 +343,7 @@ Symfony is the result of the work of many people who made the code better
342343
- Vyacheslav Salakhutdinov (megazoll)
343344
- Jerzy Zawadzki (jzawadzki)
344345
- Hassan Amouhzi
346+
- gadelat (gadelat)
345347
- Tamas Szijarto
346348
- Pavel Volokitin (pvolok)
347349
- François Pluchino (francoispluchino)
@@ -397,13 +399,13 @@ Symfony is the result of the work of many people who made the code better
397399
- Asier Illarramendi (doup)
398400
- Chris Sedlmayr (catchamonkey)
399401
- Seb Koelen
402+
- Dany Maillard (maidmaid)
400403
- Christoph Mewes (xrstf)
401404
- Vitaliy Tverdokhlib (vitaliytv)
402405
- Ariel Ferrandini (aferrandini)
403406
- Dirk Pahl (dirkaholic)
404407
- cedric lombardot (cedriclombardot)
405408
- Jonas Flodén (flojon)
406-
- Christian Schmidt
407409
- Amrouche Hamza
408410
- Marcin Sikoń (marphi)
409411
- Dominik Zogg (dominik.zogg)
@@ -781,6 +783,7 @@ Symfony is the result of the work of many people who made the code better
781783
- Phan Thanh Ha (haphan)
782784
- Chris Jones (leek)
783785
- Colin O'Dell (colinodell)
786+
- Frank de Jonge (frenkynet)
784787
- xaav
785788
- Mahmoud Mostafa (mahmoud)
786789
- Alessandro Lai
@@ -809,6 +812,7 @@ Symfony is the result of the work of many people who made the code better
809812
- mcfedr (mcfedr)
810813
- hamza
811814
- dantleech
815+
- Bastien DURAND (deamon)
812816
- Xavier Leune
813817
- Tero Alén (tero)
814818
- DerManoMann
@@ -939,6 +943,7 @@ Symfony is the result of the work of many people who made the code better
939943
- Christian Sciberras
940944
- Clement Herreman (clemherreman)
941945
- Dan Ionut Dumitriu (danionut90)
946+
- Vladislav Rastrusny (fractalizer)
942947
- Nyro (nyro)
943948
- Marco
944949
- Marc Torres
@@ -1003,6 +1008,7 @@ Symfony is the result of the work of many people who made the code better
10031008
- Andy Raines
10041009
- Anthony Ferrara
10051010
- Klaas Cuvelier (kcuvelier)
1011+
- markusu49
10061012
- Steve Frécinaux
10071013
- ShiraNai7
10081014
- Vašek Purchart (vasek-purchart)
@@ -1028,6 +1034,7 @@ Symfony is the result of the work of many people who made the code better
10281034
- Tom Corrigan (tomcorrigan)
10291035
- Luis Galeas
10301036
- Martin Pärtel
1037+
- George Mponos (gmponos)
10311038
- Noah Heck (myesain)
10321039
- Patrick Daley (padrig)
10331040
- Xavier Briand (xavierbriand)
@@ -1137,7 +1144,7 @@ Symfony is the result of the work of many people who made the code better
11371144
- victoria
11381145
- Francisco Facioni (fran6co)
11391146
- Iwan van Staveren (istaveren)
1140-
- Dany Maillard (maidmaid)
1147+
- Thierry Thuon (lepiaf)
11411148
- Povilas S. (povilas)
11421149
- pborreli
11431150
- Eric Caron
@@ -1180,6 +1187,7 @@ Symfony is the result of the work of many people who made the code better
11801187
- Dennis Væversted
11811188
- nuncanada
11821189
- flack
1190+
- izzyp
11831191
- František Bereň
11841192
- Christoph Nissle (derstoffel)
11851193
- Ionel Scutelnicu (ionelscutelnicu)
@@ -1300,6 +1308,7 @@ Symfony is the result of the work of many people who made the code better
13001308
- John Nickell (jrnickell)
13011309
- Martin Mayer (martin)
13021310
- Grzegorz Łukaszewicz (newicz)
1311+
- Jonny Schmid (schmidjon)
13031312
- Götz Gottwald
13041313
- Veres Lajos
13051314
- Michael Babker
@@ -1365,10 +1374,12 @@ Symfony is the result of the work of many people who made the code better
13651374
- Jelle Bekker (jbekker)
13661375
- Ian Jenkins (jenkoian)
13671376
- Jorge Martin (jorgemartind)
1377+
- Joeri Verdeyen (jverdeyen)
13681378
- Kevin Herrera (kherge)
13691379
- Luis Ramón López López (lrlopez)
13701380
- Muriel (metalmumu)
13711381
- Michael Pohlers (mick_the_big)
1382+
- mlpo (mlpo)
13721383
- Cayetano Soriano Gallego (neoshadybeat)
13731384
- Ondrej Machulda (ondram)
13741385
- Pablo Monterde Perez (plebs)
@@ -1428,6 +1439,7 @@ Symfony is the result of the work of many people who made the code better
14281439
- Christian Eikermann
14291440
- Antonio Angelino
14301441
- Shawn Iwinski
1442+
- Niklas Keller
14311443
- Vladimir Sazhin
14321444
- lol768
14331445
- jamogon
@@ -1516,6 +1528,7 @@ Symfony is the result of the work of many people who made the code better
15161528
- Lin Lu
15171529
- arduanov
15181530
- sualko
1531+
- Bilge
15191532
- Nicolas Roudaire
15201533
- Alfonso (afgar)
15211534
- Andreas Forsblom (aforsblo)
@@ -1587,6 +1600,7 @@ Symfony is the result of the work of many people who made the code better
15871600
- Bart Ruysseveldt (ruyss)
15881601
- Sascha Dens (saschadens)
15891602
- scourgen hung (scourgen)
1603+
- Sébastien Alfaiate (seb33300)
15901604
- Sebastian Busch (sebu)
15911605
- André Filipe Gonçalves Neves (seven)
15921606
- Bruno Ziegler (sfcoder)

src/Symfony/Component/Console/Application.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,10 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI
839839
// ignore invalid options/arguments for now, to allow the event listeners to customize the InputDefinition
840840
}
841841

842+
// don't bind the input again as it would override any input argument/option set from the command event in
843+
// addition to being useless
844+
$command->setInputBound(true);
845+
842846
$event = new ConsoleCommandEvent($command, $input, $output);
843847
$this->dispatcher->dispatch(ConsoleEvents::COMMAND, $event);
844848

src/Symfony/Component/Console/Command/Command.php

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class Command
4040
private $ignoreValidationErrors = false;
4141
private $applicationDefinitionMerged = false;
4242
private $applicationDefinitionMergedWithArgs = false;
43+
private $inputBound = false;
4344
private $code;
4445
private $synopsis = array();
4546
private $usages = array();
@@ -216,11 +217,13 @@ public function run(InputInterface $input, OutputInterface $output)
216217
$this->mergeApplicationDefinition();
217218

218219
// bind the input against the command specific arguments/options
219-
try {
220-
$input->bind($this->definition);
221-
} catch (ExceptionInterface $e) {
222-
if (!$this->ignoreValidationErrors) {
223-
throw $e;
220+
if (!$this->inputBound) {
221+
try {
222+
$input->bind($this->definition);
223+
} catch (ExceptionInterface $e) {
224+
if (!$this->ignoreValidationErrors) {
225+
throw $e;
226+
}
224227
}
225228
}
226229

@@ -649,6 +652,14 @@ public function getHelper($name)
649652
return $this->helperSet->get($name);
650653
}
651654

655+
/**
656+
* @internal
657+
*/
658+
public function setInputBound($inputBound)
659+
{
660+
$this->inputBound = $inputBound;
661+
}
662+
652663
/**
653664
* Validates a command name.
654665
*

src/Symfony/Component/Console/Tests/ApplicationTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,31 @@ public function testRunWithDispatcherAddingInputOptions()
11021102
$this->assertEquals('some test value', $extraValue);
11031103
}
11041104

1105+
public function testUpdateInputFromConsoleCommandEvent()
1106+
{
1107+
$dispatcher = $this->getDispatcher();
1108+
$dispatcher->addListener('console.command', function (ConsoleCommandEvent $event) {
1109+
$event->getInput()->setOption('extra', 'overriden');
1110+
});
1111+
1112+
$application = new Application();
1113+
$application->setDispatcher($dispatcher);
1114+
$application->setAutoExit(false);
1115+
1116+
$application
1117+
->register('foo')
1118+
->addOption('extra', null, InputOption::VALUE_REQUIRED)
1119+
->setCode(function (InputInterface $input, OutputInterface $output) {
1120+
$output->write('foo.');
1121+
})
1122+
;
1123+
1124+
$tester = new ApplicationTester($application);
1125+
$tester->run(array('command' => 'foo', '--extra' => 'original'));
1126+
1127+
$this->assertEquals('overriden', $tester->getInput()->getOption('extra'));
1128+
}
1129+
11051130
/**
11061131
* @group legacy
11071132
*/

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 2 additions & 1 deletion
7C73
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,8 @@ public function dumpFile($filename, $content)
646646
throw new IOException(sprintf('Failed to write file "%s".', $filename), 0, null, $filename);
647647
}
648648

649-
@chmod($tmpFile, 0666 & ~umask());
649+
@chmod($tmpFile, file_exists($filename) ? fileperms($filename) : 0666 & ~umask());
650+
650651
$this->rename($tmpFile, $filename, true);
651652
}
652653

0 commit comments

Comments
 (0)
0