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

Appearance settings

Commit 2925df5

Browse filesBrowse files
committed
[HttpKernel] removed deprecated profiler storages
1 parent a3b921d commit 2925df5
Copy full SHA for 2925df5

22 files changed

+265
-3137
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
+1-44Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -173,50 +173,7 @@ private function addProfilerSection(ArrayNodeDefinition $rootNode)
173173
->booleanNode('collect')->defaultTrue()->end()
174174
->booleanNode('only_exceptions')->defaultFalse()->end()
175175
->booleanNode('only_master_requests')->defaultFalse()->end()
176-
->scalarNode('dsn')
177-
->defaultValue('file:%kernel.cache_dir%/profiler')
178-
->beforeNormalization()
179-
->ifTrue(function ($v) { return 'file:' !== substr($v, 0, 5); })
180-
->then(function ($v) {
181-
@trigger_error('The profiler.dsn configuration key must start with "file:" because all the storages except the filesystem are deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
182-
183-
return $v;
184-
})
185-
->end()
186-
->end()
187-
->scalarNode('username')
188-
->defaultValue('')
189-
->beforeNormalization()
190-
->always()
191-
->then(function ($v) {
192-
@trigger_error('The profiler.username configuration key is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
193-
194-
return $v;
195-
})
196-
->end()
197-
->end()
198-
->scalarNode('password')
199-
->defaultValue('')
200-
->beforeNormalization()
201-
->always()
202-
->then(function ($v) {
203-
@trigger_error('The profiler.password configuration key is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
204-
205-
return $v;
206-
})
207-
->end()
208-
->end()
209-
->scalarNode('lifetime')
210-
->defaultValue(86400)
211-
->beforeNormalization()
212-
->always()
213-
->then(function ($v) {
214-
@trigger_error('The profiler.lifetime configuration key is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
215-
216-
return $v;
217-
})
218-
->end()
219-
->end()
176+
->scalarNode('dsn')->defaultValue('file:%kernel.cache_dir%/profiler')->end()
220177
->arrayNode('matcher')
221178
->canBeUnset()
222179
->performNoDeepMerging()

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+1-15Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -290,26 +290,12 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $
290290
$container->setParameter('profiler_listener.only_master_requests', $config['only_master_requests']);
291291

292292
// Choose storage class based on the DSN
293-
$supported = array(
294-
'sqlite' => 'Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage',
295-
'mysql' => 'Symfony\Component\HttpKernel\Profiler\MysqlProfilerStorage',
296-
'file' => 'Symfony\Component\HttpKernel\Profiler\FileProfilerStorage',
297-
'mongodb' => 'Symfony\Component\HttpKernel\Profiler\MongoDbProfilerStorage',
298-
'memcache' => 'Symfony\Component\HttpKernel\Profiler\MemcacheProfilerStorage',
299-
'memcached' => 'Symfony\Component\HttpKernel\Profiler\MemcachedProfilerStorage',
300-
'redis' => 'Symfony\Component\HttpKernel\Profiler\RedisProfilerStorage',
301-
);
302293
list($class) = explode(':', $config['dsn'], 2);
303-
if (!isset($supported[$class])) {
294+
if ('file' !== $class) {
304295
throw new \LogicException(sprintf('Driver "%s" is not supported for the profiler.', $class));
305296
}
306297

307298
$container->setParameter('profiler.storage.dsn', $config['dsn']);
308-
$container->setParameter('profiler.storage.username', $config['username']);
309-
$container->setParameter('profiler.storage.password', $config['password']);
310-
$container->setParameter('profiler.storage.lifetime', $config['lifetime']);
311-
312-
$container->getDefinition('profiler.storage')->setClass($supported[$class]);
313299

314300
if (isset($config['matcher'])) {
315301
if (isset($config['matcher']['service'])) {

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/config/profiling.xml
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@
1111
<argument type="service" id="logger" on-invalid="null" />
1212
</service>
1313

14-
<service id="profiler.storage" class="" public="false">
14+
<service id="profiler.storage" class="Symfony\Component\HttpKernel\Profiler\FileProfilerStorage" public="false">
1515
<argument>%profiler.storage.dsn%</argument>
16-
<argument>%profiler.storage.username%</argument>
17-
<argument>%profiler.storage.password%</argument>
18-
<argument>%profiler.storage.lifetime%</argument>
1916
</service>
2017

2118
<service id="profiler_listener" class="Symfony\Component\HttpKernel\EventListener\ProfilerListener">

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,6 @@ protected static function getBundleDefaultConfig()
141141
'only_exceptions' => false,
142142
'only_master_requests' => false,
143143
'dsn' => 'file:%kernel.cache_dir%/profiler',
144-
'username' => '',
145-
'password' => '',
146-
'lifetime' => 86400,
147144
'collect' => true,
148145
),
149146
'translator' => array(

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.