Skip to content

Commit 1f977bb

Browse files
committed
Rename master request to main request
1 parent fa1a626 commit 1f977bb

File tree

9 files changed

+11
-7
lines changed

9 files changed

+11
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ CHANGELOG
1717
* Add support to use a PSR-6 compatible cache for Doctrine annotations
1818
* Deprecate all other values than "none", "php_array" and "file" for `framework.annotation.cache`
1919
* Add `KernelTestCase::getContainer()` as the best way to get a container in tests
20+
* Rename the container parameter `profiler_listener.only_master_requests` to `profiler_listener.only_main_requests`
2021

2122
5.2.0
2223
-----

DependencyInjection/Configuration.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,8 @@ private function addProfilerSection(ArrayNodeDefinition $rootNode)
304304
->children()
305305
->booleanNode('collect')->defaultTrue()->end()
306306
->booleanNode('only_exceptions')->defaultFalse()->end()
307-
->booleanNode('only_master_requests')->defaultFalse()->end()
307+
->booleanNode('only_main_requests')->defaultFalse()->end()
308+
->booleanNode('only_master_requests')->setDeprecated('symfony/framework-bundle', '5.3', 'Option "%node%" at "%path%" is deprecated, use "only_main_requests" instead.')->defaultFalse()->end()
308309
->scalarNode('dsn')->defaultValue('file:%kernel.cache_dir%/profiler')->end()
309310
->end()
310311
->end()

DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $
711711
}
712712

713713
$container->setParameter('profiler_listener.only_exceptions', $config['only_exceptions']);
714-
$container->setParameter('profiler_listener.only_master_requests', $config['only_master_requests']);
714+
$container->setParameter('profiler_listener.only_main_requests', $config['only_main_requests'] || $config['only_master_requests']);
715715

716716
// Choose storage class based on the DSN
717717
[$class] = explode(':', $config['dsn'], 2);

HttpCache/HttpCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function __construct(KernelInterface $kernel, $cache = null, SurrogateInt
6363
parent::__construct($kernel, $this->createStore(), $this->createSurrogate(), array_merge($this->options, $this->getOptions()));
6464
}
6565

66-
public function handle(Request $request, int $type = HttpKernelInterface::MASTER_REQUEST, bool $catch = true)
66+
public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true)
6767
{
6868
if ($this->kernel->getContainer()->getParameter('kernel.http_method_override')) {
6969
Request::enableHttpMethodParameterOverride();

Resources/config/profiling.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
service('request_stack'),
3232
null,
3333
param('profiler_listener.only_exceptions'),
34-
param('profiler_listener.only_master_requests'),
34+
param('profiler_listener.only_main_requests'),
3535
])
3636
->tag('kernel.event_subscriber')
3737
;

Resources/config/schema/symfony-1.0.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
<xsd:complexType name="profiler">
8888
<xsd:attribute name="collect" type="xsd:string" />
8989
<xsd:attribute name="only-exceptions" type="xsd:string" />
90+
<xsd:attribute name="only-main-requests" type="xsd:string" />
9091
<xsd:attribute name="only-master-requests" type="xsd:string" />
9192
<xsd:attribute name="enabled" type="xsd:string" />
9293
<xsd:attribute name="dsn" type="xsd:string" />

Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ protected static function getBundleDefaultConfig()
397397
'enabled' => false,
398398
'only_exceptions' => false,
399399
'only_master_requests' => false,
400+
'only_main_requests' => false,
400401
'dsn' => 'file:%kernel.cache_dir%/profiler',
401402
'collect' => true,
402403
],

Tests/Kernel/MicroKernelTraitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ protected function configureRoutes(RoutingConfigurator $routes): void
122122
};
123123

124124
$request = Request::create('/');
125-
$response = $kernel->handle($request, HttpKernelInterface::MASTER_REQUEST, false);
125+
$response = $kernel->handle($request, HttpKernelInterface::MAIN_REQUEST, false);
126126

127127
$this->assertSame('Hello World!', $response->getContent());
128128
}
@@ -156,7 +156,7 @@ protected function configureContainer(ContainerConfigurator $c): void
156156
$this->expectExceptionMessage('"Symfony\Bundle\FrameworkBundle\Tests\Kernel\MinimalKernel@anonymous" uses "Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait", but does not implement the required method "protected function configureRoutes(RoutingConfigurator $routes): void".');
157157

158158
$request = Request::create('/');
159-
$kernel->handle($request, HttpKernelInterface::MASTER_REQUEST, false);
159+
$kernel->handle($request, HttpKernelInterface::MAIN_REQUEST, false);
160160
}
161161
}
162162

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"symfony/event-dispatcher": "^5.1",
2626
"symfony/error-handler": "^4.4.1|^5.0.1",
2727
"symfony/http-foundation": "^5.3",
28-
"symfony/http-kernel": "^5.2.1",
28+
"symfony/http-kernel": "^5.3",
2929
"symfony/polyfill-mbstring": "~1.0",
3030
"symfony/polyfill-php80": "^1.15",
3131
"symfony/filesystem": "^4.4|^5.0",

0 commit comments

Comments
 (0)