10000 Merge branch '3.0' · symfony/symfony@a4f3baa · GitHub
[go: up one dir, main page]

Skip to content

Commit a4f3baa

Browse files
Merge branch '3.0'
* 3.0: [ClassLoader] Use symfony/polyfill-apcu [HttpFoundation][Cookie] Cookie DateTimeInterface fix bumped Symfony version to 2.8.3 updated VERSION for 2.8.2 updated CHANGELOG for 2.8.2 bumped Symfony version to 2.7.10 updated VERSION for 2.7.9 updated CHANGELOG for 2.7.9 bumped Symfony version to 2.3.38 updated VERSION for 2.3.37 update CONTRIBUTORS for 2.3.37 updated CHANGELOG for 2.3.37 added missing requirement removed obsolete tests, fixed composer.json do not ship with a custom rng implementation [Console] HHVM read input stream bug Fix max width for multibyte keys in choice question [Console] Display console application name even when no version set Remove calls to non-existing method Remove empty statements.
2 parents d46ac31 + 5f41662 commit a4f3baa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+499
-1158
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ before_install:
3636
- echo session.gc_probability = 0 >> $INI_FILE
3737
- if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then echo extension = mongo.so >> $INI_FILE; fi;
3838
- if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then echo extension = memcache.so >> $INI_FILE; fi;
39-
- 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;
40-
- if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then pecl install -f memcached-2.1.0 || echo "Let's continue without memcached extension"; fi;
39+
- if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then (echo yes | pecl install -f apcu-4.0.10 && echo apc.enable_cli = 1 >> $INI_FILE); fi;
40+
- if [[ $TRAVIS_PHP_VERSION = 7.* ]]; then (echo yes | pecl install -f apcu-5.1.2 && echo apc.enable_cli = 1 >> $INI_FILE); fi;
4141
- 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;
42+
- if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then pecl install -f memcached-2.1.0; fi;
4243
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo extension = ldap.so >> $INI_FILE; fi;
4344
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-rm xdebug.ini; fi;
4445
- if [[ $TRAVIS_REPO_SLUG = symfony/symfony ]]; then cp .composer-auth.json ~/.composer/auth.json; fi;

