Skip to content

[HttpKernel] removed deprecated profiler storages #16018

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 1 commit into from
Oct 1, 2015
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 @@ -173,50 +173,7 @@ private function addProfilerSection(ArrayNodeDefinition $rootNode)
->booleanNode('collect')->defaultTrue()->end()
->booleanNode('only_exceptions')->defaultFalse()->end()
->booleanNode('only_master_requests')->defaultFalse()->end()
->scalarNode('dsn')
->defaultValue('file:%kernel.cache_dir%/profiler')
->beforeNormalization()
->ifTrue(function ($v) { return 'file:' !== substr($v, 0, 5); })
->then(function ($v) {
@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);

return $v;
})
->end()
->end()
->scalarNode('username')
->defaultValue('')
->beforeNormalization()
->always()
->then(function ($v) {
@trigger_error('The profiler.username configuration key is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);

return $v;
})
->end()
->end()
->scalarNode('password')
->defaultValue('')
->beforeNormalization()
->always()
->then(function ($v) {
@trigger_error('The profiler.password configuration key is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);

return $v;
})
->end()
->end()
->scalarNode('lifetime')
->defaultValue(86400)
->beforeNormalization()
->always()
->then(function ($v) {
@trigger_error('The profiler.lifetime configuration key is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);

return $v;
})
->end()
->end()
->scalarNode('dsn')->defaultValue('file:%kernel.cache_dir%/profiler')->end()
->arrayNode('matcher')
->canBeUnset()
->performNoDeepMerging()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,26 +290,12 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $
$container->setParameter('profiler_listener.only_master_requests', $config['only_master_requests']);

// Choose storage class based on the DSN
$supported = array(
'sqlite' => 'Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage',
'mysql' => 'Symfony\Component\HttpKernel\Profiler\MysqlProfilerStorage',
'file' => 'Symfony\Component\HttpKernel\Profiler\FileProfilerStorage',
'mongodb' => 'Symfony\Component\HttpKernel\Profiler\MongoDbProfilerStorage',
'memcache' => 'Symfony\Component\HttpKernel\Profiler\MemcacheProfilerStorage',
'memcached' => 'Symfony\Component\HttpKernel\Profiler\MemcachedProfilerStorage',
'redis' => 'Symfony\Component\HttpKernel\Profiler\RedisProfilerStorage',
);
list($class) = explode(':', $config['dsn'], 2);
if (!isset($supported[$class])) {
if ('file' !== $class) {
throw new \LogicException(sprintf('Driver "%s" is not supported for the profiler.', $class));
}

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

$container->getDefinition('profiler.storage')->setClass($supported[$class]);

if (isset($config['matcher'])) {
if (isset($config['matcher']['service'])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@
<argument type="service" id="logger" on-invalid="null" />
</service>

<service id="profiler.storage" class="" public="false">
<service id="profiler.storage" class="Symfony\Component\HttpKernel\Profiler\FileProfilerStorage" public="false">
<argument>%profiler.storage.dsn%</argument>
<argument>%profiler.storage.username%</argument>
<argument>%profiler.storage.password%</argument>
<argument>%profiler.storage.lifetime%</argument>
</service>

<service id="profiler_listener" class="Symfony\Component\HttpKernel\EventListener\ProfilerListener">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,6 @@ protected static function getBundleDefaultConfig()
'only_exceptions' => false,
'only_master_requests' => false,
'dsn' => 'file:%kernel.cache_dir%/profiler',
'username' => '',
'password' => '',
'lifetime' => 86400,
'collect' => true,
),
'translator' => array(
Expand Down
Loading