Skip to content

Commit 6ed73d5

Browse files
Merge branch '3.0'
* 3.0: [Process] Fix stream_select priority when writing to stdin bumped Symfony version to 3.0.5 updated VERSION for 3.0.4 updated CHANGELOG for 3.0.4 [Form] NumberToLocalizedStringTransformer should return floats when possible [Form] remove useless code in ChoiceType [DependencyInjection] Enabled alias for service_container Conflicts: src/Symfony/Component/HttpKernel/Kernel.php src/Symfony/Component/Process/Pipes/AbstractPipes.php
2 parents 26c84dd + c3f0bfe commit 6ed73d5

File tree

10 files changed

+105
-10
lines changed

10 files changed

+105
-10
lines changed

CHANGELOG-3.0.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,66 @@ in 3.0 minor versions.
77
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
88
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v3.0.0...v3.0.1
99

10+
* 3.0.4 (2016-03-30)
11+
12+
* bug #18352 [Debug] Fix case sensitivity checks (nicolas-grekas)
13+
* bug #18336 [Debug] Fix handling of php7 throwables (nicolas-grekas)
14+
* bug #18354 [FrameworkBundle][TwigBridge] fix high deps tests (xabbuh)
15+
* bug #18312 [ClassLoader] Fix storing not-found classes in APC cache (nicolas-grekas)
16+
* bug #18298 [Validator] do not treat payload as callback (xabbuh)
17+
* bug #18275 [Form] Fix BC break introduced in #14403 (HeahDude)
18+
* bug #18271 [FileSystem] Google app engine filesystem (swordbeta)
19+
* bug #18255 [HttpFoundation] Fix support of custom mime types with parameters (Ener-Getick)
20+
* bug #18272 [Bridge\PhpUnit] Workaround old phpunit bug, no colors in weak mode, add tests (nicolas-grekas)
21+
* bug #18259 [PropertyAccess] Backport fixes from 2.7 (nicolas-grekas)
22+
* bug #18261 [PropertyAccess] Fix isPropertyWritable not using the reflection cache (nicolas-grekas)
23+
* bug #18224 [PropertyAccess] Remove most ref mismatches to improve perf (nicolas-grekas)
24+
* bug #18237 [WebProfilerBundle] Added table-layout property to AJAX toolbar css (kevintweber)
25+
* bug #18209 [PropertyInfo] Support Doctrine custom mapping type in DoctrineExtractor (teohhanhui)
26+
* bug #18210 [PropertyAccess] Throw an UnexpectedTypeException when the type do not match (dunglas, nicolas-grekas)
27+
* bug #18216 [Intl] Fix invalid numeric literal on PHP 7 (nicolas-grekas)
28+
* bug #18147 [Validator] EmailValidator cannot extract hostname if email contains multiple @ symbols (natechicago)
29+
* bug #18023 [Process] getIncrementalOutput should work without calling getOutput (romainneutron)
30+
* bug #18175 [Translation] Add support for fuzzy tags in PoFileLoader (nud)
31+
* bug #18179 [Form] Fix NumberToLocalizedStringTransformer::reverseTransform with big integers (ovrflo, nicolas-grekas)
32+
* bug #18164 [HttpKernel] set s-maxage only if all responses are cacheable (xabbuh)
33+
* bug #18150 [Process] Wait a bit less on Windows (nicolas-grekas)
34+
* bug #18130 [Debug] Replaced logic for detecting filesystem case sensitivity (Dan Blows)
35+
* bug #18137 Autowiring the concrete class too - consistent with behavior of other services (weaverryan)
36+
* bug #18087 [WebProfiler] Sidebar button padding (rvanlaak)
37+
* bug #18080 [HttpFoundation] Set the Content-Range header if the requested Range is unsatisfied (jakzal)
38+
* bug #18084 [HttpFoundation] Avoid warnings when checking malicious IPs (jakzal)
39+
* bug #18066 [Process] Fix pipes handling (nicolas-grekas)
40+
* bug #18078 [Console] Fix an autocompletion question helper issue with non-sequentially indexed choices (jakzal)
41+
* bug #18048 [HttpKernel] Fix mem usage when stripping the prod container (nicolas-grekas)
42+
* bug #18065 [Finder] Partially revert #17134 to fix a regression (jakzal)
43+
* bug #18018 [HttpFoundation] exception when registering bags for started sessions (xabbuh)
44+
* bug #18054 [Filesystem] Fix false positive in ->remove() (nicolas-grekas)
45+
* bug #18049 [Validator] Fix the locale validator so it treats a locale alias as a valid locale (jakzal)
46+
* bug #18019 [Intl] Update ICU to version 55 (jakzal)
47+
* bug #18015 [Process] Fix memory issue when using large input streams (romainneutron)
48+
* bug #16656 [HttpFoundation] automatically generate safe fallback filename (xabbuh)
49+
* bug #15794 [Console] default to stderr in the console helpers (alcohol)
50+
* bug #17984 Allow to normalize \Traversable when serializing xml (Ener-Getick)
51+
* bug #17434 Improved the error message when a template is not found (rvanginneken, javiereguiluz)
52+
* bug #17687 Improved the error message when using "@" in a decorated service (javiereguiluz)
53+
* bug #17744 Improve error reporting in router panel of web profiler (javiereguiluz)
54+
* bug #17894 [FrameworkBundle] Fix a regression in handling absolute template paths (jakzal)
55+
* bug #17990 [DoctrineBridge][Form] Fix performance regression in EntityType (kimlai)
56+
* bug #17595 [HttpKernel] Remove _path from query parameters when fragment is a subrequest (cmenning)
57+
* bug #17986 [DomCrawler] Dont use LIBXML_PARSEHUGE by default (nicolas-grekas)
58+
* bug #17668 add 'guid' to list of exception to filter out (garak)
59+
* bug #17615 Ensure backend slashes for symlinks on Windows systems (cpsitgmbh)
60+
* bug #17626 Try to delete broken symlinks (IchHabRecht)
61+
* bug #17978 [Yaml] ensure dump indentation to be greather than zero (xabbuh)
62+
* bug #16886 [Form] [ChoiceType] Prefer placeholder to empty_value (boite)
63+
* bug #17976 [WebProfilerBundle] fix debug toolbar rendering by removing inadvertently added links (craue)
64+
* bug #17971 Variadic controller params (NiR-, fabpot)
65+
* bug #17876 [DependencyInjection] Fixing autowiring bug when some args are set (weaverryan)
66+
* bug #17568 Improved Bootstrap form theme for hidden fields (javiereguiluz)
67+
* bug #17561 [WebProfilerBundle] Fix design issue in profiler when having errors in forms (Pierstoval)
68+
* bug #17925 [Bridge] The WebProcessor now forwards the client IP (magnetik)
69+
1070
* 3.0.3 (2016-02-28)
1171