CONTRIBUTORS.md

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,45 +75,45 @@ Symfony is the result of the work of many people who made the code better
7575
- Arnaud Le Blanc (arnaud-lb)
7676
- Tim Nagel (merk)
7777
- Brice BERNARD (brikou)
78+
- Graham Campbell (graham)
7879
- Jérôme Tamarelle (gromnan)
7980
- marc.weistroff
81+
- Michal Piotrowski (eventhorizon)
8082
- lenar
81-
- Graham Campbell (graham)
8283
- Włodzimierz Gajda (gajdaw)
83-
- Michal Piotrowski (eventhorizon)
8484
- Florian Voutzinos (florianv)
8585
- Peter Rehm (rpet)
8686
- Colin Frei
87+
- Dariusz Ruminski
8788
- Adrien Brault (adrienbrault)
8889
- excelwebzone
8990
- Jacob Dreesen (jdreesen)
90-
- Dariusz Ruminski
9191
- Peter Kokot (maastermedia)
9292
- Fabien Pennequin (fabienpennequin)
9393
- Pierre du Plessis (pierredup)
9494
- Alexander Schwenn (xelaris)
9595
- Gordon Franke (gimler)
96+
- Iltar van der Berg (kjarli)
9697
- Robert Schönthal (digitalkaoz)
9798
- Jérémy DERUSSÉ (jderusse)
9899
- Joshua Thijssen
99100
- Stefano Sala (stefano.sala)
100101
- David Buchmann (dbu)
101102
- Issei Murasawa (issei_m)
102-
- Iltar van der Berg (kjarli)
103103
- Juti Noppornpitak (shiroyuki)
104104
- Eric GELOEN (gelo)
105105
- Sebastian Hörl (blogsh)
106106
- Daniel Gomes (danielcsgomes)
107107
- Hidenori Goto (hidenorigoto)
108+
- Vladimir Reznichenko (kalessil)
108109
- Guilherme Blanco (guilhermeblanco)
109110
- Pablo Godel (pgodel)
110-
- Vladimir Reznichenko (kalessil)
111+
- Tigran Azatyan (tigranazatyan)
111112
- Jérémie Augustin (jaugustin)
112113
- Sebastiaan Stok (sstok)
113114
- Rafael Dohms (rdohms)
114115
- Arnaud Kleinpeter (nanocom)
115116
- Alexander M. Turek (derrabus)
116-
- Tigran Azatyan (tigranazatyan)
117117
- Richard Shank (iampersistent)
118118
- Charles Sarrazin (csarrazi)
119119
- Clemens Tolboom
@@ -149,6 +149,7 @@ Symfony is the result of the work of many people who made the code better
149149
- sun (sun)
150150
- Larry Garfield (crell)
151151
- Martin Schuhfuß (usefulthink)
152+
- Jáchym Toušek
152153
- Matthieu Bontemps (mbontemps)
153154
- Pierre Minnieur (pminnieur)
154155
- fivestar
@@ -166,7 +167,6 @@ Symfony is the result of the work of many people who made the code better
166167
- Rui Marinho (ruimarinho)
167168
- Julien Brochet (mewt)
168169
- Sergey Linnik (linniksa)
169-
- Jáchym Toušek
170170
- Marcel Beerta (mazen)
171171
- Vincent AUBERT (vincent)
172172
- julien pauli (jpauli)
@@ -177,6 +177,7 @@ Symfony is the result of the work of many people who made the code better
177177
- Elnur Abdurrakhimov (elnur)
178178
- Manuel Reinhard (sprain)
179179
- Danny Berger (dpb587)
180+
- Diego Saint Esteben (dosten)
180181
- Roman Marintšenko (inori)
181182
- Xavier Montaña Carreras (xmontana)
182183
- Chris Wilkinson (thewilkybarkid)
@@ -207,7 +208,6 @@ Symfony is the result of the work of many people who made the code better
207208
- Ruben Gonzalez (rubenrua)
208209
- Marcos Sánchez
209210
- Kim Hemsø Rasmussen (kimhemsoe)
210-
- Diego Saint Esteben (dosten)
211211
- Tom Van Looy (tvlooy)
212212
- Wouter Van Hecke
213213
- Peter Kruithof (pkruithof)
@@ -237,6 +237,7 @@ Symfony is the result of the work of many people who made the code better
237237
- Jan Decavele (jandc)
238238
- Gustavo Piltcher
239239
- Stepan Tanasiychuk (stfalcon)
240+
- Titouan Galopin (tgalopin)
240241
- Tiago Ribeiro (fixe)
241242
- Bob den Otter (bopp)
242243
- Adrian Rudnik (kreischweide)
@@ -321,6 +322,7 @@ Symfony is the result of the work of many people who made the code better
321322
- Jan Schumann
322323
- Niklas Fiekas
323324
- Mark Challoner (markchalloner)
325+
- Gregor Harlan (gharlan)
324326
- Markus Bachmann (baachi)
325327
- lancergr
326328
- Olivier Dolbeau (odolbeau)
@@ -337,6 +339,7 @@ Symfony is the result of the work of many people who made the code better
337339
- cedric lombardot (cedriclombardot)
338340
- Jonas Flodén (flojon)
339341
- Christian Schmidt
342+
- Jakub Kucharovic (jkucharovic)
340343
- Marcin Sikoń (marphi)
341344
- Dominik Zogg (dominik.zogg)
342345
- Mathieu Lemoine
@@ -396,7 +399,6 @@ Symfony is the result of the work of many people who made the code better
396399
- MatTheCat
397400
- John Bafford (jbafford)
398401
- Denis Gorbachev (starfall)
399-
- Titouan Galopin (tgalopin)
400402
- Steven Surowiec
401403
- Kevin Saliou (kbsali)
402404
- Ryan
@@ -440,7 +442,6 @@ Symfony is the result of the work of many people who made the code better
440442
- Wang Jingyu
441443
- Åsmund Garfors
442444
- Maxime Douailin
443-
- Gregor Harlan
444445
- Michael Hirschler (mvhirsch)
445446
- Javier López (loalf)
446447
- Reinier Kip
@@ -457,7 +458,6 @@ Symfony is the result of the work of many people who made the code better
457458
- Tristan Maindron (tmaindron)
458459
- Ke WANG (yktd26)
459460
- Strate
460-
- Jakub Kucharovic
461461
- Miquel Rodríguez Telep (mrtorrent)
462462
- Sergey Kolodyazhnyy (skolodyazhnyy)
463463
- umpirski
@@ -507,6 +507,7 @@ Symfony is the result of the work of many people who made the code better
507507
- Joshua Nye
508508
- Dave Marshall (davedevelopment)
509509
- avorobiev
510+
- Gladhon
510511
- Venu
511512
- Lars Vierbergen
512513
- Dennis Hotson
@@ -572,6 +573,7 @@ Symfony is the result of the work of many people who made the code better
572573
- Aleksey Podskrebyshev
573574
- Steffen Roßkamp
574575
- David Marín Carreño (davefx)
576+
- Hidde Boomsma (hboomsma)
575577
- Jörn Lang (j.lang)
576578
- mwsaz
577579
- Benoît Bourgeois
@@ -615,6 +617,7 @@ Symfony is the result of the work of many people who made the code better
615617
- Benoît Merlet (trompette)
616618
- Koen Kuipers
617619
- datibbaw
620+
- Sébastien Santoro
618621
- Raul Fraile (raulfraile)
619622
- sensio
620623
- Patrick Kaufmann
@@ -686,6 +689,7 @@ Symfony is the result of the work of many people who made the code better
686689
- Max Beutel
687690
- Michal Trojanowski
688691
- Catalin Dan
692+
- Mihai Stancu
689693
- nacho
690694
- Piotr Antosik (antek88)
691695
- Artem Lopata
@@ -698,6 +702,7 @@ Symfony is the result of the work of many people who made the code better
698702
- Max Grigorian (maxakawizard)
699703
- benatespina (benatespina)
700704
- Denis Kop
705+
- EdgarPE
701706
- jfcixmedia
702707
- Martijn Evers
703708
- Benjamin Paap (benjaminpaap)
@@ -980,6 +985,7 @@ Symfony is the result of the work of many people who made the code better
980985
- Michal Gebauer
981986
- Gleb Sidora
982987
- David Stone
988+
- Adrien Lucas (adrienlucas)
983989
- Pablo Maria Martelletti (pmartelletti)
984990
- Yassine Guedidi (yguedidi)
985991
- Luis Muñoz
@@ -1056,6 +1062,7 @@ Symfony is the result of the work of many people who made the code better
10561062
- devel
10571063
- Trevor Suarez
10581064
- gedrox
1065+
- Mathieu MARCHOIS
10591066
- dropfen
10601067
- Andrey Chernykh
10611068
- Edvinas Klovas
@@ -1179,7 +1186,6 @@ Symfony is the result of the work of many people who made the code better
11791186
- srsbiz
11801187
- Taylan Kasap
11811188
- Nicolas A. Bérard-Nault
1182-
- Gladhon
11831189
- Saem Ghani
11841190
- Stefan Oderbolz
11851191
- Curtis
@@ -1233,6 +1239,7 @@ Symfony is the result of the work of many people who made the code better
12331239
- Eric J. Duran
12341240
- cmfcmf
12351241
- Drew Butler
1242+
- pawel-lewtak
12361243
- Steve Müller
12371244
- Andras Ratz
12381245
- andreabreu98
@@ -1260,7 +1267,6 @@ Symfony is the result of the work of many people who made the code better
12601267
- Pierre-Louis LAUNAY
12611268
- djama
12621269
- Eduardo Conceição
1263-
- Sébastien Santoro
12641270
- Jon Cave
12651271
- Sébastien HOUZE
12661272
- Abdulkadir N. A.

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"doctrine/common": "~2.4",
2121
"twig/twig": "~1.23|~2.0",
2222
"psr/log": "~1.0",
23+
"symfony/polyfill-apcu": "~1.0,>=1.0.2",
2324
"symfony/polyfill-intl-icu": "~1.0",
2425
"symfony/polyfill-mbstring": "~1.0",
2526
"symfony/polyfill-php56": "~1.0",

