Skip to content

Commit b6bbe43

Browse files
Merge branch '3.1'
* 3.1: [TwigBundle] Removed redundant return statement. enable property info [Cache] Fix default lifetime being ignored [DependencyInjection] Fixed deprecated default message template with XML Reference the actual location of the documentation [TwigBridge] Removed extra arguments in 2 places. [Cache] Fix incorrect timestamps generated by FilesystemAdapter [Process] Fix write access check for pipes on Windows [HttpKernel] Use flock() for HttpCache's lock files Conflicts: src/Symfony/Component/Cache/Adapter/FilesystemAdapter.php
2 parents c7fa99e + 75ebbf8 commit b6bbe43

File tree

28 files changed

+206
-90
lines changed

28 files changed

+206
-90
lines changed

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

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

1212
namespace Symfony\Bridge\Twig\Extension;
1313

14-
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
1514
use Symfony\Component\Security\Http\Logout\LogoutUrlGenerator;
1615

1716
/**
@@ -48,7 +47,7 @@ public function getFunctions()
4847
*/
4948
public function getLogoutPath($key = null)
5049
{
51-
return $this->generator->getLogoutPath($key, UrlGeneratorInterface::ABSOLUTE_PATH);
50+
return $this->generator->getLogoutPath($key);
5251
}
5352

5453
/**
@@ -60,7 +59,7 @@ public function getLogoutPath($key = null)
6059
*/
6160
public function getLogoutUrl($key = null)
6261
{
63-
return $this->generator->getLogoutUrl($key, UrlGeneratorInterface::ABSOLUTE_URL);
62+
return $this->generator->getLogoutUrl($key);
6463
}
6564

6665
/**

src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<argument type="service" id="serializer.mapping.class_metadata_factory" />
2222
<argument>null</argument> <!-- name converter -->
2323
<argument type="service" id="serializer.property_accessor" />
24+
<argument type="service" id="property_info" on-invalid="ignore" />
2425

2526
<!-- Run after all custom serializers -->
2627
<tag name="serializer.normalizer" priority="-1000" />

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
'enable_annotations' => true,
6969
'name_converter' => 'serializer.name_converter.camel_case_to_snake_case',
7070
),
71+
'property_info' => true,
7172
'ide' => 'file%%link%%format',
7273
'request' => array(
7374
'formats' => array(

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@
4141
<framework:validation enabled="true" cache="validator.mapping.cache.doctrine.apc" />
4242
<framework:annotations cache="file" debug="true" file-cache-dir="%kernel.cache_dir%/annotations" />
4343
<framework:serializer enabled="true" enable-annotations="true" name-converter="serializer.name_converter.camel_case_to_snake_case" />
44+
<framework:property-info />
4445
</framework:config>
4546
</container>

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ framework:
5353
enabled: true
5454
enable_annotations: true
5555
name_converter: serializer.name_converter.camel_case_to_snake_case
56+
property_info: ~
5657
ide: file%%link%%format
5758
request:
5859
formats:

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ public function testSerializerEnabled()
469469
$this->assertEquals('Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader', $argument[0]->getClass());
470470
$this->assertNull($container->getDefinition('serializer.mapping.class_metadata_factory')->getArgument(1));
471471
$this->assertEquals(new Reference('serializer.name_converter.camel_case_to_snake_case'), $container->getDefinition('serializer.normalizer.object')->getArgument(1));
472+
$this->assertEquals(new Reference('property_info', ContainerBuilder::IGNORE_ON_INVALID_REFERENCE), $container->getDefinition('serializer.normalizer.object')->getArgument(3));
472473
}
473474

474475
public function testRegisterSerializerExtractor()

src/Symfony/Bundle/TwigBundle/Tests/Loader/FilesystemLoaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function testExists()
4848
;
4949
$loader = new FilesystemLoader($locator, $parser);
5050

51-
return $this->assertTrue($loader->exists($template));
51+
$this->assertTrue($loader->exists($template));
5252
}
5353

5454
/**

src/Symfony/Component/Cache/Adapter/AbstractAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function ($deferred, $namespace, &$expiredIds) {
5656

5757
foreach ($deferred as $key => $item) {
5858
if (null === $item->expiry) {
59-
$byLifetime[0][$namespace.$key] = $item->value;
59+
$byLifetime[0 < $item->defaultLifetime ? $item->defaultLifetime : 0][$namespace.$key] = $item->value;
6060
} elseif ($item->expiry > $now) {
6161
$byLifetime[$item->expiry - $now][$namespace.$key] = $item->value;
6262
} else {

src/Symfony/Component/Cache/Adapter/ArrayAdapter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ public function save(CacheItemInterface $item)
151151
return false;
152152
}
153153
}
154+
if (null === $expiry && 0 < $item["\0*\0defaultLifetime"]) {
155+
$expiry = time() + $item["\0*\0defaultLifetime"];
156+
}
154157

155158
$this->values[$key] = $value;
156159
$this->expiries[$key] = null !== $expiry ? $expiry : PHP_INT_MAX;

src/Symfony/Component/Cache/Adapter/FilesystemAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected function doHave($id)
7171
protected function doSave(array $values, $lifetime)
7272
{
7373
$ok = true;
74-
$expiresAt = $lifetime ? time() + $lifetime : PHP_INT_MAX;
74+
$expiresAt = time() + ($lifetime ?: 31557600); // 31557600s = 1 year
7575

7676
foreach ($values as $id => $value) {
7777
$ok = $this->write($this->getFile($id, true), $expiresAt."\n".rawurlencode($id)."\n".serialize($value), $expiresAt) && $ok;

0 commit comments

Comments
 (0)