Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit307d743

Browse files
[FrameworkBundle] Fix activation strategy of traceable decorators
1 parent94f4d7a commit307d743

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

‎src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

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

1212
namespaceSymfony\Bundle\FrameworkBundle;
1313

14+
useSymfony\Bundle\FrameworkBundle\Console\Application;
1415
useSymfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddDebugLogProcessorPass;
1516
useSymfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AssetsContextPass;
1617
useSymfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ContainerBuilderDebugDumpPass;
@@ -202,6 +203,14 @@ public function build(ContainerBuilder $container): void
202203
}
203204
}
204205

206+
/**
207+
* @internal
208+
*/
209+
publicstaticfunctionconsiderProfilerEnabled():bool
210+
{
211+
return !($GLOBALS['app'] ??null)instanceof Application ||empty($_GET) &&\in_array('--profile',$_SERVER['argv'] ?? [],true);
212+
}
213+
205214
privatefunctionaddCompilerPassIfExists(ContainerBuilder$container,string$class,string$type = PassConfig::TYPE_BEFORE_OPTIMIZATION,int$priority =0):void
206215
{
207216
$container->addResource(newClassExistenceResource($class));

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespaceSymfony\Component\DependencyInjection\Loader\Configurator;
1313

1414
useSymfony\Bundle\FrameworkBundle\EventListener\ConsoleProfilerListener;
15+
useSymfony\Bundle\FrameworkBundle\FrameworkBundle;
1516
useSymfony\Component\HttpKernel\Debug\VirtualRequestStack;
1617
useSymfony\Component\HttpKernel\EventListener\ProfilerListener;
1718
useSymfony\Component\HttpKernel\Profiler\FileProfilerStorage;
@@ -61,7 +62,7 @@
6162
->set('profiler.state_checker', ProfilerStateChecker::class)
6263
->args([
6364
service_locator(['profiler' =>service('profiler')->ignoreOnUninitialized()]),
64-
param('kernel.runtime_mode.web'),
65+
inline_service('bool')->factory([FrameworkBundle::class,'considerProfilerEnabled']),
6566
])
6667

6768
->set('profiler.is_disabled_state_checker','Closure')

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp