8000 Merge branch '4.3' into 4.4 · symfony/symfony@ba784bf · GitHub
[go: up one dir, main page]

Skip to content

Commit ba784bf

Browse files
Merge branch '4.3' into 4.4
* 4.3: Revert "bug #31620 [FrameworkBundle] Inform the user when save_path will be ignored (gnat42)" [Form][PropertyPathMapper] Avoid extra call to get config [HttpKernel] remove unused fixtures
2 parents 47322db + aeba22c commit ba784bf

File tree

18 files changed

+3
-47
lines changed

18 files changed

+3
-47
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -522,12 +522,6 @@ private function addSessionSection(ArrayNodeDefinition $rootNode)
522522
$rootNode
523523
->children()
524524
->arrayNode('session')
525-
->validate()
526-
->ifTrue(function ($v) {
527-
return empty($v['handler_id']) && !empty($v['save_path']);
528-
})
529-
->thenInvalid('Session save path is ignored without a handler service')
530-
->end()
531525
->info('session configuration')
532526
->canBeEnabled()
533527
->children()
@@ -553,7 +547,7 @@ private function addSessionSection(ArrayNodeDefinition $rootNode)
553547
->scalarNode('gc_divisor')->end()
554548
->scalarNode('gc_probability')->defaultValue(1)->end()
555549
->scalarNode('gc_maxlifetime')->end()
556-
->scalarNode('save_path')->end()
550+
->scalarNode('save_path')->defaultValue('%kernel.cache_dir%/sessions')->end()
557551
->integerNode('metadata_update_threshold')
558552
->defaultValue(0)
559553
->info('seconds to wait between 2 session metadata updates')

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -916,22 +916,13 @@ private function registerSessionConfiguration(array $config, ContainerBuilder $c
916916

917917
// session handler (the internal callback registered with PHP session management)
918918
if (null === $config['handler_id']) {
919-
// If the user set a save_path without using a non-default \SessionHandler, it will silently be ignored
920-
if (isset($config['save_path'])) {
921-
throw new LogicException('Session save path is ignored without a handler service');
922-
}
923-
924919
// Set the handler class to be null
925920
$container->getDefinition('session.storage.native')->replaceArgument(1, null);
926921
$container->getDefinition('session.storage.php_bridge')->replaceArgument(0, null);
927922
} else {
928923
$container->setAlias('session.handler', $config['handler_id'])->setPrivate(true);
929924
}
930925

931-
if (!isset($config['save_path'])) {
932-
$config['save_path'] = ini_get('session.save_path');
933-
}
934-
935926
$container->setParameter('session.save_path', $config['save_path']);
936927

937928
$container->setParameter('session.metadata.update_threshold', $config['metadata_update_threshold']);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ protected static function getBundleDefaultConfig()
294294
'cookie_httponly' => true,
295295
'cookie_samesite' => null,
296296
'gc_probability' => 1,
297+
'save_path' => '%kernel.cache_dir%/sessions',
297298
'metadata_update_threshold' => 0,
298299
],
299300
'request' => [

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

Lines changed: 0 additions & 8 deletions
This file was deleted.

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

Lines changed: 0 additions & 12 deletions
This file was deleted.

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

Lines changed: 0 additions & 4 deletions
This file was deleted.

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -554,12 +554,6 @@ public function testNullSessionHandler()
554554
$this->assertEquals($expected, array_keys($container->getDefinition('session_listener')->getArgument(0)->getValues()));
555555
}
556556

557-
public function testNullSessionHandlerWithSavePath()
558-
{
559-
$this->expectException('Symfony\Component\Config\Definition\Exception\InvalidConfigurationException');
560-
$this->createContainerFromFile('session_savepath');
561-
}
562-
563557
public function testRequest()
564558
{
565559
$container = $this->createContainerFromFile('full');

src/Symfony/Component/Form/Extension/Core/DataMapper/PropertyPathMapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function mapDataToForms($data, $forms)
4848
if (!$empty && null !== $propertyPath && $config->getMapped()) {
4949
$form->setData($this->propertyAccessor->getValue($data, $propertyPath));
5050
} else {
51-
$form->setData($form->getConfig()->getData());
51+
$form->setData($config->getData());
5252
}
5353
}
5454
}

src/Symfony/Component/HttpKernel/Tests/Fixtures/BaseBundle/Resources/hide.txt

Whitespace-only changes.

src/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/Resources/foo.txt

Whitespace-only changes.

src/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/bar.txt

Whitespace-only changes.

src/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle2Bundle/foo.txt

Whitespace-only changes.

src/Symfony/Component/HttpKernel/Tests/Fixtures/ChildBundle/Resources/foo.txt

Whitespace-only changes.

src/Symfony/Component/HttpKernel/Tests/Fixtures/ChildBundle/Resources/hide.txt

Whitespace-only changes.

src/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/BaseBundle/hide.txt

Whitespace-only changes.

src/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/Bundle1Bundle/foo.txt

Whitespace-only changes.

src/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/ChildBundle/foo.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)
0