Skip to content

Remove the profiler.matcher configuration #24159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -185,23 +185,6 @@ private function addProfilerSection(ArrayNodeDefinition $rootNode)
->booleanNode('only_exceptions')->defaultFalse()->end()
->booleanNode('only_master_requests')->defaultFalse()->end()
->scalarNode('dsn')->defaultValue('file:%kernel.cache_dir%/profiler')->end()
->arrayNode('matcher')
->setDeprecated('The "profiler.matcher" configuration key has been deprecated in Symfony 3.4 and it will be removed in 4.0.')
->canBeEnabled()
->performNoDeepMerging()
->fixXmlConfig('ip')
->children()
->scalarNode('path')
->info('use the urldecoded format')
->example('^/path to resource/')
->end()
->scalarNode('service')->end()
->arrayNode('ips')
->beforeNormalization()->ifString()->then(function ($v) { return array($v); })->end()
->prototype('scalar')->end()
->end()
->end()
->end()
->end()
->end()
->end()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,27 +445,6 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $

$container->setParameter('profiler.storage.dsn', $config['dsn']);

if ($this->isConfigEnabled($container, $config['matcher'])) {
if (isset($config['matcher']['service'])) {
$container->setAlias('profiler.request_matcher', $config['matcher']['service'])->setPrivate(true);
} elseif (isset($config['matcher']['ip']) || isset($config['matcher']['path']) || isset($config['matcher']['ips'])) {
$definition = $container->register('profiler.request_matcher', 'Symfony\\Component\\HttpFoundation\\RequestMatcher');
$definition->setPublic(false);

if (isset($config['matcher']['ip'])) {
$definition->addMethodCall('matchIp', array($config['matcher']['ip']));
}

if (isset($config['matcher']['ips'])) {
$definition->addMethodCall('matchIps', array($config['matcher']['ips']));
}

if (isset($config['matcher']['path'])) {
$definition->addMethodCall('matchPath', array($config['matcher']['path']));
}
}
}

if (!$config['collect']) {
$container->getDefinition('profiler')->addMethodCall('disable', array());
}
Expand Down Expand Up @@ -501,9 +480,9 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $

$transitions = array();
foreach ($workflow['transitions'] as $transition) {
if ($type === 'workflow') {
if ('workflow' === $type) {
$transitions[] = new Definition(Workflow\Transition::class, array($transition['name'], $transition['from'], $transition['to']));
} elseif ($type === 'state_machine') {
} elseif ('state_machine' === $type) {
foreach ($transition['from'] as $from) {
foreach ($transition['to'] as $to) {
$transitions[] = new Definition(Workflow\Transition::class, array($transition['name'], $from, $to));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<tag name="kernel.event_subscriber" />
<argument type="service" id="profiler" />
<argument type="service" id="request_stack" />
<argument type="service" id="profiler.request_matcher" on-invalid="null" />
<argument>null</argument>
<argument>%profiler_listener.only_exceptions%</argument>
<argument>%profiler_listener.only_master_requests%</argument>
</service>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,6 @@ protected static function getBundleDefaultConfig()
'only_master_requests' => false,
'dsn' => 'file:%kernel.cache_dir%/profiler',
'collect' => true,
'matcher' => array(
'enabled' => false,
'ips' => array(),
),
),
'translator' => array(
'enabled' => !class_exists(FullStack::class),
Expand Down