Skip to content

Commit 6a63cc5

Browse files
committed
Merge branch '2.6' into 2.7
* 2.6: Extract an AbstractEventDispatcherTest from EventDispatcherTest and also use it in ContainerAwareEventDispatcherTest [SecurityBundle] Authentication entry point is only registered with firewall exception listener, not with authentication listeners be smarter when guessing the document root Azerbaijani locale Fixed grammar error in docblock [HttpKernel] fix parse error in DumpDataCollector [TwigBundle/DebugBundle] move dump extension & cleanups Adjust upgrade file rendering [Bridge/Propel1] Changed deps to accepts all upcoming propel1 versions compare version using PHP_VERSION_ID [Form] Add doc for FormEvents *_timezone changes also affect the BirthdayType don't override internal PHP constants Drop support for model_timezone and view_timezone options in TimeType and DateType. [DomCrawler] Added support for link tags in the Link class [Session] Fix parameter names in WriteCheckSessionHandler Add consistency with request type checking [FrameworkBundle] Fix server run in case the router script does not exist
2 parents 69b07e9 + f288a69 commit 6a63cc5

File tree

80 files changed

+1312
-733
lines changed

Some content is hidden

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

80 files changed

+1312
-733
lines changed

UPGRADE-3.0.md

Lines changed: 85 additions & 74 deletions
Large diffs are not rendered by default.

autoload.php.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
if (version_compare(PHP_VERSION, '5.4', '>=') && gc_enabled()) {
3+
if (PHP_VERSION_ID >= 50400 && gc_enabled()) {
44
// Disabling Zend Garbage Collection to prevent segfaults with PHP5.4+
55
// https://bugs.php.net/bug.php?id=53976
66
gc_disable();

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"doctrine/orm": "~2.2,>=2.2.3",
7474
"doctrine/doctrine-bundle": "~1.2",
7575
"monolog/monolog": "~1.11",
76-
"propel/propel1": "1.6.*",
76+
"propel/propel1": "~1.6",
7777
"ircmaxell/password-compat": "1.0.*",
7878
"ocramius/proxy-manager": ">=0.3.1,<0.6-dev",
7979
"egulias/email-validator": "~1.2"

src/Symfony/Bridge/Propel1/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"symfony/http-foundation": "~2.0",
2121
"symfony/http-kernel": "~2.0",
2222
"symfony/form": "~2.2",
23-
"propel/propel1": "1.6.*"
23+
"propel/propel1": "~1.6"
2424
},
2525
"require-dev": {
2626
"symfony/stopwatch": "~2.2"

src/Symfony/Bridge/Twig/Extension/CodeExtension.php

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

1212
namespace Symfony\Bridge\Twig\Extension;
1313

14-
if (!defined('ENT_SUBSTITUTE')) {
15-
define('ENT_SUBSTITUTE', 8);
16-
}
17-
1814
/**
1915
* Twig extension relate to PHP code and used by the profiler and the default exception templates.
2016
*
@@ -178,7 +174,13 @@ public function formatFile($file, $line, $text = null)
178174
$text = "$text at line $line";
179175

180176
if (false !== $link = $this->getFileLink($file, $line)) {
181-
return sprintf('<a href="%s" title="Click to open this file" class="file_link">%s</a>', htmlspecialchars($link, ENT_QUOTES | ENT_SUBSTITUTE, $this->charset), $text);
177+
if (PHP_VERSION_ID >= 50400) {
178+
$flags = ENT_QUOTES | ENT_SUBSTITUTE;
179+
} else {
180+
$flags = ENT_QUOTES;
181+
}
182+
183+
return sprintf('<a href="%s" title="Click to open this file" class="file_link">%s</a>', htmlspecialchars($link, $flags, $this->charset), $text);
182184
}
183185

184186
return $text;

src/Symfony/Bridge/Twig/Extension/DumpExtension.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
*/
2323
class DumpExtension extends \Twig_Extension
2424
{
25-
public function __construct(ClonerInterface $cloner = null)
25+
private $cloner;
26+
27+
public function __construct(ClonerInterface $cloner)
2628
{
2729
$this->cloner = $cloner;
2830
}
@@ -46,7 +48,7 @@ public function getName()
4648

4749
public function dump(\Twig_Environment $env, $context)
4850
{
49-
if (!$env->isDebug() || !$this->cloner) {
51+
if (!$env->isDebug()) {
5052
return;
5153
}
5254

@@ -64,17 +66,14 @@ public function dump(\Twig_Environment $env, $context)
6466
unset($vars[0], $vars[1]);
6567
}
6668

67-
$html = '';
68-
$dumper = new HtmlDumper(function ($line, $depth) use (&$html) {
69-
if (-1 !== $depth) {
70-
$html .= str_repeat(' ', $depth).$line."\n";
71-
}
72-
});
69+
$dump = fopen('php://memory', 'r+b');
70+
$dumper = new HtmlDumper($dump);
7371

7472
foreach ($vars as $value) {
7573
$dumper->dump($this->cloner->cloneVar($value));
7674
}
75+
rewind($dump);
7776

78-
return $html;
77+
return stream_get_contents($dump);
7978
}
8079
}

src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function testCompile()
6666

6767
protected function getVariableGetter($name)
6868
{
69-
if (version_compare(phpversion(), '5.4.0RC1', '>=')) {
69+
if (PHP_VERSION_ID >= 50400) {
7070
return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name);
7171
}
7272

src/Symfony/Bridge/Twig/Tests/Node/SearchAndRenderBlockNodeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public function testCompileLabelWithLabelThatEvaluatesToNullAndAttributes()
263263

264264
protected function getVariableGetter($name)
265265
{
266-
if (version_compare(phpversion(), '5.4.0RC1', '>=')) {
266+
if (PHP_VERSION_ID >= 50400) {
267267
return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name);
268268
}
269269

src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testCompileStrict()
3838
}
3939
protected function getVariableGetterWithoutStrictCheck($name)
4040
{
41-
if (version_compare(phpversion(), '5.4.0RC1', '>=')) {
41+
if (PHP_VERSION_ID >= 50400) {
4242
return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name);
4343
}
4444

@@ -47,7 +47,7 @@ protected function getVariableGetterWithoutStrictCheck($name)
4747

4848
protected function getVariableGetterWithStrictCheck($name)
4949
{
50-
if (version_compare(phpversion(), '5.4.0RC1', '>=')) {
50+
if (PHP_VERSION_ID >= 50400) {
5151
return sprintf('(isset($context["%s"]) ? $context["%s"] : $this->getContext($context, "%s"))', $name, $name, $name);
5252
}
5353

src/Symfony/Bundle/DebugBundle/Resources/config/services.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
66

77
<services>
8+
<service id="twig.extension.dump" class="Symfony\Bridge\Twig\Extension\DumpExtension" public="false">
9+
<tag name="twig.extension" />
10+
<argument type="service" id="var_dumper.cloner" />
11+
</service>
12+
813
<service id="data_collector.dump" class="Symfony\Component\HttpKernel\DataCollector\DumpDataCollector">
914
<tag name="data_collector" id="dump" template="@Debug/Profiler/dump.html.twig" />
1015
<argument type="service" id="debug.stopwatch" on-invalid="ignore" />

0 commit comments

Comments
 (0)