Skip to content

Commit 79f841c

Browse files
Merge branch '7.0' into 7.1
* 7.0: [FrameworkBundle] Add TemplateController to the list of allowed controllers for fragments [Cache][Lock] Fix PDO store not creating table + add tests Closes symfony#51936-Added Missing translations for Czech (cs) in validators.cs.xlf file Added missing translations in turkish and updated validators.tr.xlf [Serializer] Fix denormalizing date intervals having both weeks and days [Validator] updated Turkish translation [Serializer] Remove wrong final tags [Serializer] Fix denormalize constructor arguments Add some more non-countable English nouns Add hint that changing input arguments has no effect register the virtual request stack together with common profiling services Don't lose checkpoint state when lock is acquired from another [DomCrawler] Revert "bug symfony#52579 UriResolver support path with colons" [DoctrineBridge] Fix use "attribute" driver by default [VarExporter] Fix handling mangled property names returned by __sleep() Update Github template for 7.1 [WebProfilerBundle] Mark CodeExtension as non-internal Fix memory limit in PhpSubprocess unit test
2 parents 5689df4 + 28cc56d commit 79f841c

File tree

43 files changed

+430
-113
lines changed

Some content is hidden

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

43 files changed

+430
-113
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
| Q | A
22
| ------------- | ---
3-
| Branch? | 6.4 for features / 5.4 or 6.3 for bug fixes <!-- see below -->
3+
| Branch? | 7.1 for features / 5.4, 6.3, 6.4, or 7.0 for bug fixes <!-- see below -->
44
| Bug fix? | yes/no
55
| New feature? | yes/no <!-- please update src/**/CHANGELOG.md files -->
66
| Deprecations? | yes/no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->

src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ protected function loadMappingInformation(array $objectManager, ContainerBuilder
9090
if (!$mappingConfig) {
9191
continue;
9292
}
93-
} else {
94-
$mappingConfig['type'] ??= 'attribute';
93+
} elseif (!$mappingConfig['type']) {
94+
$mappingConfig['type'] = 'attribute';
9595
}
9696

9797
$this->assertValidMappingConfiguration($mappingConfig, $objectManager['name']);

src/Symfony/Bundle/FrameworkBundle/Console/Application.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI
107107
}
108108

