diff --git a/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md b/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md
index 260dbdae05c67..a7b7d840f89db 100644
--- a/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md
+++ b/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md
@@ -6,6 +6,8 @@ CHANGELOG
* removed the `WebProfilerExtension::dumpValue()` method
* removed the `getTemplates()` method of the `TemplateManager` class in favor of the ``getNames()`` method
+ * removed the `web_profiler.position` config option and the
+ `web_profiler.debug_toolbar.position` container parameter
3.1.0
-----
diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php
index 7ebd04b574c22..4761eda00f938 100644
--- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php
+++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php
@@ -34,28 +34,25 @@ class ProfilerController
private $profiler;
private $twig;
private $templates;
- private $toolbarPosition;
private $cspHandler;
private $baseDir;
/**
* Constructor.
*
- * @param UrlGeneratorInterface $generator The URL Generator
- * @param Profiler $profiler The profiler
- * @param Environment $twig The twig environment
- * @param array $templates The templates
- * @param string $toolbarPosition The toolbar position (top, bottom, normal, or null -- use the configuration)
- * @param ContentSecurityPolicyHandler $cspHandler The Content-Security-Policy handler
- * @param string $baseDir The project root directory
+ * @param UrlGeneratorInterface $generator The URL Generator
+ * @param Profiler $profiler The profiler
+ * @param Environment $twig The twig environment
+ * @param array $templates The templates
+ * @param ContentSecurityPolicyHandler $cspHandler The Content-Security-Policy handler
+ * @param string $baseDir The project root directory
*/
- public function __construct(UrlGeneratorInterface $generator, Profiler $profiler = null, Environment $twig, array $templates, $toolbarPosition = 'bottom', ContentSecurityPolicyHandler $cspHandler = null, $baseDir = null)
+ public function __construct(UrlGeneratorInterface $generator, Profiler $profiler = null, Environment $twig, array $templates, ContentSecurityPolicyHandler $cspHandler = null, $baseDir = null)
{
$this->generator = $generator;
$this->profiler = $profiler;
$this->twig = $twig;
$this->templates = $templates;
- $this->toolbarPosition = $toolbarPosition;
$this->cspHandler = $cspHandler;
$this->baseDir = $baseDir;
}
@@ -161,11 +158,6 @@ public function toolbarAction(Request $request, $token)
return new Response('', 404, array('Content-Type' => 'text/html'));
}
- // the toolbar position (top, bottom, normal, or null -- use the configuration)
- if (null === $position = $request->query->get('position')) {
- $position = $this->toolbarPosition;
- }
-
$url = null;
try {
$url = $this->generator->generate('_profiler', array('token' => $token));
@@ -175,7 +167,6 @@ public function toolbarAction(Request $request, $token)
return $this->renderWithCspNonces($request, '@WebProfiler/Profiler/toolbar.html.twig', array(
'request' => $request,
- 'position' => $position,
'profile' => $profile,
'templates' => $this->getTemplateManager()->getNames($profile),
'profiler_url' => $url,
diff --git a/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/Configuration.php
index e07b28925de41..812e311195993 100644
--- a/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/Configuration.php
+++ b/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/Configuration.php
@@ -37,14 +37,6 @@ public function getConfigTreeBuilder()
$rootNode
->children()
->booleanNode('toolbar')->defaultFalse()->end()
- ->scalarNode('position')
- ->defaultValue('bottom')
- ->setDeprecated('The "web_profiler.position" configuration key has been deprecated in Symfony 3.4 and it will be removed in 4.0.')
- ->validate()
- ->ifNotInArray(array('bottom', 'top'))
- ->thenInvalid('The CSS position %s is not supported')
- ->end()
- ->end()
->booleanNode('intercept_redirects')->defaultFalse()->end()
->scalarNode('excluded_ajax_paths')->defaultValue('^/(app(_[\\w]+)?\\.php/)?_wdt')->end()
->end()
diff --git a/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php b/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php
index e507bf2d22b70..e8e3ee87e9c1c 100644
--- a/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php
+++ b/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php
@@ -44,11 +44,10 @@ public function load(array $configs, ContainerBuilder $container)
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('profiler.xml');
- $container->setParameter('web_profiler.debug_toolbar.position', $config['position']);
if ($config['toolbar'] || $config['intercept_redirects']) {
$loader->load('toolbar.xml');
- $container->getDefinition('web_profiler.debug_toolbar')->replaceArgument(5, $config['excluded_ajax_paths']);
+ $container->getDefinition('web_profiler.debug_toolbar')->replaceArgument(4, $config['excluded_ajax_paths']);
$container->setParameter('web_profiler.debug_toolbar.intercept_redirects', $config['intercept_redirects']);
$container->setParameter('web_profiler.debug_toolbar.mode', $config['toolbar'] ? WebDebugToolbarListener::ENABLED : WebDebugToolbarListener::DISABLED);
}
@@ -66,7 +65,7 @@ public function load(array $configs, ContainerBuilder $container)
$baseDir = implode(DIRECTORY_SEPARATOR, $baseDir);
$profilerController = $container->getDefinition('web_profiler.controller.profiler');
- $profilerController->replaceArgument(6, $baseDir);
+ $profilerController->replaceArgument(5, $baseDir);
$fileLinkFormatter = $container->getDefinition('debug.file_link_formatter');
$fileLinkFormatter->replaceArgument(2, $baseDir);
diff --git a/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php b/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php
index 6ffdbc7ad0764..d99f9d5b32d9c 100644
--- a/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php
+++ b/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php
@@ -40,17 +40,15 @@ class WebDebugToolbarListener implements EventSubscriberInterface
protected $urlGenerator;
protected $interceptRedirects;
protected $mode;
- protected $position;
protected $excludedAjaxPaths;
private $cspHandler;
- public function __construct(Environment $twig, $interceptRedirects = false, $mode = self::ENABLED, $position = 'bottom', UrlGeneratorInterface $urlGenerator = null, $excludedAjaxPaths = '^/bundles|^/_wdt', ContentSecurityPolicyHandler $cspHandler = null)
+ public function __construct(Environment $twig, $interceptRedirects = false, $mode = self::ENABLED, UrlGeneratorInterface $urlGenerator = null, $excludedAjaxPaths = '^/bundles|^/_wdt', ContentSecurityPolicyHandler $cspHandler = null)
{
$this->twig = $twig;
$this->urlGenerator = $urlGenerator;
$this->interceptRedirects = (bool) $interceptRedirects;
$this->mode = (int) $mode;
- $this->position = $position;
$this->excludedAjaxPaths = $excludedAjaxPaths;
$this->cspHandler = $cspHandler;
}
@@ -124,7 +122,6 @@ protected function injectToolbar(Response $response, Request $request, array $no
$toolbar = "\n".str_replace("\n", '', $this->twig->render(
'@WebProfiler/Profiler/toolbar_js.html.twig',
array(
- 'position' => $this->position,
'excluded_ajax_paths' => $this->excludedAjaxPaths,
'token' => $response->headers->get('X-Debug-Token'),
'request' => $request,
diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/config/profiler.xml b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/profiler.xml
index 4c659b628144d..538bea8ef3087 100644
--- a/src/Symfony/Bundle/WebProfilerBundle/Resources/config/profiler.xml
+++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/profiler.xml
@@ -12,7 +12,6 @@