1272
* bug #17919 #17676 - making the proxy instantiation compatible with ProxyManager 2.x by detecting proxy features (Ocramius)

src/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ public function process(ContainerBuilder $container)
4242
foreach ($container->getAliases() as $id => $alias) {
4343
$aliasId = (string) $alias;
4444

45+
if ('service_container' === $aliasId) {
46+
continue;
47+
}
48+
4549
try {
4650
$definition = $container->getDefinition($aliasId);
4751
} catch (InvalidArgumentException $e) {

src/Symfony/Component/DependencyInjection/Tests/Compiler/ReplaceAliasByActualDefinitionPassTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public function testProcess()
3434
$container->setAlias('a_alias', 'a');
3535
$container->setAlias('b_alias', 'b');
3636

37+
$container->setAlias('container', 'service_container');
38+
3739
$this->process($container);
3840

3941
$this->assertTrue($container->has('a'), '->process() does nothing to public definitions.');
@@ -44,6 +46,8 @@ public function testProcess()
4446
'->process() replaces alias to actual.'
4547
);
4648

49+
$this->assertTrue($container->has('container'));
50+
4751
$resolvedFactory = $aDefinition->getFactory(false);
4852
$this->assertSame('b_alias', (string) $resolvedFactory[0]);
4953
}

src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ public function reverseTransform($value)
181181
throw new TransformationFailedException('I don\'t have a clear idea what infinity looks like');
182182
}
183183

