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

Skip to content
8000

Commit 0fc170a

Browse files
Merge branch '4.4'
* 4.4: 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 d400aeb + ba784bf commit 0fc170a

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
@@ -470,12 +470,6 @@ private function addSessionSection(ArrayNodeDefinition $rootNode)
470470
$rootNode
471471
->children()
472472
->arrayNode('session')
473-
->validate()
474-
->ifTrue(function ($v) {
475-
return empty($v['handler_id']) && !empty($v['save_path']);
476-
})
477-
->thenInvalid('Session save path is ignored without a handler service')
478-
->end()
479473
->info('session configuration')
480474
->canBeEnabled()
481475
->children()
@@ -501,7 +495,7 @@ private function addSessionSection(ArrayNodeDefinition $rootNode)
501495
->scalarNode('gc_divisor')->end()
502496
->scalarNode('gc_probability')->defaultValue(1)->end()
503497
->scalarNode('gc_maxlifetime')->end()
504-
->scalarNode('save_path')->end()
498+
->scalarNode('save_path')->defaultValue('%kernel.cache_dir%/sessions')->end()
505499
->integerNode('metadata_update_threshold')
506500
->defaultValue(0)
507501
->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
@@ -867,22 +867,13 @@ private function registerSessionConfiguration(array $config, ContainerBuilder $c
867867

868868
// session handler (the internal callback registered with PHP session management)
869869
if (null === $config['handler_id']) {
870-
// If the user set a save_path without using a non-default \SessionHandler, it will silently be ignored
871-
if (isset($config['save_path'])) {
872-
throw new LogicException('Session save path is ignored without a handler service');
873-
}
874-
875870
// Set the handler class to be null
876871
$container->getDefinition('session.storage.native')->replaceArgument(1, null);
877872
$container->getDefinition('session.storage.php_bridge')->replaceArgument(0, null);
878873
} else {
879874
$container->setAlias('session.handler', $config['handler_id'])->setPrivate(true);
880875
}
881876

882-
if (!isset($config['save_path'])) {
883-
$config['save_path'] = ini_get('session.save_path');
884-
}
885-
886877
$container->setParameter('session.save_path', $config['save_path']);
887878

888879
$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
@@ -278,6 +278,7 @@ protected static function getBundleDefaultConfig()
278278
'cookie_httponly' => true,
279279
'cookie_samesite' => null,
280280
'gc_probability' => 1,
281+
'save_path' => '%kernel.cache_dir%/sessions',
281282
'metadata_update_threshold' => 0,
282283
],
283284
'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
@@ -499,12 +499,6 @@ public function testNullSessionHandler()
499499
$this->assertEquals($expected, array_keys($container->getDefinition('session_listener')->getArgument(0)->getValues()));
500500
}
501501

502-
public function testNullSessionHandlerWithSavePath()
503-
{
504-
$this->expectException('Symfony\Component\Config\Definition\Exception\InvalidConfigurationException');
505-
$this->createContainerFromFile('session_savepath');
506-
}
507-
508502
public function testRequest()
509503
{
510504
$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, iterable $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