109109
(new SymfonyStyle($input, $output))->warning('The "--profile" option needs the Stopwatch component. Try running "composer require symfony/stopwatch".');
110+
} elseif (!$container->has('.virtual_request_stack')) {
111+
if ($output instanceof ConsoleOutputInterface) {
112+
$output = $output->getErrorOutput();
113+
}
114+
115+
(new SymfonyStyle($input, $output))->warning('The "--profile" option needs the profiler integration. Try enabling the "framework.profiler" option.');
110116
} else {
111117
$command = new TraceableCommand($command, $container->get('debug.stopwatch'));
112118

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection;
13+
14+
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
15+
use Symfony\Component\DependencyInjection\ContainerBuilder;
16+
use Symfony\Component\DependencyInjection\Reference;
17+
18+
class VirtualRequestStackPass implements CompilerPassInterface
19+
{
20+
public function process(ContainerBuilder $container): void
21+
{
22+
if ($container->has('.virtual_request_stack')) {
23+
return;
24+
}
25+
26+
if ($container->hasDefinition('debug.event_dispatcher')) {
27+
$container->getDefinition('debug.event_dispatcher')->replaceArgument(3, new Reference('request_stack', ContainerBuilder::NULL_ON_INVALID_REFERENCE));
28+
}
29+
30+
if ($container->hasDefinition('debug.log_processor')) {
31+
$container->getDefinition('debug.log_processor')->replaceArgument(0, new Reference('request_stack'));
32+
}
33+
}
34+
}

src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\TestServiceContainerRealRefPass;
2121
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\TestServiceContainerWeakRefPass;
2222
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\UnusedTagsPass;
23+
use Symfony\Bundle\FrameworkBundle\DependencyInjection\VirtualRequestStackPass;
2324
use Symfony\Component\Cache\Adapter\ApcuAdapter;
2425
use Symfony\Component\Cache\Adapter\ArrayAdapter;
2526
use Symfony\Component\Cache\Adapter\ChainAdapter;
@@ -171,6 +172,7 @@ public function build(ContainerBuilder $container): void
171172
$container->addCompilerPass(new RemoveUnusedSessionMarshallingHandlerPass());
172173
// must be registered after MonologBundle's LoggerChannelPass
173174
$container->addCompilerPass(new ErrorLoggerCompilerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -32);
175+
$container->addCompilerPass(new VirtualRequestStackPass());
174176

175177
if ($container->getParameter('kernel.debug')) {
176178
$container->addCompilerPass(new AddDebugLogProcessorPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 2);

src/Symfony/Bundle/FrameworkBundle/Resources/config/debug.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Symfony\Component\HttpKernel\Controller\TraceableArgumentResolver;
1616
use Symfony\Component\HttpKernel\Controller\TraceableControllerResolver;
1717
use Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher;
18-
use Symfony\Component\HttpKernel\Debug\VirtualRequestStack;
1918

2019
return static function (ContainerConfigurator $container) {
2120
$container->services()
@@ -47,9 +46,5 @@
4746
->set('argument_resolver.not_tagged_controller', NotTaggedControllerValueResolver::class)
4847
->args([abstract_arg('Controller argument, set in FrameworkExtension')])
4948
->tag('controller.argument_value_resolver', ['priority' => -200])
50-
51-
->set('.virtual_request_stack', VirtualRequestStack::class)
52-
->args([service('request_stack')])
53-
->public()
5449
;
5550
};

src/Symfony/Bundle/FrameworkBundle/Resources/config/profiling.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
1313

1414
use Symfony\Bundle\FrameworkBundle\EventListener\ConsoleProfilerListener;
15+
use Symfony\Component\HttpKernel\Debug\VirtualRequestStack;
1516
use Symfony\Component\HttpKernel\EventListener\ProfilerListener;
1617
use Symfony\Component\HttpKernel\Profiler\FileProfilerStorage;
1718
use Symfony\Component\HttpKernel\Profiler\Profiler;
@@ -45,5 +46,9 @@
4546
service('router'),
4647
])
4748
->tag('kernel.event_subscriber')
49+
50+
->set('.virtual_request_stack', VirtualRequestStack::class)
51+
->args([service('request_stack')])
52+
->public()
4853
;
4954
};

src/Symfony/Bundle/FrameworkBundle/Resources/config/web.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
1515
use Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver;
16+
use Symfony\Bundle\FrameworkBundle\Controller\TemplateController;
1617
use Symfony\Component\HttpKernel\Controller\ArgumentResolver;
1718
use Symfony\Component\HttpKernel\Controller\ArgumentResolver\BackedEnumValueResolver;
1819
use Symfony\Component\HttpKernel\Controller\ArgumentResolver\DateTimeValueResolver;
@@ -41,7 +42,7 @@
4142
service('service_container'),
4243
service('logger')->ignoreOnInvalid(),
4344
])
44-
->call('allowControllers', [[AbstractController::class]])
45+
->call('allowControllers', [[AbstractController::class, TemplateController::class]])
4546
->tag('monolog.logger', ['channel' => 'request'])
4647

4748
->set('argument_metadata_factory', ArgumentMetadataFactory::class)

src/Symfony/Bundle/WebProfilerBundle/Profiler/CodeExtension.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
* that is never executed in a production environment.
2323
*
2424
* @author Fabien Potencier <[email protected]>
25-
*
26-
* @internal
2725
*/
2826
final class CodeExtension extends AbstractExtension
2927
{

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,8 @@ private function getServerVersion(): string
375375
return $this->serverVersion;
376376
}
377377

378-
$conn = $this->conn->getWrappedConnection();
378+
// The condition should be removed once support for DBAL <3.3 is dropped
379+
$conn = method_exists($this->conn, 'getNativeConnection') ? $this->conn->getNativeConnection() : $this->conn->getWrappedConnection();
379380
if ($conn instanceof ServerInfoAwareConnection) {
380381
return $this->serverVersion = $conn->getServerVersion();
381382
}

0 commit comments

Comments
 (0)