184+
if (is_int($result) && $result === (int) $float = (float) $result) {
185+
$result = $float;
186+
}
187+
184188
if (false !== $encoding = mb_detect_encoding($value, null, true)) {
185189
$length = mb_strlen($value, $encoding);
186190
$remainder = mb_substr($value, $position, $length, $encoding);

src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ public function configureOptions(OptionsResolver $resolver)
345345
$resolver->setAllowedTypes('choice_value', array('null', 'callable', 'string', 'Symfony\Component\PropertyAccess\PropertyPath'));
346346
$resolver->setAllowedTypes('choice_attr', array('null', 'array', 'callable', 'string', 'Symfony\Component\PropertyAccess\PropertyPath'));
347347
$resolver->setAllowedTypes('preferred_choices', array('array', '\Traversable', 'callable', 'string', 'Symfony\Component\PropertyAccess\PropertyPath'));
348-
$resolver->setAllowedTypes('group_by', array('null', 'array', '\Traversable', 'callable', 'string', 'Symfony\Component\PropertyAccess\PropertyPath'));
348+
$resolver->setAllowedTypes('group_by', array('null', 'callable', 'string', 'Symfony\Component\PropertyAccess\PropertyPath'));
349349
}
350350

351351
/**
@@ -428,12 +428,6 @@ private function createChoiceList(array $options)
428428

429429
private function createChoiceListView(ChoiceListInterface $choiceList, array $options)
430430
{
431-
// If no explicit grouping information is given, use the structural
432-
// information from the "choices" option for creating groups
433-
if (!$options['group_by'] && $options['choices']) {
434-
$options['group_by'] = $options['choices'];
435-
}
436-
437431
return $this->choiceListFactory->createView(
438432
$choiceList,
439433
$options['preferred_choices'],

src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,10 +637,17 @@ public function testReverseTransformDisallowsTrailingExtraCharactersMultibyte()
637637
$transformer->reverseTransform("12\xc2\xa0345,678foo");
638638
}
639639

640-
public function testReverseTransformBigint()
640+
public function testReverseTransformBigInt()
641641
{
642642
$transformer = new NumberToLocalizedStringTransformer(null, true);
643643

644644
$this->assertEquals(PHP_INT_MAX - 1, (int) $transformer->reverseTransform((string) (PHP_INT_MAX - 1)));
645645
}
646+
647+
public function testReverseTransformSmallInt()
648+
{
649+
$transformer = new NumberToLocalizedStringTransformer(null, true);
650+
651+
$this->assertSame(1.0, $transformer->reverseTransform('1'));
652+
}
646653
}

src/Symfony/Component/Process/Pipes/AbstractPipes.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ protected function write()
120120
return array($this->pipes[0]);
121121
}
122122
}
123+
123124
if ($input) {
124125
for (;;) {
125126
$data = fread($input, self::CHUNK_SIZE);

src/Symfony/Component/Process/Process.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public function __construct($commandline, $cwd = null, array $env = null, $input
158158
$this->setEnv($env);
159159
}
160160

161-
$this->input = $input;
161+
$this->setInput($input);
162162
$this->setTimeout($timeout);
163163
$this->useFileHandles = '\\' === DIRECTORY_SEPARATOR;
164164
$this->pty = false;

src/Symfony/Component/Process/ProcessUtils.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public static function escapeArgument($argument)
8080
* @param string $caller The name of method call that validates the input
8181
* @param mixed $input The input to validate
8282
*
83-
* @return string The validated input
83+
* @return mixed The validated input
8484
*
8585
* @throws InvalidArgumentException In case the input is not valid
8686
*/
@@ -90,6 +90,9 @@ public static function validateInput($caller, $input)
9090
if (is_resource($input)) {
9191
return $input;
9292
}
93+
if (is_string($input)) {
94+
return $input;
95+
}
9396
if (is_scalar($input)) {
9497
return (string) $input;
9598
}

src/Symfony/Component/Process/Tests/ProcessTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,24 @@ public function testSetStreamAsInput($code, $size)
209209
$this->assertEquals($expectedLength, strlen($p->getErrorOutput()));
210210
}
211211

212+
public function testLiveStreamAsInput()
213+
{
214+
$stream = fopen('php://memory', 'r+');
215+
fwrite($stream, 'hello');
216+
rewind($stream);
217+
218+
$p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('stream_copy_to_stream(STDIN, STDOUT);')));
219+
$p->setInput($stream);
220+
$p->start(function ($type, $data) use ($stream) {
221+
if ('hello' === $data) {
222+
fclose($stream);
223+
}
224+
});
225+
$p->wait();
226+
227+
$this->assertSame('hello', $p->getOutput());
228+
}
229+
212230
/**
213231
* @expectedException \Symfony\Component\Process\Exception\LogicException
214232
* @expectedExceptionMessage Input can not be set while the process is running.

0 commit comments

Comments
 (0)