src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/DependencyInjection/FormLoginExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Symfony\Component\DependencyInjection\Reference;
1515
use Symfony\Component\DependencyInjection\ContainerBuilder;
16-
use Symfony\Component\DependencyInjection\Extension\Extension;;
16+
use Symfony\Component\DependencyInjection\Extension\Extension;
1717

1818
class FormLoginExtension extends Extension
1919
{

src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Bundle\WebProfilerBundle\DependencyInjection;
1313

14-
use Symfony\Component\DependencyInjection\Extension\Extension;;
14+
use Symfony\Component\DependencyInjection\Extension\Extension;
1515
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
1616
use Symfony\Component\DependencyInjection\ContainerBuilder;
1717
use Symfony\Component\Config\FileLocator;

src/Symfony/Component/ClassLoader/ApcClassLoader.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ class ApcClassLoader
6767
*/
6868
public function __construct($prefix, $decorated)
6969
{
70-
if (!extension_loaded('apc')) {
71-
throw new \RuntimeException('Unable to use ApcClassLoader as APC is not enabled.');
70+
if (!function_exists('apcu_fetch')) {
71+
throw new \RuntimeException('Unable to use ApcClassLoader as APC is not installed.');
7272
}
7373

7474
if (!method_exists($decorated, 'findFile')) {
@@ -122,8 +122,8 @@ public function loadClass($class)
122122
*/
123123
public function findFile($class)
124124
{
125-
if (false === $file = apc_fetch($this->prefix.$class)) {
126-
apc_store($this->prefix.$class, $file = $this->decorated->findFile($class));
125+
if (false === $file = apcu_fetch($this->prefix.$class)) {
126+
apcu_store($this->prefix.$class, $file = $this->decorated->findFile($class));
127127
}
128128

129129
return $file;

src/Symfony/Component/ClassLoader/Tests/ApcClassLoaderTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ class ApcClassLoaderTest extends \PHPUnit_Framework_TestCase
2121
{
2222
protected function setUp()
2323
{
24-
if (ini_get('apc.enabled') && ini_get('apc.enable_cli')) {
25-
apc_clear_cache('user');
24+
if (!(ini_get('apc.enabled') && ini_get('apc.enable_cli'))) {
25+
$this->markTestSkipped('The apc extension is available, but not enabled.');
2626
} else {
27-
$this->markTestSkipped('APC is not enabled.');
27+
apcu_clear_cache();
2828
}
2929
}
3030

3131
protected function tearDown()
3232
{
3333
if (ini_get('apc.enabled') && ini_get('apc.enable_cli')) {
34-
apc_clear_cache('user');
34+
apcu_clear_cache();
3535
}
3636
}
3737

@@ -42,7 +42,7 @@ public function testConstructor()
4242

4343
$loader = new ApcClassLoader('test.prefix.', $loader);
4444

45-
$this->assertEquals($loader->findFile('\Apc\Namespaced\FooBar'), apc_fetch('test.prefix.\Apc\Namespaced\FooBar'), '__construct() takes a prefix as its first argument');
45+
$this->assertEquals($loader->findFile('\Apc\Namespaced\FooBar'), apcu_fetch('test.prefix.\Apc\Namespaced\FooBar'), '__construct() takes a prefix as its first argument');
4646
}
4747

4848
/**

src/Symfony/Component/ClassLoader/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
],
1818
"minimum-stability": "dev",
1919
"require": {
20-
"php": ">=5.5.9"
20+
"php": ">=5.5.9",
21+
"symfony/polyfill-apcu": "~1.0,>=1.0.2"
2122
},
2223
"require-dev": {
2324
"symfony/finder": "~2.8|~3.0"

src/Symfony/Component/Console/Application.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,12 @@ public function setVersion($version)
306306
*/
307307
public function getLongVersion()
308308
{
309-
if ('UNKNOWN' !== $this->getName() && 'UNKNOWN' !== $this->getVersion()) {
310-
return sprintf('<info>%s</info> version <comment>%s</comment>', $this->getName(), $this->getVersion());
309+
if ('UNKNOWN' !== $this->getName()) {
310+
if ('UNKNOWN' !== $this->getVersion()) {
311+
return sprintf('<info>%s</info> version <comment>%s</comment>', $this->getName(), $this->getVersion());
312+
}
313+
314+
return sprintf('<info>%s</info>', $this->getName());
311315
}
312316

313317
return '<info>Console Tool</info>';

src/Symfony/Component/Console/Helper/QuestionHelper.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,12 @@ protected function writePrompt(OutputInterface $output, Question $question)
156156
$message = $question->getQuestion();
157157

158158
if ($question instanceof ChoiceQuestion) {
159-
$width = max(array_map('strlen', array_keys($question->getChoices())));
159+
$maxWidth = max(array_map(array($this, 'strlen'), array_keys($question->getChoices())));
160160

161161
$messages = (array) $question->getQuestion();
162162
foreach ($question->getChoices() as $key => $value) {
163-
$messages[] = sprintf(" [<info>%-${width}s</info>] %s", $key, $value);
163+
$width = $maxWidth - $this->strlen($key);
164+
$messages[] = ' [<info>'.$key.str_repeat(' ', $width).'</info>] '.$value;
164165
}
165166

166167
$output->writeln($messages);
@@ -434,7 +435,7 @@ private function getShell()
434435
private function readFromInput($stream)
435436
{
436437
if (STDIN === $stream && function_exists('readline')) {
437-
$ret = readline();
438+
$ret = readline('');
438439
} else {
439440
$ret = fgets($stream, 4096);
440441
}

src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Console\Tests\Helper;
1313

14+
use Symfony\Component\Console\Formatter\OutputFormatter;
1415
use Symfony\Component\Console\Helper\QuestionHelper;
1516
use Symfony\Component\Console\Helper\HelperSet;
1617
use Symfony\Component\Console\Helper\FormatterHelper;
@@ -350,6 +351,34 @@ public function testNoInteraction()
350351
$this->assertEquals('not yet', $dialog->ask($this->createInputInterfaceMock(false), $this->createOutputInterface(), $question));
351352
}
352353

354+
public function testChoiceOutputFormattingQuestionForUtf8Keys()
355+
{
356+
$question = 'Lorem ipsum?';
357+
$possibleChoices = array(
358+
'foo' => 'foo',
359+
'żółw' => 'bar',
360+
'łabądź' => 'baz',
361+
);
362+
$outputShown = array(
363+
$question,
364+
' [<info>foo </info>] foo',
365+
' [<info>żółw </info>] bar',
366+
' [<info>łabądź</info>] baz',
367+
);
368+
$output = $this->getMock('\Symfony\Component\Console\Output\OutputInterface');
369+
$output->method('getFormatter')->willReturn(new OutputFormatter());
370+
371+
$dialog = new QuestionHelper();
372+
$dialog->setInputStream($this->getInputStream("\n"));
373+
$helperSet = new HelperSet(array(new FormatterHelper()));
374+
$dialog->setHelperSet($helperSet);
375+
376+
$output->expects($this->once())->method('writeln')->with($this->equalTo($outputShown));
377+
378+
$question = new ChoiceQuestion($question, $possibleChoices, 'foo');
379+
$dialog->ask($this->createInputInterfaceMock(), $output, $question);
380+
}
381+
353382
protected function getInputStream($input)
354383
{
355384
$stream = fopen('php://memory', 'r+', false);

0 commit comments

Comments
 (0)
0