From 08bf50ab702214f81ec089a90c402e910ea97d88 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Thu, 12 Feb 2015 16:48:57 +0100 Subject: [PATCH 01/63] Allow parameter use_cookies in session configuration. --- .../FrameworkBundle/DependencyInjection/Configuration.php | 1 + .../FrameworkBundle/DependencyInjection/FrameworkExtension.php | 2 +- .../FrameworkBundle/Resources/config/schema/symfony-1.0.xsd | 1 + .../Tests/DependencyInjection/Fixtures/php/full.php | 1 + .../Tests/DependencyInjection/Fixtures/xml/full.xml | 2 +- .../Tests/DependencyInjection/Fixtures/yml/full.yml | 1 + .../Tests/DependencyInjection/FrameworkExtensionTest.php | 1 + 7 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index 977c0669c4..bfaef92429 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -341,6 +341,7 @@ class Configuration implements ConfigurationInterface ->scalarNode('cookie_domain')->end() ->booleanNode('cookie_secure')->end() ->booleanNode('cookie_httponly')->end() + ->booleanNode('use_cookies')->end() ->scalarNode('gc_divisor')->end() ->scalarNode('gc_probability')->defaultValue(1)->end() ->scalarNode('gc_maxlifetime')->end() diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index e2e8a84163..680bdf3efd 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -396,7 +396,7 @@ class FrameworkExtension extends Extension // session storage $container->setAlias('session.storage', $config['storage_id']); $options = array(); - foreach (array('name', 'cookie_lifetime', 'cookie_path', 'cookie_domain', 'cookie_secure', 'cookie_httponly', 'gc_maxlifetime', 'gc_probability', 'gc_divisor') as $key) { + foreach (array('name', 'cookie_lifetime', 'cookie_path', 'cookie_domain', 'cookie_secure', 'cookie_httponly', 'use_cookies', 'gc_maxlifetime', 'gc_probability', 'gc_divisor') as $key) { if (isset($config[$key])) { $options[$key] = $config[$key]; } diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd index e1ca041e61..01862799c2 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd @@ -107,6 +107,7 @@ + diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php index a035b56d70..8daf80533a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php @@ -33,6 +33,7 @@ $container->loadFromExtension('framework', array( 'cookie_domain' => 'example.com', 'cookie_secure' => true, 'cookie_httponly' => true, + 'use_cookies' => true, 'gc_maxlifetime' => 90000, 'gc_divisor' => 108, 'gc_probability' => 1, diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml index bf4537b910..40151b3c9f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml @@ -14,7 +14,7 @@ - + text/csv diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml index 47513b1f66..8ace334133 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml @@ -25,6 +25,7 @@ framework: cookie_domain: example.com cookie_secure: true cookie_httponly: true + use_cookies: true gc_probability: 1 gc_divisor: 108 gc_maxlifetime: 90000 diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index 4acefb43cb..e668d26c18 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -150,6 +150,7 @@ abstract class FrameworkExtensionTest extends TestCase $this->assertEquals('example.com', $options['cookie_domain']); $this->assertTrue($options['cookie_secure']); $this->assertTrue($options['cookie_httponly']); + $this->assertTrue($options['use_cookies']); $this->assertEquals(108, $options['gc_divisor']); $this->assertEquals(1, $options['gc_probability']); $this->assertEquals(90000, $options['gc_maxlifetime']); From e500a716da44e6d34b2ad04f979d83bc0795dd1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 15 Jun 2015 09:35:28 +0200 Subject: [PATCH 02/63] [FrameworkBundle] Configurable Serializer name converter --- .../FrameworkBundle/DependencyInjection/Configuration.php | 1 + .../DependencyInjection/FrameworkExtension.php | 4 ++++ .../Resources/config/schema/symfony-1.0.xsd | 1 + .../Bundle/FrameworkBundle/Resources/config/serializer.xml | 5 ++++- .../Tests/DependencyInjection/Fixtures/php/full.php | 7 ++++++- .../Tests/DependencyInjection/Fixtures/xml/full.xml | 2 +- .../Tests/DependencyInjection/Fixtures/yml/full.yml | 6 +++++- .../Tests/DependencyInjection/FrameworkExtensionTest.php | 7 +++++++ 8 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index 977c0669c4..7c24a60210 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -660,6 +660,7 @@ class Configuration implements ConfigurationInterface ->children() ->booleanNode('enable_annotations')->defaultFalse()->end() ->scalarNode('cache')->end() + ->scalarNode('name_converter')->end() ->end() ->end() ->end() diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 2d00a462ee..9805e289ce 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -970,6 +970,10 @@ class FrameworkExtension extends Extension 1, new Reference($config['cache']) ); } + + if ($config['name_converter']) { + $container->getDefinition('serializer.normalizer.object')->replaceArgument(1, new Reference($config['name_converter'])); + } } /** diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd index e1ca041e61..78dff1ebd9 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd @@ -217,5 +217,6 @@ + diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.xml index e5b53e9493..db5cdb8a54 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.xml @@ -22,7 +22,7 @@ - null + null @@ -55,5 +55,8 @@ + + + diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php index a035b56d70..b4196c6052 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php @@ -61,7 +61,12 @@ $container->loadFromExtension('framework', array( 'debug' => true, 'file_cache_dir' => '%kernel.cache_dir%/annotations', ), - 'serializer' => array('enabled' => true), + 'serializer' => array( + 'enabled' => true, + 'enable_annotations' => true, + 'cache' => 'serializer.mapping.cache.apc', + 'name_converter' => 'serializer.name_converter.camel_case_to_snake_case', + ), 'ide' => 'file%%link%%format', 'request' => array( 'formats' => array( diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml index bf4537b910..723ed6b607 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml @@ -39,6 +39,6 @@ - + diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml index 47513b1f66..b5e9faa6a1 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml @@ -47,7 +47,11 @@ framework: cache: file debug: true file_cache_dir: %kernel.cache_dir%/annotations - serializer: { enabled: true } + serializer: + enabled: true + enable_annotations: true + cache: serializer.mapping.cache.apc + name_converter: serializer.name_converter.camel_case_to_snake_case ide: file%%link%%format request: formats: diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index edace5bf7a..aca665f585 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -446,6 +446,13 @@ abstract class FrameworkExtensionTest extends TestCase { $container = $this->createContainerFromFile('full'); $this->assertTrue($container->has('serializer')); + + $argument = $container->getDefinition('serializer.mapping.chain_loader')->getArgument(0); + + $this->assertCount(1, $argument); + $this->assertEquals('Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader', $argument[0]->getClass()); + $this->assertEquals(new Reference('serializer.mapping.cache.apc'), $container->getDefinition('serializer.mapping.class_metadata_factory')->getArgument(1)); + $this->assertEquals(new Reference('serializer.name_converter.camel_case_to_snake_case'), $container->getDefinition('serializer.normalizer.object')->getArgument(1)); } public function testAssetHelperWhenAssetsAreEnabled() From d4473f30f89b618b449b02cdfd926502169ab35b Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 15 Jul 2015 19:30:30 +0200 Subject: [PATCH 03/63] [Config] deprecate cannotBeEmpty() for boolean and numeric nodes --- .../Definition/Builder/BooleanNodeDefinition.php | 12 ++++++++++++ .../Definition/Builder/NumericNodeDefinition.php | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php b/src/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php index db7ebc2411..7f8eb2681d 100644 --- a/src/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php +++ b/src/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php @@ -30,6 +30,18 @@ class BooleanNodeDefinition extends ScalarNodeDefinition $this->nullEquivalent = true; } + /** + * {@inheritdoc} + * + * @deprecated Deprecated since version 2.8, to be removed in 3.0. + */ + public function cannotBeEmpty() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); + + return parent::cannotBeEmpty(); + } + /** * Instantiate a Node. * diff --git a/src/Symfony/Component/Config/Definition/Builder/NumericNodeDefinition.php b/src/Symfony/Component/Config/Definition/Builder/NumericNodeDefinition.php index ddd716d06a..a1cd49b73c 100644 --- a/src/Symfony/Component/Config/Definition/Builder/NumericNodeDefinition.php +++ b/src/Symfony/Component/Config/Definition/Builder/NumericNodeDefinition.php @@ -58,4 +58,16 @@ abstract class NumericNodeDefinition extends ScalarNodeDefinition return $this; } + + /** + * {@inheritdoc} + * + * @deprecated Deprecated since version 2.8, to be removed in 3.0. + */ + public function cannotBeEmpty() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); + + return parent::cannotBeEmpty(); + } } From 3ad0794aa14aa929eb57886973640026ce7f9aa7 Mon Sep 17 00:00:00 2001 From: Tomaz Ahlin Date: Thu, 2 Jul 2015 10:07:17 +0200 Subject: [PATCH 04/63] =?UTF-8?q?[DependencyInjection]=20fixed=20FrozenPar?= =?UTF-8?q?ameterBag=20and=20improved=20Parameter=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ParameterBag/FrozenParameterBag.php | 8 ++++++++ .../ParameterBag/ParameterBagInterface.php | 7 +++++++ .../Tests/ParameterBag/FrozenParameterBagTest.php | 9 +++++++++ 3 files changed, 24 insertions(+) diff --git a/src/Symfony/Component/DependencyInjection/ParameterBag/FrozenParameterBag.php b/src/Symfony/Component/DependencyInjection/ParameterBag/FrozenParameterBag.php index dc936a0bd6..cb7e481ed2 100644 --- a/src/Symfony/Component/DependencyInjection/ParameterBag/FrozenParameterBag.php +++ b/src/Symfony/Component/DependencyInjection/ParameterBag/FrozenParameterBag.php @@ -69,4 +69,12 @@ class FrozenParameterBag extends ParameterBag { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } + + /** + * {@inheritdoc} + */ + public function remove($name) + { + throw new LogicException('Impossible to call remove() on a frozen ParameterBag.'); + } } diff --git a/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php b/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php index 96003547b6..ead76d738d 100644 --- a/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php +++ b/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php @@ -11,6 +11,7 @@ namespace Symfony\Component\DependencyInjection\ParameterBag; +use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; /** @@ -25,6 +26,8 @@ interface ParameterBagInterface /** * Clears all parameters. * + * @throws LogicException if the ParameterBagInterface can not be cleared + * * @api */ public function clear(); @@ -34,6 +37,8 @@ interface ParameterBagInterface * * @param array $parameters An array of parameters * + * @throws LogicException if the parameter can not be added + * * @api */ public function add(array $parameters); @@ -66,6 +71,8 @@ interface ParameterBagInterface * @param string $name The parameter name * @param mixed $value The parameter value * + * @throws LogicException if the parameter can not be set + * * @api */ public function set($name, $value); diff --git a/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/FrozenParameterBagTest.php b/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/FrozenParameterBagTest.php index e6e7fea2f1..6d963dc054 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/FrozenParameterBagTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/FrozenParameterBagTest.php @@ -57,4 +57,13 @@ class FrozenParameterBagTest extends \PHPUnit_Framework_TestCase $bag = new FrozenParameterBag(array()); $bag->add(array()); } + + /** + * @expectedException \LogicException + */ + public function testRemove() + { + $bag = new FrozenParameterBag(array('foo' => 'bar')); + $bag->remove('foo'); + } } From 32d964ba3946cdc8572f0b95288b5c3446b24cfc Mon Sep 17 00:00:00 2001 From: Matt Farmer Date: Fri, 17 Jul 2015 11:41:22 -0700 Subject: [PATCH 05/63] Fix calls to HttpCache#getSurrogate triggering E_USER_DEPRECATED errors. --- .../Component/HttpKernel/HttpCache/HttpCache.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php index 445f59c6f0..da90600bba 100644 --- a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php @@ -160,7 +160,11 @@ class HttpCache implements HttpKernelInterface, TerminableInterface */ public function getSurrogate() { - return $this->getEsi(); + if (!$this->surrogate instanceof Esi) { + throw new \LogicException('This instance of HttpCache was not set up to use ESI as surrogate handler. You must overwrite and use createSurrogate'); + } + + return $this->surrogate; } /** @@ -176,11 +180,7 @@ class HttpCache implements HttpKernelInterface, TerminableInterface { @trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the getSurrogate() method instead.', E_USER_DEPRECATED); - if (!$this->surrogate instanceof Esi) { - throw new \LogicException('This instance of HttpCache was not set up to use ESI as surrogate handler. You must overwrite and use createSurrogate'); - } - - return $this->surrogate; + return $this->getSurrogate(); } /** From 335825363de8bac4d0dd55d9e82e19bdc963a252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Fri, 24 Jul 2015 17:06:07 +0200 Subject: [PATCH 06/63] [Security] Do not save the target path in the session for a stateless firewall --- .../DependencyInjection/SecurityExtension.php | 5 +++-- .../Resources/config/security_listeners.xml | 1 + .../Security/Http/Firewall/ExceptionListener.php | 8 ++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php index 00f251765a..972b4f8f90 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php @@ -349,7 +349,7 @@ class SecurityExtension extends Extension $listeners[] = new Reference('security.access_listener'); // Exception listener - $exceptionListener = new Reference($this->createExceptionListener($container, $firewall, $id, $configuredEntryPoint ?: $defaultEntryPoint)); + $exceptionListener = new Reference($this->createExceptionListener($container, $firewall, $id, $configuredEntryPoint ?: $defaultEntryPoint, $firewall['stateless'])); return array($matcher, $listeners, $exceptionListener); } @@ -534,12 +534,13 @@ class SecurityExtension extends Extension return 'security.user.provider.concrete.'.$name; } - private function createExceptionListener($container, $config, $id, $defaultEntryPoint) + private function createExceptionListener($container, $config, $id, $defaultEntryPoint, $stateless) { $exceptionListenerId = 'security.exception_listener.'.$id; $listener = $container->setDefinition($exceptionListenerId, new DefinitionDecorator('security.exception_listener')); $listener->replaceArgument(3, $id); $listener->replaceArgument(4, null === $defaultEntryPoint ? null : new Reference($defaultEntryPoint)); + $listener->replaceArgument(8, $stateless); // access denied handler setup if (isset($config['access_denied_handler'])) { diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/config/security_listeners.xml b/src/Symfony/Bundle/SecurityBundle/Resources/config/security_listeners.xml index b7e4adfd2a..543ca38b78 100644 --- a/src/Symfony/Bundle/SecurityBundle/Resources/config/security_listeners.xml +++ b/src/Symfony/Bundle/SecurityBundle/Resources/config/security_listeners.xml @@ -186,6 +186,7 @@ %security.access.denied_url% + false diff --git a/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php b/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php index 57321fb24b..8553c75b79 100644 --- a/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php +++ b/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php @@ -46,8 +46,9 @@ class ExceptionListener private $errorPage; private $logger; private $httpUtils; + private $stateless; - public function __construct(SecurityContextInterface $context, AuthenticationTrustResolverInterface $trustResolver, HttpUtils $httpUtils, $providerKey, AuthenticationEntryPointInterface $authenticationEntryPoint = null, $errorPage = null, AccessDeniedHandlerInterface $accessDeniedHandler = null, LoggerInterface $logger = null) + public function __construct(SecurityContextInterface $context, AuthenticationTrustResolverInterface $trustResolver, HttpUtils $httpUtils, $providerKey, AuthenticationEntryPointInterface $authenticationEntryPoint = null, $errorPage = null, AccessDeniedHandlerInterface $accessDeniedHandler = null, LoggerInterface $logger = null, $stateless = false) { $this->context = $context; $this->accessDeniedHandler = $accessDeniedHandler; @@ -57,6 +58,7 @@ class ExceptionListener $this->authenticationTrustResolver = $trustResolver; $this->errorPage = $errorPage; $this->logger = $logger; + $this->stateless = $stateless; } /** @@ -178,7 +180,9 @@ class ExceptionListener $this->logger->debug('Calling Authentication entry point'); } - $this->setTargetPath($request); + if (!$this->stateless) { + $this->setTargetPath($request); + } if ($authException instanceof AccountStatusException) { // remove the security token to prevent infinite redirect loops From a7bef1eb2d4bcd45a840f073975a98dbbd0f25d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Mon, 27 Jul 2015 09:36:17 +0200 Subject: [PATCH 07/63] Change the default value of cookie_httponly to fix #15303 --- UPGRADE-2.8.md | 30 ++++++++++++++----- .../DependencyInjection/Configuration.php | 2 +- .../DependencyInjection/Fixtures/php/full.php | 2 +- .../DependencyInjection/Fixtures/xml/full.xml | 2 +- .../DependencyInjection/Fixtures/yml/full.yml | 2 +- .../FrameworkExtensionTest.php | 2 +- 6 files changed, 27 insertions(+), 13 deletions(-) diff --git a/UPGRADE-2.8.md b/UPGRADE-2.8.md index 966f1f4711..0701ad8f83 100644 --- a/UPGRADE-2.8.md +++ b/UPGRADE-2.8.md @@ -8,32 +8,32 @@ Form option together with the `Valid` constraint instead. Contrary to "cascade_validation", "constraints" must be set on the respective child forms, not the parent form. - + Before: - + ```php $form = $this->createForm('form', $article, array('cascade_validation' => true)) ->add('author', new AuthorType()) ->getForm(); ``` - + After: - + ```php use Symfony\Component\Validator\Constraints\Valid; - + $form = $this->createForm('form', $article) ->add('author', new AuthorType(), array( 'constraints' => new Valid(), )) ->getForm(); ``` - + Alternatively, you can set the `Valid` constraint in the model itself: - + ```php use Symfony\Component\Validator\Constraints as Assert; - + class Article { /** @@ -136,3 +136,17 @@ DependencyInjection ``` + +FrameworkBundle +--------------- + + * The default value of the parameter `session`.`cookie_httponly` is now `true`. + It prevents scripting languages, such as JavaScript to access the cookie, + which help to reduce identity theft through XSS attacks. If your + application needs to access the session cookie, override this parameter: + + ```yaml + framework: + session: + cookie_httponly: false + ``` diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index 977c0669c4..b2ff3d7c59 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -340,7 +340,7 @@ class Configuration implements ConfigurationInterface ->scalarNode('cookie_path')->end() ->scalarNode('cookie_domain')->end() ->booleanNode('cookie_secure')->end() - ->booleanNode('cookie_httponly')->end() + ->booleanNode('cookie_httponly')->defaultTrue()->end() ->scalarNode('gc_divisor')->end() ->scalarNode('gc_probability')->defaultValue(1)->end() ->scalarNode('gc_maxlifetime')->end() diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php index a035b56d70..677d8e8c10 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php @@ -32,7 +32,7 @@ $container->loadFromExtension('framework', array( 'cookie_path' => '/', 'cookie_domain' => 'example.com', 'cookie_secure' => true, - 'cookie_httponly' => true, + 'cookie_httponly' => false, 'gc_maxlifetime' => 90000, 'gc_divisor' => 108, 'gc_probability' => 1, diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml index bf4537b910..dfd651574e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml @@ -14,7 +14,7 @@ - + text/csv diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml index 47513b1f66..ad0b903e86 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml @@ -24,7 +24,7 @@ framework: cookie_path: / cookie_domain: example.com cookie_secure: true - cookie_httponly: true + cookie_httponly: false gc_probability: 1 gc_divisor: 108 gc_maxlifetime: 90000 diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index edace5bf7a..4eeee524fb 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -149,7 +149,7 @@ abstract class FrameworkExtensionTest extends TestCase $this->assertEquals('/', $options['cookie_path']); $this->assertEquals('example.com', $options['cookie_domain']); $this->assertTrue($options['cookie_secure']); - $this->assertTrue($options['cookie_httponly']); + $this->assertFalse($options['cookie_httponly']); $this->assertEquals(108, $options['gc_divisor']); $this->assertEquals(1, $options['gc_probability']); $this->assertEquals(90000, $options['gc_maxlifetime']); From 0e934637dfc8e43f288adf6874cc57abc977be34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Tue, 28 Jul 2015 13:31:20 +0200 Subject: [PATCH 08/63] Small optimization in AccessDecisionManager --- .../Security/Core/Authorization/AccessDecisionManager.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php b/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php index 61debe39cc..e021cc7354 100644 --- a/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php +++ b/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php @@ -150,7 +150,6 @@ class AccessDecisionManager implements AccessDecisionManagerInterface { $grant = 0; $deny = 0; - $abstain = 0; foreach ($this->voters as $voter) { $result = $voter->vote($token, $object, $attributes); @@ -163,11 +162,6 @@ class AccessDecisionManager implements AccessDecisionManagerInterface case VoterInterface::ACCESS_DENIED: ++$deny; - break; - - default: - ++$abstain; - break; } } @@ -180,7 +174,7 @@ class AccessDecisionManager implements AccessDecisionManagerInterface return false; } - if ($grant == $deny && $grant != 0) { + if ($grant > 0) { return $this->allowIfEqualGrantedDeniedDecisions; } From 77ee866dd8601300209cc44ab5e2975bdb0b22ed Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 28 Jul 2015 14:35:05 +0200 Subject: [PATCH 09/63] [php7] Fix for substr() always returning a string --- src/Symfony/Component/Console/Input/ArgvInput.php | 4 ++-- src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php | 4 ++-- src/Symfony/Component/Yaml/Parser.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/Console/Input/ArgvInput.php b/src/Symfony/Component/Console/Input/ArgvInput.php index 43cbe725fb..a6c2132797 100644 --- a/src/Symfony/Component/Console/Input/ArgvInput.php +++ b/src/Symfony/Component/Console/Input/ArgvInput.php @@ -215,8 +215,8 @@ class ArgvInput extends Input $option = $this->definition->getOption($name); - // Convert false values (from a previous call to substr()) to null - if (false === $value) { + // Convert empty values to null + if (!isset($value[0])) { $value = null; } diff --git a/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php b/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php index 563bd0997e..a3ab18f894 100644 --- a/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php +++ b/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php @@ -121,11 +121,11 @@ PHP $that->assertEquals('->', $trace[0]['type']); $that->assertEquals(__FILE__, $trace[1]['file']); - $that->assertEquals(__CLASS__, $trace[1]['class']); + $that->assertEquals('Symfony\Component\Debug\Tests\ErrorHandlerTest', $trace[1]['class']); $that->assertEquals('triggerNotice', $trace[1]['function']); $that->assertEquals('::', $trace[1]['type']); - $that->assertEquals(__CLASS__, $trace[2]['class']); + $that->assertEquals('Symfony\Component\Debug\Tests\ErrorHandlerTest', $trace[2]['class']); $that->assertEquals('testNotice', $trace[2]['function']); $that->assertEquals('->', $trace[2]['type']); }; diff --git a/src/Symfony/Component/Yaml/Parser.php b/src/Symfony/Component/Yaml/Parser.php index fc46ab3caf..08cfac4224 100644 --- a/src/Symfony/Component/Yaml/Parser.php +++ b/src/Symfony/Component/Yaml/Parser.php @@ -320,7 +320,7 @@ class Parser return; } - if ($inSequence && $oldLineIndentation === $newIndent && '-' === $data[0][0]) { + if ($inSequence && $oldLineIndentation === $newIndent && isset($data[0][0]) && '-' === $data[0][0]) { // the previous line contained a dash but no item content, this line is a sequence item with the same indentation // and therefore no nested list or mapping $this->moveToPreviousLine(); From d6dfe9871c4e4e0c2912c8019c75aeccd801a42c Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 28 Jul 2015 17:12:55 +0200 Subject: [PATCH 10/63] [php7] Fix for substr() always returning a string --- src/Symfony/Component/Console/Style/SymfonyStyle.php | 2 +- .../Component/VarDumper/Tests/Caster/ReflectionCasterTest.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Console/Style/SymfonyStyle.php b/src/Symfony/Component/Console/Style/SymfonyStyle.php index b3113a41e2..0d366c7e89 100644 --- a/src/Symfony/Component/Console/Style/SymfonyStyle.php +++ b/src/Symfony/Component/Console/Style/SymfonyStyle.php @@ -379,7 +379,7 @@ class SymfonyStyle extends OutputStyle { $chars = substr(str_replace(PHP_EOL, "\n", $this->bufferedOutput->fetch()), -2); - if (false === $chars) { + if (!isset($chars[0])) { return $this->newLine(); //empty history, so we should start with a new line. } //Prepend new line for each non LF chars (This means no blank line was output before) diff --git a/src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php b/src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php index ecf776d70f..0fcc7e26bb 100644 --- a/src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php +++ b/src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php @@ -11,8 +11,6 @@ namespace Symfony\Component\VarDumper\Tests\Caster; -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Dumper\CliDumper; use Symfony\Component\VarDumper\Test\VarDumperTestCase; /** @@ -34,7 +32,7 @@ ReflectionClass { constants: array:3 [ "IS_IMPLICIT_ABSTRACT" => 16 "IS_EXPLICIT_ABSTRACT" => 32 - "IS_FINAL" => 64 + "IS_FINAL" => %d ] properties: array:%d [ "name" => ReflectionProperty { From 0ce91a6019ef8ccebaea3b75fdb31f4aec671832 Mon Sep 17 00:00:00 2001 From: Daniel Espendiller Date: Tue, 28 Jul 2015 17:20:14 +0200 Subject: [PATCH 11/63] Fix missing _route parameter notice in RouterListener logging case --- .../EventListener/RouterListener.php | 2 +- .../EventListener/RouterListenerTest.php | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php b/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php index 2e9cb7b6bb..704800a5cb 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php @@ -103,7 +103,7 @@ class RouterListener implements EventSubscriberInterface } if (null !== $this->logger) { - $this->logger->info(sprintf('Matched route "%s" (parameters: %s)', $parameters['_route'], $this->parametersToString($parameters))); + $this->logger->info(sprintf('Matched route "%s" (parameters: %s)', isset($parameters['_route']) ? $parameters['_route'] : 'n/a', $this->parametersToString($parameters))); } $request->attributes->add($parameters); diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php index 66fe6bd55d..fd66a602a6 100644 --- a/src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php @@ -120,4 +120,34 @@ class RouterListenerTest extends \PHPUnit_Framework_TestCase $this->assertEquals('GET', $context->getMethod()); } + + /** + * @dataProvider getLoggingParameterData + */ + public function testLoggingParameter($parameter, $log) + { + $requestMatcher = $this->getMock('Symfony\Component\Routing\Matcher\RequestMatcherInterface'); + $requestMatcher->expects($this->once()) + ->method('matchRequest') + ->will($this->returnValue($parameter)); + + $logger = $this->getMock('Psr\Log\LoggerInterface'); + $logger->expects($this->once()) + ->method('info') + ->with($this->equalTo($log)); + + $kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface'); + $request = Request::create('http://localhost/'); + + $listener = new RouterListener($requestMatcher, new RequestContext(), $logger, $this->requestStack); + $listener->onKernelRequest(new GetResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST)); + } + + public function getLoggingParameterData() + { + return array( + array(array('_route' => 'foo'), 'Matched route "foo".'), + array(array(), 'Matched route "n/a".'), + ); + } } From c2fcadc6fead1c9d6ada83e8099401d3a84984c6 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 1 Jul 2015 09:07:03 +0200 Subject: [PATCH 12/63] Redesigned the web debug toolbar --- .../views/Collector/security.html.twig | 12 +- .../Resources/views/Collector/ajax.html.twig | 6 +- .../views/Collector/config.html.twig | 133 +++++------ .../Resources/views/Collector/form.html.twig | 14 +- .../views/Collector/logger.html.twig | 39 +-- .../views/Collector/memory.html.twig | 16 +- .../views/Collector/request.html.twig | 20 +- .../Resources/views/Collector/time.html.twig | 11 +- .../views/Collector/translation.html.twig | 39 +-- .../Resources/views/Collector/twig.html.twig | 9 +- .../views/Profiler/base_js.html.twig | 2 +- .../views/Profiler/profiler.css.twig | 8 +- .../Resources/views/Profiler/toolbar.css.twig | 225 ++++++++++-------- .../views/Profiler/toolbar.html.twig | 6 +- .../views/Profiler/toolbar_item.html.twig | 17 +- .../views/Profiler/toolbar_js.html.twig | 2 +- 16 files changed, 280 insertions(+), 279 deletions(-) diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig index a495829d3e..1a1352ab32 100644 --- a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig +++ b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig @@ -2,17 +2,17 @@ {% block toolbar %} {% if collector.tokenClass %} - {% set color_code = (collector.enabled and collector.authenticated) ? 'green' : 'yellow' %} + {% set color_code = (collector.enabled and collector.authenticated) ? '' : 'yellow' %} {% set authentication_color_code = (collector.enabled and collector.authenticated) ? 'green' : 'red' %} {% set authentication_color_text = (collector.enabled and collector.authenticated) ? 'Yes' : 'No' %} {% else %} - {% set color_code = collector.enabled ? 'red' : 'black' %} + {% set color_code = collector.enabled ? 'red' : '' %} {% endif %} {% set text %} {% if collector.tokenClass %}
Logged in as - {{ collector.user }} + {{ collector.user }}
Authenticated @@ -31,10 +31,10 @@ {% endif %} {% endset %} {% set icon %} - - {{ collector.user }} + + {% if collector.user %}{{ collector.user }}{% endif %} {% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url } %} + {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url, 'block_status': color_code } %} {% endblock %} {% block menu %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig index d557629d18..3c7b99b028 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig @@ -2,10 +2,8 @@ {% block toolbar %} {% set icon %} - - - 0 - + 0 + ajax {% endset %} {% set text %}
diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig index 485cb57c9b..8ab559351d 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig @@ -1,28 +1,35 @@ {% extends '@WebProfiler/Profiler/layout.html.twig' %} {% block toolbar %} - {# Symfony Logo #} + + {# Symfony Information #} + {% if 'unknown' == collector.symfonyState %} + {% set block_status = '' %} + {% set symfony_version_status = 'Unable to retrieve information about the Symfony version.' %} + {% elseif 'eol' == collector.symfonyState %} + {% set block_status = 'red' %} + {% set symfony_version_status = 'This Symfony version will no longer receive security fixes.' %} + {% elseif 'eom' == collector.symfonyState %} + {% set block_status = 'yellow' %} + {% set symfony_version_status = 'This Symfony version will only receive security fixes.' %} + {% elseif 'dev' == collector.symfonyState %} + {% set block_status = 'yellow' %} + {% set symfony_version_status = 'This Symfony version is still in the development phase.' %} + + {% else %} + {% set block_status = '' %} + {% set symfony_version_status = '' %} + {% endif %} + {% set icon %} - - - - {% if collector.applicationname %} - {{ collector.applicationname }} {{ collector.applicationversion }} - {% elseif collector.symfonyState is defined %} - {% if 'unknown' == collector.symfonyState -%} - - {%- elseif 'eol' == collector.symfonyState -%} - - {%- elseif 'eom' == collector.symfonyState -%} - - {%- elseif 'dev' == collector.symfonyState -%} - - {%- else -%} - - {%- endif -%} - {{ collector.symfonyversion }} - {% endif %} - + + {% if collector.applicationname %} + {{ collector.applicationname }} + {{ collector.applicationversion }} + {% elseif collector.symfonyState is defined %} + symfony + {{ collector.symfonyversion }} + {% endif %} {% endset %} {% set text %} @@ -32,18 +39,46 @@
{% endif %}
- Symfony {{ collector.symfonyversion }} + + Read Symfony {{ collector.symfonyversion }} Docs +
+ {% if 'n/a' != collector.appname %} +
+ Kernel name + {{ collector.appname }} +
+ {% endif %} + {% if 'n/a' != collector.env %} +
+ Environment + {{ collector.env }} +
+ {% endif %} + {% if 'n/a' != collector.debug %} +
+ Debug + {{ collector.debug ? 'en' : 'dis' }}abled +
+ {% endif %}
- Symfony Documentation + Profiler token + + {% if profiler_url %} + {{ collector.token }} + {% else %} + {{ collector.token }} + {% endif %} +
{% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': false } %} + {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': false, 'block_name': 'config-symfony', 'block_status': block_status } %} {# PHP Information #} {% set icon %} - + php + {{ collector.phpversion }} {% endset %} {% set text %} @@ -63,53 +98,7 @@
{% endspaceless %} {% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': false } %} - - {# Environment #} - {% set debug_status_class %}sf-toolbar-status sf-toolbar-status-{{ collector.debug ? 'green' : 'red' }}{% endset %} - {% set icon %} - - {{ token }} - {% if 'n/a' != collector.appname or 'n/a' != collector.env %} - - {{ collector.appname }} - {{ collector.env }} - - {% endif %} - {% endset %} - {% set text %} - {% spaceless %} - {% if 'n/a' != collector.appname %} -
- Name - {{ collector.appname }} -
- {% endif %} - {% if 'n/a' != collector.env %} -
- Environment - {{ collector.env }} -
- {% endif %} - {% if 'n/a' != collector.debug %} -
- Debug - {{ collector.debug ? 'en' : 'dis' }}abled -
- {% endif %} -
- Token - - {% if profiler_url %} - {{ collector.token }} - {% else %} - {{ collector.token }} - {% endif %} - -
- {% endspaceless %} - {% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url } %} + {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': false, 'block_name': 'config-php' } %} {% endblock %} {% block menu %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig index f4342df72b..6c4ad8a09d 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig @@ -3,13 +3,19 @@ {% from _self import form_tree_entry, form_tree_details %} {% block toolbar %} - {% if collector.data|length %} + {% if collector.data.nb_errors > 0 or collector.data.forms|length %} {% set icon %} - - {% if collector.data.nb_errors %}{{ collector.data.nb_errors }}{% else %}{{ collector.data.forms|length }}{% endif %} + + + {% if collector.data.nb_errors %} + {{ collector.data.nb_errors }} + {% else %} + {{ collector.data.forms|length }} + {% endif %} + {% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url } %} + {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url, 'block_status': collector.data.nb_errors ? 'red' : '' } %} {% endif %} {% endblock %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig index a6707da12d..fa78941f4d 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig @@ -5,14 +5,10 @@ {% block toolbar %} {% if collector.counterrors or collector.countdeprecations or collector.countscreams %} {% set icon %} - - {% if collector.counterrors %} - {% set status_color = "red" %} - {% elseif collector.countdeprecations %} - {% set status_color = "yellow" %} - {% endif %} + + {% set status_color = collector.counterrors ? 'red' : collector.countdeprecations ? 'yellow' : '' %} {% set error_count = collector.counterrors + collector.countdeprecations + collector.countscreams %} - {{ error_count }} + {{ error_count }} {% endset %} {% set text %} {% if collector.counterrors %} @@ -34,7 +30,7 @@ {% endif %} {% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url } %} + {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url, 'block_status': status_color } %} {% endif %} {% endblock %} @@ -87,30 +83,20 @@ {% if collector.logs %} - - - - - - - - +
    {% set log_loop_index = 0 %} {% for log in collector.logs %} {% set is_deprecation = log.context.level is defined and log.context.type is defined and (constant('E_DEPRECATED') == log.context.type or constant('E_USER_DEPRECATED') == log.context.type) %} {% if priority == '-100' ? is_deprecation : log.priority >= priority %} {% set log_loop_index = log_loop_index + 1 %} -
- - - - - +
  • + {{ logger.display_message(loop.index, log, is_deprecation) }} +
  • {% endif %} {% else %} - +
  • No logs available for this priority.
  • {% endfor %} -
    #PriorityChannelMessage and context
    {{ log_loop_index }}{{ is_deprecation ? 'DEPRECATION' : log.priorityName }}{{ log.channel is defined ? log.channel }}{{ logger.display_message(loop.index, log, is_deprecation) }}
    No logs available for {{ priority }} priority.
    + {% else %}

    No logs available. @@ -120,13 +106,11 @@ {% macro display_message(log_index, log, is_deprecation) %} - {{ is_deprecation ? 'DEPRECATED' : log.priorityName }} - {{ log.message }} - {% if is_deprecation %} {% set stack = log.context.stack|default([]) %} {% set id = 'sf-call-stack-' ~ log_index %} - {{ log.message }} + DEPRECATED - {{ log.message }} {% if stack %} @@ -156,6 +140,7 @@ {% endif %} {% endfor %} {% else %} + {{ log.priorityName }} - {{ log.message }} {% if log.context is defined and log.context is not empty %}
    diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig index 397b5e8305..0b7649e90e 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig @@ -2,16 +2,22 @@ {% block toolbar %} {% set icon %} + {% set status_color = (collector.memory / 1024 / 1024) > 50 ? 'yellow' : '' %} - - {{ '%.1f'|format(collector.memory / 1024 / 1024) }} MB + {{ '%.1f'|format(collector.memory / 1024 / 1024) }} + MB {% endset %} {% set text %}

    + +
    + PHP memory limit + {{ collector.memoryLimit == -1 ? '∞' : '%.1f'|format(collector.memoryLimit / 1024 / 1024)|escape }} MB
    {% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': false } %} + {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': false, 'block_status': status_color } %} {% endblock %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig index 4d00a07d5f..8eaf168be1 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig @@ -16,26 +16,30 @@ {{ collector.controller }} {% endif %} {% endset %} - {% set request_status_code_color = (400 > collector.statuscode) ? ((200 == collector.statuscode) ? 'green' : 'yellow') : 'red'%} - {% set request_route = collector.route ? collector.route : 'NONE' %} + + {% set request_status_code_color = (400 > collector.statuscode) ? ((200 == collector.statuscode) ? 'green' : 'yellow') : 'red' %} + {% set icon %} - - {{ collector.statuscode }} - {{ request_handler }} + {{ collector.statuscode }} + {{ request_handler }} {% endset %} {% set text %} {% spaceless %}
    - Status + HTTP status {{ collector.statuscode }} {{ collector.statustext }}
    - Controller + Controller method {{ request_handler }}
    +
    + Controller file + {{ collector.controller.class }} +
    Route name - {{ request_route }} + {{ collector.route|default('NONE') }}
    Has session diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig index db807a7211..7aff16eb70 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig @@ -16,18 +16,19 @@ {% endif %} {% block toolbar %} - {% set duration = collector.events|length ? '%.0f ms'|format(collector.duration) : 'n/a' %} + {% set duration = collector.events|length ? '%.0f'|format(collector.duration) : 'n/a' %} + {% set status_color = collector.events|length ? collector.duration > 1000 ? 'yellow' : '' %} {% set icon %} - - {{ duration }} + {{ duration }} + ms {% endset %} {% set text %}
    Total time - {{ duration }} + {{ duration }} ms
    {% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url } %} + {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url, 'block_status': status_color } %} {% endblock %} {% block menu %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig index 840e7cd1ac..815ce29320 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig @@ -5,14 +5,11 @@ {% block toolbar %} {% if collector.messages|length %} {% set icon %} - - {% if collector.countMissings %} - {% set status_color = "red" %} - {% elseif collector.countFallbacks %} - {% set status_color = "yellow" %} - {% endif %} + + + {% set status_color = collector.countMissings ? 'red' : collector.countFallbacks ? 'yellow' : '' %} {% set error_count = collector.countMissings + collector.countFallbacks %} - {{ error_count ?: collector.countdefines }} + {{ error_count ?: collector.countdefines }} {% endset %} {% set text %} {% if collector.countMissings %} @@ -34,7 +31,7 @@
    {% endif %} {% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url } %} + {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url, 'block_status': status_color } %} {% endif %} {% endblock %} @@ -57,14 +54,6 @@ {% endblock %} {% block panelContent %} - {% set filter = request.query.get('state', '-1') %} - {% set filterOptions = { - '-1': '', - (constant('Symfony\\Component\\Translation\\DataCollectorTranslator::MESSAGE_DEFINED')): 'Defined messages', - (constant('Symfony\\Component\\Translation\\DataCollectorTranslator::MESSAGE_MISSING')): 'Missing messages', - (constant('Symfony\\Component\\Translation\\DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK')): 'Fallback messages', - } %} -

    Translation Stats

    @@ -80,22 +69,6 @@ - - - -
    Missing messages
    {{ collector.countMissings }}
    Filter -
    - - - -
    -
    @@ -107,7 +80,7 @@ Id Message Preview - {% for message in collector.messages if message.state == filter or filter == '-1' %} + {% for message in collector.messages %} {{ translator.state(message) }} {{ message.locale }} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig index 0ecd469bd0..5d102e1370 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig @@ -1,10 +1,13 @@ {% extends '@WebProfiler/Profiler/layout.html.twig' %} {% block toolbar %} - {% set time = collector.templatecount ? '%0.0f ms'|format(collector.time) : 'n/a' %} + {% set time = collector.templatecount ? '%0.0f'|format(collector.time) : 'n/a' %} {% set icon %} - Twig - {{ time }} + + Twig + {{ time }} + ms + {% endset %} {% set text %}
    diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig index e313380e51..7cfcface33 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig @@ -180,7 +180,7 @@ requestCounter[0].textContent = requestStack.length; - var className = 'sf-toolbar-ajax-requests sf-toolbar-status'; + var className = 'sf-toolbar-ajax-requests sf-toolvar-value'; if (state == 'ok') { className += ' sf-toolbar-status-green'; } else if (state == 'error') { diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig index fd32565347..3e453b0a21 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig @@ -179,7 +179,7 @@ pre, code { width: 250px; margin-left: -100%; } -table td { +#collector-content table td { background-color: white; } h1 { @@ -273,15 +273,15 @@ ul.alt li { ul.alt li.even { background: #f1f7e2; } -ul.alt li.error, tr.error td { +ul.alt li.error { background-color: #f66; margin-bottom: 1px; } -ul.alt li.warning, tr.warning td { +ul.alt li.warning { background-color: #ffcc00; margin-bottom: 1px; } -ul.alt li.scream, ul.alt li.scream strong, tr.scream td, tr.scream strong { +ul.alt li.scream, ul.alt li.scream strong { color: gray; } ul.sf-call-stack li { diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 8d736a716d..c31156d750 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -7,13 +7,7 @@ padding: 5px 5px 0; - background-color: #f7f7f7; - background-image: -moz-linear-gradient(top, #e4e4e4, #ffffff); - background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#e4e4e4), to(#ffffff)); - background-image: -o-linear-gradient(top, #e4e4e4, #ffffff); - background: linear-gradient(top, #e4e4e4, #ffffff); - - border-radius: 16px 0 0 0; + background-color: #222; z-index: 6000000; } @@ -26,39 +20,32 @@ } .sf-toolbarreset { - position: fixed; - background-color: #f7f7f7; - left: 0; - right: 0; - margin: 0; - padding: 0 40px 0 0; - z-index: 6000000; - font: 11px Verdana, Arial, sans-serif; - text-align: left; - color: #2f2f2f; - - background-image: -moz-linear-gradient(top, #e4e4e4, #ffffff); - background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#e4e4e4), to(#ffffff)); - background-image: -o-linear-gradient(top, #e4e4e4, #ffffff); - background: linear-gradient(top, #e4e4e4, #ffffff); - + background-color: #222; + box-shadow: 0 -1px 0px rgba(0, 0, 0, 0.2); bottom: 0; - border-top: 1px solid #bbb; + color: #EEE; + font: 11px Arial, sans-serif; + height: 36px; + left: 0; + margin: 0; + padding: 0 36px 0 0; + position: fixed; + right: 0; + text-align: left; + z-index: 6000000; } .sf-toolbarreset abbr { - border-bottom: 1px dotted #000000; - cursor: help; -} -.sf-toolbarreset span, -.sf-toolbarreset div, -.sf-toolbarreset td, -.sf-toolbarreset th { - font-size: 11px; + border: none; + cursor: text; } .sf-toolbarreset img { width: auto; display: inline; } +.sf-toolbarreset svg, +.sf-toolbarreset img { + max-height: 24px; +} .sf-toolbarreset table { border-collapse: collapse; border-spacing: 0; @@ -70,42 +57,74 @@ table-layout: auto; } .sf-toolbarreset .hide-button { + background: #444; + cursor: pointer; display: block; position: absolute; top: 0; right: 0; - width: 40px; - height: 40px; + width: 36px; + height: 30px; cursor: pointer; - background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAMAAAAMCGV4AAAAllBMVEXDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PExMTPz8/Q0NDR0dHT09Pb29vc3Nzf39/h4eHi4uLj4+P6+vr7+/v8/Pz9/f3///+Nh2QuAAAAIXRSTlMABgwPGBswMzk8QktRV4SKjZOWmaKlq7TAxszb3urt+fy1vNEpAAAAiklEQVQIHUXBBxKCQBREwRFzDqjoGh+C2YV//8u5Sll2S0E/dof1tKdKM6GyqCto7PjZRJIS/mbSELgXOSd/BzpKIH1ZefVWpDDTHsi8mZVnwImPi5ndCLbaAZk3M58Bay0h9VbeSvMpjDUAHj4jL55AW1rxN5fU2PLjIgVRzNdxVFOlGzvnJi0Fb1XNGBHA9uQOAAAAAElFTkSuQmCC'); - background-repeat: no-repeat; - background-position: 13px 11px; + padding-top: 6px; + text-align: center; +} +.sf-toolbarreset .hide-button svg { + max-height: 24px; + max-width: 24px; } .sf-toolbar-block { - white-space: nowrap; - color: #2f2f2f; - display: block; - min-height: 28px; - border-bottom: 1px solid #e4e4e4; - border-right: 1px solid #e4e4e4; - padding: 0; - float: left; cursor: default; + display: block; + float: left; + margin-right: 0px; + white-space: nowrap; +} +.sf-toolbar-block a:hover { + text-decoration: none; +} +.sf-toolbar-block-config-symfony, +.sf-toolbar-block-config-php { + float: right; + margin-left: 0; + margin-right: 0; +} +.sf-toolbar-block-time { + margin-right: 0; +} +.sf-toolbar-block-ajax { + display: none; } .sf-toolbar-block span { display: inline-block; } +.sf-toolbar-block .sf-toolbar-value { + color: #F5F5F5; + font-size: 13px; + line-height: 36px; + padding: 0; +} +.sf-toolbar-block .sf-toolbar-label { + color: #AAA; + font-size: 12px; +} +.sf-toolbar-block-config-php .sf-toolbar-label, +.sf-toolbar-block-config-symfony .sf-toolbar-label { + font-size: 11px; +} +.sf-toolbar-block-twig img { + opacity: .8; +} .sf-toolbar-block .sf-toolbar-info-piece { - line-height: 19px; - margin-bottom: 5px; + line-height: 1.4; + margin-bottom: 8px; } .sf-toolbar-block .sf-toolbar-info-piece .sf-toolbar-status { padding: 0px 5px; - border-radius: 5px; margin-bottom: 0px; vertical-align: top; } @@ -114,16 +133,26 @@ margin-bottom: 0; } -.sf-toolbar-block .sf-toolbar-info-piece a, -.sf-toolbar-block .sf-toolbar-info-piece abbr { - color: #2f2f2f; +.sf-toolbar-block .sf-toolbar-info-piece a { + color: #75D1EA; + text-decoration: underline; +} +.sf-toolbar-block .sf-toolbar-info-piece a:hover { + text-decoration: none; } .sf-toolbar-block .sf-toolbar-info-piece b { + color: #AAA; display: inline-block; + font-size: 11px; min-width: 110px; vertical-align: top; } +.sf-toolbar-block .sf-toolbar-info-piece span, +.sf-toolbar-block .sf-toolbar-info-piece abbr { + color: #F5F5F5; + font-size: 12px; +} .sf-toolbar-block .sf-toolbar-info-with-next-pointer:after { content: ' :: '; @@ -133,20 +162,16 @@ .sf-toolbar-block .sf-toolbar-info-with-delimiter { border-right: 1px solid #999; padding-right: 5px; + margin-right: 5px; } .sf-toolbar-block .sf-toolbar-info { + background-color: #444; + bottom: 36px; + color: #F5F5F5; display: none; - position: absolute; - background-color: #fff; - border: 1px solid #bbb; padding: 9px 0; - margin-left: -1px; - - bottom: 38px; - border-bottom-width: 0; - border-bottom: 1px solid #bbb; - border-radius: 4px 4px 0 0; + position: absolute; } .sf-toolbar-block .sf-toolbar-info:empty { @@ -165,43 +190,67 @@ min-height: 13px; } -.sf-toolbar-block .sf-toolbar-status abbr { - color: #fff; - border-bottom: 1px dotted black; -} - .sf-toolbar-block .sf-toolbar-status-green { background-color: #759e1a; } - .sf-toolbar-block .sf-toolbar-status-red { - background-color: #a33; + background-color: rgba(200,0,0, 0.8); } - .sf-toolbar-block .sf-toolbar-status-yellow { background-color: #ffcc00; color: #000; } - .sf-toolbar-block .sf-toolbar-status-black { background-color: #000; } -.sf-toolbar-block .sf-toolbar-icon { - display: block; +.sf-toolbar-block.sf-toolbar-status-green { + background-color: #759e1a; + color: #FFF; +} +.sf-toolbar-block.sf-toolbar-status-red { + background-color: rgba(200,0,0, 0.8); + color: #FFF; +} +.sf-toolbar-block.sf-toolbar-status-red svg > g > path { + fill: #FFF; +} +.sf-toolbar-block.sf-toolbar-status-yellow { + background-color: rgba(255,158,43, 0.8); + color: #FFF; +} +.sf-toolbar-block-request .sf-toolbar-status { + border-radius: 0 !important; + color: #FFF; + font-size: 14px; + margin-right: 4px; + padding: 10px; } +.sf-toolbar-status-green .sf-toolbar-label, +.sf-toolbar-status-yellow .sf-toolbar-label, +.sf-toolbar-status-red .sf-toolbar-label { + color: #FFF; +} + +.sf-toolbar-block .sf-toolbar-icon { + display: block; + padding: 0 10px; +} +.sf-toolbar-block-request .sf-toolbar-icon { + padding-left: 0; +} + +/* .sf-toolbar-block .sf-toolbar-icon > a, .sf-toolbar-block .sf-toolbar-icon > span { - display: block; - font-weight: normal; text-decoration: none; margin: 0; padding: 5px 8px; min-width: 20px; text-align: center; vertical-align: middle; -} +}*/ .sf-toolbar-block .sf-toolbar-icon > a, .sf-toolbar-block .sf-toolbar-icon > a:link @@ -216,11 +265,12 @@ .sf-toolbar-block .sf-toolbar-icon img, .sf-toolbar-block .sf-toolbar-icon svg { border-width: 0; vertical-align: middle; + position: relative; + top: -1px; } .sf-toolbar-block .sf-toolbar-icon img + span, .sf-toolbar-block .sf-toolbar-icon svg + span { - margin-left: 5px; - margin-top: 2px; + margin-left: 4px; } .sf-toolbar-block .sf-toolbar-icon .sf-toolbar-status { @@ -230,8 +280,6 @@ } .sf-toolbar-block .sf-toolbar-info-method { - border-bottom: 1px dashed #ccc; - cursor: help; } .sf-toolbar-block .sf-toolbar-info-method[onclick=""] { @@ -260,22 +308,13 @@ display: none; } -.sf-toolbarreset:hover { - box-shadow: rgba(0, 0, 0, 0.3) 0 0 50px; -} - .sf-toolbar-block:hover { - box-shadow: rgba(0, 0, 0, 0.35) 0 0 5px; - border-right: none; - margin-right: 1px; position: relative; } .sf-toolbar-block:hover .sf-toolbar-icon { - background-color: #fff; - border-top: 1px dotted #DDD; + background-color: #444; position: relative; - margin-top: -1px; z-index: 10002; } @@ -286,7 +325,7 @@ z-index: 10001; box-sizing: border-box; padding: 9px; - line-height: 19px; + line-height: 1.5; max-width: 480px; max-height: 480px; @@ -433,11 +472,3 @@ display: none; } } - -/***** Media query print: Do not print the Toolbar. *****/ -@media print { - .sf-toolbar { - display: none; - visibility: hidden; - } -} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig index dbe3d0cdbf..dc769c9cad 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig @@ -15,7 +15,7 @@ Sfjs.setPreference('toolbar/displayState', 'block'); "> - +
    {% endif %} @@ -43,7 +43,7 @@ document.getElementById('sfMiniToolbar-{{ token }}').style.display = 'block'; Sfjs.setPreference('toolbar/displayState', 'none'); "> - + {{ include('@WebProfiler/Icon/close.svg.twig') }} {% endif %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig index ab4e07f93e..18292e8f1a 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig @@ -1,5 +1,5 @@ -
    {{ text|default('') }}
    {% if link %}
    {% endif %} From 27353463084f65e2ddec9504d39fdb8ff9d05204 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 8 Jul 2015 10:38:08 +0200 Subject: [PATCH 16/63] Fixed a minor markup error that broke the toolbar --- .../Resources/views/Profiler/toolbar.css.twig | 3 +++ .../Resources/views/Profiler/toolbar_item.html.twig | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 883165795e..cfce041ac3 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -89,6 +89,9 @@ margin-left: 0; margin-right: 0; } +.sf-toolbar-block-config svg { + padding-right: 4px; +} .sf-toolbar-block-time { margin-right: 0; } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig index 18292e8f1a..6a8fa473e4 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig @@ -1,5 +1,5 @@
    - {% if link %}{% endif %}
    {{ icon|default('') }}
    {{ text|default('') }}
    {% if link %}
    {% endif %} From 51a79c92e6cc3d632e6132f99ef95b9c63829942 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 8 Jul 2015 11:40:01 +0200 Subject: [PATCH 17/63] Reorder toolbar panels --- .../Profiler/TemplateManager.php | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php b/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php index 5d0fd277c5..aa281b8da1 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php @@ -72,6 +72,8 @@ class TemplateManager public function getTemplates(Profile $profile) { $templates = $this->getNames($profile); + $templates = $this->reorderTemplates($templates); + foreach ($templates as $name => $template) { $templates[$name] = $this->twig->loadTemplate($template); } @@ -134,4 +136,47 @@ class TemplateManager return false; } + + /** + * It changes the default order of collector templates to show them in a + * different order which is better for design and aesthetic reasons. + * + * @param array $templates + * @return array + */ + protected function reorderTemplates($templates) + { + $templates = $this->moveArrayElementToFirstPosition($templates, 'memory'); + $templates = $this->moveArrayElementToFirstPosition($templates, 'time'); + $templates = $this->moveArrayElementToFirstPosition($templates, 'request'); + + $templates = $this->moveArrayElementToLastPosition($templates, 'config'); + + return $templates; + } + + private function moveArrayElementToFirstPosition($array, $key) + { + if (!array_key_exists($key, $array)) { + return $array; + } + + $value = $array[$key]; + unset($array[$key]); + + return array_merge(array($key => $value), $array); + } + + private function moveArrayElementToLastPosition($array, $key) + { + if (!array_key_exists($key, $array)) { + return $array; + } + + $value = $array[$key]; + unset($array[$key]); + $array[$key] = $value; + + return $array; + } } From ef53850cb3e9139c2c88fa841a3e085111403bce Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 8 Jul 2015 12:13:55 +0200 Subject: [PATCH 18/63] More fixes and tweaks --- .../Profiler/TemplateManager.php | 1 + .../views/Collector/config.html.twig | 17 +++++------ .../views/Collector/request.html.twig | 9 ++++-- .../Resources/views/Profiler/toolbar.css.twig | 28 ++++++++++--------- 4 files changed, 31 insertions(+), 24 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php b/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php index aa281b8da1..2a12198542 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php @@ -146,6 +146,7 @@ class TemplateManager */ protected function reorderTemplates($templates) { + $templates = $this->moveArrayElementToFirstPosition($templates, 'twig'); $templates = $this->moveArrayElementToFirstPosition($templates, 'memory'); $templates = $this->moveArrayElementToFirstPosition($templates, 'time'); $templates = $this->moveArrayElementToFirstPosition($templates, 'request'); diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig index a0705f6e4c..adfc00c8af 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig @@ -33,14 +33,6 @@ {% endset %} {% set text %} - {% if collector.symfonyversion is defined %} - - {% endif %} - {% if collector.applicationname %}
    {{ collector.applicationname }} {{ collector.applicationversion }} @@ -94,6 +86,15 @@ PHP SAPI {{ collector.sapiName }}
    + + {% if collector.symfonyversion is defined %} + + {% endif %} {% endset %} {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: false, status: block_status }) }} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig index 43ef440374..68a1d025f9 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig @@ -21,17 +21,19 @@ {% set icon %} {{ collector.statuscode }} - {{ request_handler }} + @ + {{ collector.route }} {% endset %} + {% set text %} {% spaceless %}
    HTTP status - {{ collector.statuscode }} {{ collector.statustext }} + {{ collector.statuscode }} {{ collector.statustext }}
    Controller method - {{ request_handler }} + {{ request_handler }}
    Controller file @@ -47,6 +49,7 @@
    {% endspaceless %} {% endset %} + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url }) }} {% endblock %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index cfce041ac3..32511b9290 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -120,15 +120,19 @@ opacity: .8; } +.sf-toolbar-block .sf-toolbar-info { + display: table; +} .sf-toolbar-block .sf-toolbar-info-piece { + display: table-row; line-height: 1.4; margin-bottom: 8px; } .sf-toolbar-block .sf-toolbar-info-piece .sf-toolbar-status { - padding: 0px 5px; + border-radius: 0; + padding: 2px 5px; margin-bottom: 0px; - vertical-align: top; } .sf-toolbar-block .sf-toolbar-info-piece:last-child { @@ -145,10 +149,12 @@ .sf-toolbar-block .sf-toolbar-info-piece b { color: #AAA; - display: inline-block; + display: table-cell; font-size: 11px; - min-width: 110px; - vertical-align: top; + padding: 4px 8px 4px 4px; +} +.sf-toolbar-block .sf-toolbar-info-piece span { + } .sf-toolbar-block .sf-toolbar-info-piece span, .sf-toolbar-block .sf-toolbar-info-piece abbr { @@ -196,7 +202,7 @@ background-color: #759e1a; } .sf-toolbar-block .sf-toolbar-status-red { - background-color: rgba(200,0,0, 0.8); + background-color: rgba(200, 0, 0, 0.8); } .sf-toolbar-block .sf-toolbar-status-yellow { background-color: #ffcc00; @@ -211,7 +217,7 @@ color: #FFF; } .sf-toolbar-block.sf-toolbar-status-red { - background-color: rgba(200,0,0, 0.8); + background-color: rgba(200, 0, 0, 0.8); color: #FFF; } .sf-toolbar-block.sf-toolbar-status-red svg > g > path { @@ -292,12 +298,8 @@ .sf-toolbar-info-php {} .sf-toolbar-info-php-ext {} -.sf-toolbar-info-php-ext .sf-toolbar-status { - margin-left: 2px; -} - -.sf-toolbar-info-php-ext .sf-toolbar-status:first-child { - margin-left: 0; +.sf-toolbar-info-php-ext .sf-toolbar-status + .sf-toolbar-status { + margin-left: 4px; } .sf-toolbar-block a .sf-toolbar-info-piece-additional, From fac5391dab21061344aeee13c20be90307ce8a51 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 8 Jul 2015 15:54:44 +0200 Subject: [PATCH 19/63] Lots of minor improvements --- .../Resources/views/Profiler/toolbar.css.twig | 38 +++---------------- .../views/Profiler/toolbar_item.html.twig | 2 +- 2 files changed, 6 insertions(+), 34 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 32511b9290..255a9b02d0 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -232,6 +232,7 @@ color: #FFF; font-size: 14px; margin-right: 4px; + max-height: 36px; padding: 10px; } @@ -389,55 +390,26 @@ /***** Override the setting when the toolbar is on the top *****/ {% if position == 'top' %} .sf-minitoolbar { - top: 0; bottom: auto; right: 0; - - background-color: #f7f7f7; - - background-image: -moz-linear-gradient(225deg, #e4e4e4, #ffffff); - background-image: -webkit-gradient(linear, 100% 0%, 0% 0%, from(#e4e4e4), to(#ffffff)); - background-image: -o-linear-gradient(135deg, #e4e4e4, #ffffff); - background: linear-gradient(225deg, #e4e4e4, #ffffff); - - border-radius: 0 0 0 16px; + top: 0; } .sf-toolbarreset { - background-image: -moz-linear-gradient(225deg, #e4e4e4, #ffffff); - background-image: -webkit-gradient(linear, 100% 0%, 0% 0%, from(#e4e4e4), to(#ffffff)); - background-image: -o-linear-gradient(135deg, #e4e4e4, #ffffff); - background: linear-gradient(225deg, #e4e4e4, #ffffff); - - top: 0; bottom: auto; - border-bottom: 1px solid #bbb; + box-shadow: 0 1px 0px rgba(0, 0, 0, 0.2); + top: 0; } .sf-toolbar-block .sf-toolbar-info { - top: 39px; bottom: auto; - border-top-width: 0; - border-radius: 0 0 4px 4px; - } - - .sf-toolbar-block:hover .sf-toolbar-icon { - border-top: none; - border-bottom: 1px dotted #DDD; - margin-top: 0; - margin-bottom: -1px; + top: 36px; } {% endif %} {% if not floatable %} .sf-toolbarreset { position: static; - background: #cbcbcb; - - background-image: -moz-linear-gradient(90deg, #cbcbcb, #e8e8e8) !important; - background-image: -webkit-gradient(linear, 0% 0%, 100% 0%, from(#cbcbcb), to(#e8e8e8)) !important; - background-image: -o-linear-gradient(180deg, #cbcbcb, #e8e8e8) !important; - background: linear-gradient(90deg, #cbcbcb, #e8e8e8) !important; } {% endif %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig index 6a8fa473e4..2f30e05c9a 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig @@ -1,6 +1,6 @@
    {% if link %}{% endif %}
    {{ icon|default('') }}
    -
    {{ text|default('') }}
    {% if link %}
    {% endif %} +
    {{ text|default('') }}
    From acee052b686403ee84904c8ade376e9304304f22 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 8 Jul 2015 17:40:13 +0200 Subject: [PATCH 20/63] Finished the Ajax panel redesign --- .../Resources/views/Collector/ajax.html.twig | 9 ++-- .../views/Collector/request.html.twig | 13 +++-- .../Resources/views/Collector/twig.html.twig | 2 +- .../views/Profiler/base_js.html.twig | 19 +++---- .../Resources/views/Profiler/toolbar.css.twig | 50 +++++++++++-------- 5 files changed, 54 insertions(+), 39 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig index 3c7b99b028..fd9ee91c56 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig @@ -2,13 +2,13 @@ {% block toolbar %} {% set icon %} + {{ include('@WebProfiler/Icon/ajax.svg.twig') }} 0 - ajax {% endset %} + {% set text %}
    - AJAX requests - +
    @@ -24,5 +24,6 @@
    {% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': false } %} + + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: false }) }} {% endblock %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig index 68a1d025f9..1d0d805c43 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig @@ -4,14 +4,19 @@ {% set request_handler %} {% if collector.controller.class is defined %} {% set link = collector.controller.file|file_link(collector.controller.line) %} + {% if link %}{% endif %} + + + {{ collector.controller.class|abbr_class }} + + {% if collector.controller.method %} - {{ collector.controller.class|abbr_class }} - + {{ collector.controller.method }} - {% else %} - {{ collector.controller.class|abbr_class }} {% endif %} + + {% if link %}{% endif %} {% else %} {{ collector.controller }} {% endif %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig index 629d06cf11..959295a87e 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig @@ -4,7 +4,7 @@ {% set time = collector.templatecount ? '%0.0f'|format(collector.time) : 'n/a' %} {% set icon %} - Twig + {{ include('@WebProfiler/Icon/twig.html.twig') }} {{ time }} ms diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig index 29b1d5b363..cdf6818897 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig @@ -165,7 +165,7 @@ tbody.appendChild(rows); if (infoSpan) { - var text = requestStack.length + ' call' + (requestStack.length > 1 ? 's' : ''); + var text = requestStack.length + ' AJAX request' + (requestStack.length > 1 ? 's' : ''); infoSpan.textContent = text; } } else { @@ -181,15 +181,16 @@ requestCounter[0].textContent = requestStack.length; var className = 'sf-toolbar-ajax-requests sf-toolbar-value'; - if (state == 'ok') { - className += ' sf-toolbar-status-green'; - } else if (state == 'error') { - className += ' sf-toolbar-status-red'; - } else { - className += ' sf-ajax-request-loading'; - } - requestCounter[0].className = className; + + var ajaxToolbarPanel = document.querySelectorAll('.sf-toolbar-block-ajax'); + if (state == 'ok') { + ajaxToolbarPanel.className = 'sf-toolbar-status-green'; + } else if (state == 'error') { + ajaxToolbarPanel.className = 'sf-toolbar-status-red'; + } else { + ajaxToolbarPanel.className = 'sf-ajax-request-loading'; + } }; var addEventListener; diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 255a9b02d0..77447e2f9c 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -92,12 +92,6 @@ .sf-toolbar-block-config svg { padding-right: 4px; } -.sf-toolbar-block-time { - margin-right: 0; -} -.sf-toolbar-block-ajax { - display: none; -} .sf-toolbar-block span { display: inline-block; @@ -140,7 +134,7 @@ } .sf-toolbar-block .sf-toolbar-info-piece a { - color: #75D1EA; + color: #99CDD8; text-decoration: underline; } .sf-toolbar-block .sf-toolbar-info-piece a:hover { @@ -288,17 +282,13 @@ margin-top: 0; } -.sf-toolbar-block .sf-toolbar-info-method { +.sf-toolbar-block-time .sf-toolbar-icon { + padding-right: 5px; } - -.sf-toolbar-block .sf-toolbar-info-method[onclick=""] { - border-bottom: none; - cursor: inherit; +.sf-toolbar-block-memory .sf-toolbar-icon { + padding-left: 5px; } -.sf-toolbar-info-php {} -.sf-toolbar-info-php-ext {} - .sf-toolbar-info-php-ext .sf-toolbar-status + .sf-toolbar-status { margin-left: 4px; } @@ -339,14 +329,26 @@ overflow-y: auto; } -.sf-toolbar-ajax-requests th, .sf-toolbar-ajax-requests td { - border-bottom: 1px solid #ddd; - padding: 0 4px; - color: #2f2f2f; - background-color: #fff; +.sf-toolbar-info-piece b.sf-toolbar-ajax-info { + color: #F5F5F5; +} +.sf-toolbar-ajax-requests { + width: 100%; +} + +.sf-toolbar-ajax-requests td { + background-color: #444; + border-bottom: 1px solid #777; + color: #F5F5F5; + font-size: 12px; + padding: 4px; } .sf-toolbar-ajax-requests th { - background-color: #eee; + background-color: #222; + border-bottom: 0; + color: #AAA; + font-size: 11px; + padding: 4px; } .sf-ajax-request-url { max-width: 300px; @@ -354,6 +356,12 @@ overflow: hidden; text-overflow: ellipsis; } +.sf-toolbar-ajax-requests .sf-ajax-request-url a { + text-decoration: none; +} +.sf-toolbar-ajax-requests .sf-ajax-request-url a:hover { + text-decoration: underline; +} .sf-ajax-request-duration { text-align: right; } From af3dcb2a976f715e697eb7479e76ddebdca65210 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 8 Jul 2015 18:01:44 +0200 Subject: [PATCH 21/63] Minor Ajax tweaks --- .../Resources/views/Profiler/base_js.html.twig | 8 ++------ .../Resources/views/Profiler/toolbar.css.twig | 3 +++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig index cdf6818897..03a242b627 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig @@ -169,12 +169,8 @@ infoSpan.textContent = text; } } else { - var cell = document.createElement('td'); - cell.setAttribute('colspan', '4'); - cell.textContent = "No AJAX requests yet."; - var row = document.createElement('tr'); - row.appendChild(cell); - tbody.appendChild(row); + var ajaxToolbarPanel = document.querySelectorAll('.sf-toolbar-block-ajax'); + ajaxToolbarPanel[0].style.display = 'none'; } } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 77447e2f9c..6896555af7 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -343,6 +343,9 @@ font-size: 12px; padding: 4px; } +.sf-toolbar-ajax-requests tr:last-child td { + border-bottom: 0; +} .sf-toolbar-ajax-requests th { background-color: #222; border-bottom: 0; From 041d4243a1102d9e8dc9fab914f4da04c839302e Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 9 Jul 2015 09:23:43 +0200 Subject: [PATCH 22/63] Improved the Security toolbar panel --- .../views/Collector/security.html.twig | 22 ++++++----- .../Resources/views/Profiler/toolbar.css.twig | 39 ++++--------------- 2 files changed, 20 insertions(+), 41 deletions(-) diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig index 1a1352ab32..2ca6a02ee5 100644 --- a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig +++ b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig @@ -2,12 +2,17 @@ {% block toolbar %} {% if collector.tokenClass %} - {% set color_code = (collector.enabled and collector.authenticated) ? '' : 'yellow' %} - {% set authentication_color_code = (collector.enabled and collector.authenticated) ? 'green' : 'red' %} - {% set authentication_color_text = (collector.enabled and collector.authenticated) ? 'Yes' : 'No' %} + {% set is_authenticated = collector.enabled and collector.authenticated %} + {% set color_code = is_authenticated ? '' : 'yellow' %} {% else %} - {% set color_code = collector.enabled ? 'red' : '' %} + {% set color_code = collector.enabled ? 'red' : '' %} {% endif %} + + {% set icon %} + + {{ collector.user|default('n/a') }} + {% endset %} + {% set text %} {% if collector.tokenClass %}
    @@ -16,7 +21,7 @@
    Authenticated - {{ authentication_color_text }} + {{ is_authenticated ? 'Yes' : 'No' }}
    {% if collector.tokenClass != null %}
    @@ -30,11 +35,8 @@ The security is disabled. {% endif %} {% endset %} - {% set icon %} - - {% if collector.user %}{{ collector.user }}{% endif %} - {% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url, 'block_status': color_code } %} + + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: color_code }) }} {% endblock %} {% block menu %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 6896555af7..4b8619f6b4 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -202,9 +202,6 @@ background-color: #ffcc00; color: #000; } -.sf-toolbar-block .sf-toolbar-status-black { - background-color: #000; -} .sf-toolbar-block.sf-toolbar-status-green { background-color: #759e1a; @@ -221,6 +218,7 @@ background-color: rgba(255,158,43, 0.8); color: #FFF; } + .sf-toolbar-block-request .sf-toolbar-status { border-radius: 0 !important; color: #FFF; @@ -235,6 +233,11 @@ .sf-toolbar-status-red .sf-toolbar-label { color: #FFF; } +.sf-toolbar-status-green svg *, +.sf-toolbar-status-red svg *, +.sf-toolbar-status-yellow svg * { + fill: #FFF; +} .sf-toolbar-block .sf-toolbar-icon { display: block; @@ -244,27 +247,6 @@ padding-left: 0; } -/* -.sf-toolbar-block .sf-toolbar-icon > a, -.sf-toolbar-block .sf-toolbar-icon > span { - text-decoration: none; - margin: 0; - padding: 5px 8px; - min-width: 20px; - text-align: center; - vertical-align: middle; -}*/ - -.sf-toolbar-block .sf-toolbar-icon > a, -.sf-toolbar-block .sf-toolbar-icon > a:link -.sf-toolbar-block .sf-toolbar-icon > a:hover { - color: black !important; -} - -.sf-toolbar-block .sf-toolbar-icon > a[href]:after { - content: ""; -} - .sf-toolbar-block .sf-toolbar-icon img, .sf-toolbar-block .sf-toolbar-icon svg { border-width: 0; vertical-align: middle; @@ -272,16 +254,11 @@ top: -1px; } -.sf-toolbar-block .sf-toolbar-icon img + span, .sf-toolbar-block .sf-toolbar-icon svg + span { +.sf-toolbar-block .sf-toolbar-icon img + span, +.sf-toolbar-block .sf-toolbar-icon svg + span { margin-left: 4px; } -.sf-toolbar-block .sf-toolbar-icon .sf-toolbar-status { - border-radius: 12px; - border-bottom-left-radius: 0; - margin-top: 0; -} - .sf-toolbar-block-time .sf-toolbar-icon { padding-right: 5px; } From 77d522a8cb56219bcd6309af7958b95d0c821f98 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 9 Jul 2015 10:28:18 +0200 Subject: [PATCH 23/63] Tweaked the translation panel --- .../views/Collector/config.html.twig | 8 ++-- .../views/Collector/translation.html.twig | 41 ++++++++++--------- .../Resources/views/Icon/ajax.svg.twig | 1 + .../Resources/views/Icon/close.svg.twig | 1 + .../Resources/views/Icon/symfony.svg.twig | 1 + .../Resources/views/Icon/translation.svg.twig | 1 + .../Resources/views/Icon/twig.html.twig | 1 + .../Resources/views/Profiler/toolbar.css.twig | 11 +++-- 8 files changed, 36 insertions(+), 29 deletions(-) create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg.twig create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg.twig create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg.twig create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.html.twig diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig index adfc00c8af..08babc2ea0 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig @@ -90,9 +90,11 @@ {% if collector.symfonyversion is defined %} {% endif %} {% endset %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig index ed33872746..7eefbde73c 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig @@ -5,32 +5,33 @@ {% block toolbar %} {% if collector.messages|length %} {% set icon %} - - + {{ include('@WebProfiler/Icon/translation.svg.twig') }} {% set status_color = collector.countMissings ? 'red' : collector.countFallbacks ? 'yellow' : '' %} {% set error_count = collector.countMissings + collector.countFallbacks %} {{ error_count ?: collector.countdefines }} {% endset %} + {% set text %} - {% if collector.countMissings %} -
    - Missing messages - {{ collector.countMissings }} -
    - {% endif %} - {% if collector.countFallbacks %} -
    - Fallback messages - {{ collector.countFallbacks }} -
    - {% endif %} - {% if collector.countdefines %} -
    - Defined messages - {{ collector.countdefines }} -
    - {% endif %} +
    + Missing messages + + {{ collector.countMissings|default(0) }} + +
    + +
    + Fallback messages + + {{ collector.countFallbacks|default(0) }} + +
    + +
    + Defined messages + {{ collector.countdefines|default(0) }} +
    {% endset %} + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: status_color }) }} {% endif %} {% endblock %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg.twig new file mode 100644 index 0000000000..ba77a3aa7f --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg.twig @@ -0,0 +1 @@ + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg.twig new file mode 100644 index 0000000000..70b4d589bc --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg.twig @@ -0,0 +1 @@ + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig new file mode 100644 index 0000000000..da9802c388 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig @@ -0,0 +1 @@ + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg.twig new file mode 100644 index 0000000000..ed8601a2a9 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg.twig @@ -0,0 +1 @@ + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.html.twig new file mode 100644 index 0000000000..a8e72424cf --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.html.twig @@ -0,0 +1 @@ +Twig diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 4b8619f6b4..20f50e1cfb 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -193,18 +193,17 @@ } .sf-toolbar-block .sf-toolbar-status-green { - background-color: #759e1a; + background-color: rgba(117, 158, 43, 0.8); } .sf-toolbar-block .sf-toolbar-status-red { - background-color: rgba(200, 0, 0, 0.8); + background-color: rgba(200, 43, 43, 0.8); } .sf-toolbar-block .sf-toolbar-status-yellow { - background-color: #ffcc00; - color: #000; + background-color: rgba(255, 158, 43, 0.8); } .sf-toolbar-block.sf-toolbar-status-green { - background-color: #759e1a; + background-color: rgba(117, 158, 43, 0.8); color: #FFF; } .sf-toolbar-block.sf-toolbar-status-red { @@ -215,7 +214,7 @@ fill: #FFF; } .sf-toolbar-block.sf-toolbar-status-yellow { - background-color: rgba(255,158,43, 0.8); + background-color: rgba(255, 158, 43, 0.8); color: #FFF; } From c0bee9b7e7cdc03b140ba5bf4862caf97e1b1064 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 9 Jul 2015 10:45:55 +0200 Subject: [PATCH 24/63] Tweaked the Twig panel --- .../Resources/views/Collector/twig.html.twig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig index 959295a87e..20a07327ca 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig @@ -12,19 +12,19 @@ {% set text %}
    Render Time - {{ time }} + {{ time }} ms
    Template Calls - {{ collector.templatecount }} + {{ collector.templatecount }}
    Block Calls - {{ collector.blockcount }} + {{ collector.blockcount }}
    Macro Calls - {{ collector.macrocount }} + {{ collector.macrocount }}
    {% endset %} {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url }) }} From 2bccdd4a62f262092c4653ff2e70517623c2eb14 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 9 Jul 2015 10:58:45 +0200 Subject: [PATCH 25/63] Minor CSS fixes --- .../Resources/views/Profiler/toolbar.css.twig | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 20f50e1cfb..c6b9fa3e4d 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -124,7 +124,6 @@ } .sf-toolbar-block .sf-toolbar-info-piece .sf-toolbar-status { - border-radius: 0; padding: 2px 5px; margin-bottom: 0px; } @@ -182,10 +181,9 @@ .sf-toolbar-block .sf-toolbar-status { display: inline-block; - color: #fff; + color: #FFF; background-color: #666; padding: 3px 6px; - border-radius: 3px; margin-bottom: 2px; vertical-align: middle; min-width: 6px; @@ -207,7 +205,7 @@ color: #FFF; } .sf-toolbar-block.sf-toolbar-status-red { - background-color: rgba(200, 0, 0, 0.8); + background-color: rgba(200, 43, 43, 0.8); color: #FFF; } .sf-toolbar-block.sf-toolbar-status-red svg > g > path { @@ -219,7 +217,6 @@ } .sf-toolbar-block-request .sf-toolbar-status { - border-radius: 0 !important; color: #FFF; font-size: 14px; margin-right: 4px; @@ -232,9 +229,9 @@ .sf-toolbar-status-red .sf-toolbar-label { color: #FFF; } -.sf-toolbar-status-green svg *, -.sf-toolbar-status-red svg *, -.sf-toolbar-status-yellow svg * { +.sf-toolbar-status-green svg > g > path, +.sf-toolbar-status-red svg > g > path, +.sf-toolbar-status-yellow svg > g > path { fill: #FFF; } From b25b6dd608e0646b8e265c34a4af789d30f5859b Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 9 Jul 2015 14:56:10 +0200 Subject: [PATCH 26/63] Finished "dump" panel and other minor tweaks --- .../Resources/views/Profiler/dump.html.twig | 14 ++++---- .../Resources/views/Collector/form.html.twig | 16 +++++++-- .../views/Collector/logger.html.twig | 36 +++++++++---------- .../views/Collector/memory.html.twig | 4 ++- .../Resources/views/Collector/time.html.twig | 14 ++++++-- .../Resources/views/Collector/twig.html.twig | 2 ++ .../Resources/views/Profiler/toolbar.css.twig | 19 ++++++++++ 7 files changed, 72 insertions(+), 33 deletions(-) diff --git a/src/Symfony/Bundle/DebugBundle/Resources/views/Profiler/dump.html.twig b/src/Symfony/Bundle/DebugBundle/Resources/views/Profiler/dump.html.twig index e7a8245fb3..2ce0899080 100644 --- a/src/Symfony/Bundle/DebugBundle/Resources/views/Profiler/dump.html.twig +++ b/src/Symfony/Bundle/DebugBundle/Resources/views/Profiler/dump.html.twig @@ -5,17 +5,14 @@ {% if dumps_count %} {% set icon %} - - {{ dumps_count }} + + {{ dumps_count }} {% endset %} {% set text %} -
    - dump() -
    {% for dump in collector.getDumps('html') %}
    - in + {% if dump.file %} {% set link = dump.file|file_link(dump.line) %} {% if link %} @@ -26,14 +23,15 @@ {% else %} {{ dump.name }} {% endif %} - line {{ dump.line }}: + + line {{ dump.line }} {{ dump.data|raw }}
    {% endfor %} {% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': true } %} + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { 'link': true }) }} {% endif %} {% endblock %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig index 979ef56d31..27515f7522 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig @@ -4,8 +4,9 @@ {% block toolbar %} {% if collector.data.nb_errors > 0 or collector.data.forms|length %} + {% set status_color = collector.data.nb_errors ? 'red' : '' %} {% set icon %} - + {{ include('@WebProfiler/Icon/form.svg.twig') }} {% if collector.data.nb_errors %} {{ collector.data.nb_errors }} @@ -15,7 +16,18 @@ {% endset %} - {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: collector.data.nb_errors ? 'red' : '' }) }} + {% set text %} +
    + Number of forms + {{ collector.data.forms|length }} +
    +
    + Number of errors + {{ collector.data.nb_errors }} +
    + {% endset %} + + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: status_color }) }} {% endif %} {% endblock %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig index 10858a531b..6344197eff 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig @@ -5,31 +5,29 @@ {% block toolbar %} {% if collector.counterrors or collector.countdeprecations or collector.countscreams %} {% set icon %} - {% set status_color = collector.counterrors ? 'red' : collector.countdeprecations ? 'yellow' : '' %} {% set error_count = collector.counterrors + collector.countdeprecations + collector.countscreams %} + {{ include('@WebProfiler/Icon/logger.svg.twig') }} {{ error_count }} {% endset %} + {% set text %} - {% if collector.counterrors %} -
    - Errors - {{ collector.counterrors }} -
    - {% endif %} - {% if collector.countdeprecations %} -
    - Deprecated Calls - {{ collector.countdeprecations }} -
    - {% endif %} - {% if collector.countscreams %} -
    - Silenced Errors - {{ collector.countscreams }} -
    - {% endif %} +
    + Errors + {{ collector.counterrors|default(0) }} +
    + +
    + Deprecated Calls + {{ collector.countdeprecations|default(0) }} +
    + +
    + Silenced Errors + {{ collector.countscreams|default(0) }} +
    {% endset %} + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: status_color }) }} {% endif %} {% endblock %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig index af68792e1b..b101596843 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig @@ -8,6 +8,7 @@ MB {% endset %} + {% set text %}
    Peak memory usage @@ -16,8 +17,9 @@
    PHP memory limit - {{ collector.memoryLimit == -1 ? '∞' : '%.1f'|format(collector.memoryLimit / 1024 / 1024)|escape }} MB + {{ collector.memoryLimit == -1 ? '∞' : '%.0f'|format(collector.memoryLimit / 1024 / 1024)|escape }} MB
    {% endset %} + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: false, status: status_color }) }} {% endblock %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig index 4b743f9902..558a155bdb 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig @@ -16,18 +16,26 @@ {% endif %} {% block toolbar %} - {% set duration = collector.events|length ? '%.0f'|format(collector.duration) : 'n/a' %} + {% set total_time = collector.events|length ? '%.0f'|format(collector.duration) : 'n/a' %} + {% set initialization_time = collector.events|length ? '%.0f'|format(collector.inittime) : 'n/a' %} {% set status_color = collector.events|length ? collector.duration > 1000 ? 'yellow' : '' %} + {% set icon %} - {{ duration }} + {{ total_time }} ms {% endset %} + {% set text %}
    Total time - {{ duration }} ms + {{ total_time }} ms +
    +
    + Initialization time + {{ initialization_time }} ms
    {% endset %} + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: status_color }) }} {% endblock %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig index 20a07327ca..293180757f 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig @@ -9,6 +9,7 @@ ms {% endset %} + {% set text %}
    Render Time @@ -27,6 +28,7 @@ {{ collector.macrocount }}
    {% endset %} + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url }) }} {% endblock %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index c6b9fa3e4d..de56ad35db 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -81,6 +81,7 @@ margin-right: 0px; white-space: nowrap; } +.sf-toolbar-block a, .sf-toolbar-block a:hover { text-decoration: none; } @@ -371,6 +372,24 @@ 100% { color: black; } } +.sf-toolbar-block-dump pre.sf-dump { + background-color: #222; + border-color: #777; + border-radius: 0; + margin: 6px 0 12px 0; + width: 200px; +} +.sf-toolbar-block-dump pre.sf-dump:last-child { + margin-bottom: 0; +} +.sf-toolbar-block-dump .sf-toolbar-info-piece .sf-toolbar-file-line { + color: #AAA; + margin-left: 4px; +} +.sf-toolbar-block-dump .sf-toolbar-info img { + display: none; +} + /***** Override the setting when the toolbar is on the top *****/ {% if position == 'top' %} .sf-minitoolbar { From 9d89841e3aaa708a0215db7ad866cfb52b6f2261 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 9 Jul 2015 18:09:41 +0200 Subject: [PATCH 27/63] Finished the toolbar redesign --- .../views/Collector/config.html.twig | 20 +- .../views/Collector/memory.html.twig | 7 +- .../views/Collector/request.html.twig | 26 +- .../Resources/views/Collector/time.html.twig | 1 + .../Resources/views/Icon/form.svg.twig | 1 + .../Resources/views/Icon/logger.svg.twig | 1 + .../Resources/views/Icon/memory.svg.twig | 1 + .../Resources/views/Icon/symfony.svg.twig | 2 +- .../Resources/views/Icon/time.svg.twig | 1 + .../views/Profiler/base_js.html.twig | 8 +- .../Resources/views/Profiler/toolbar.css.twig | 233 +++++++++--------- 11 files changed, 155 insertions(+), 146 deletions(-) create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg.twig create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg.twig create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg.twig create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg.twig diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig index 08babc2ea0..4b66f4589a 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig @@ -19,17 +19,15 @@ {% endif %} {% set icon %} - {% if collector.symfonyState is defined %} - - - {{ include('@WebProfiler/Icon/symfony.svg.twig') }} - - {{ collector.symfonyversion }} - - {% elseif collector.applicationname %} - {{ collector.applicationname }} - {{ collector.applicationversion }} - {% endif %} + {% if collector.symfonyState is defined %} + + {{ include('@WebProfiler/Icon/symfony.svg.twig') }} + + {{ collector.symfonyversion }} + {% elseif collector.applicationname %} + {{ collector.applicationname }} + {{ collector.applicationversion }} + {% endif %} {% endset %} {% set text %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig index b101596843..5dd2269747 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig @@ -3,10 +3,9 @@ {% block toolbar %} {% set icon %} {% set status_color = (collector.memory / 1024 / 1024) > 50 ? 'yellow' : '' %} - - {{ '%.1f'|format(collector.memory / 1024 / 1024) }} - MB - + {{ include('@WebProfiler/Icon/memory.svg.twig') }} + {{ '%.1f'|format(collector.memory / 1024 / 1024) }} + MB {% endset %} {% set text %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig index 1d0d805c43..25cecdc201 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig @@ -1,24 +1,22 @@ {% extends '@WebProfiler/Profiler/layout.html.twig' %} {% block toolbar %} + + {% set request_handler %} {% if collector.controller.class is defined %} {% set link = collector.controller.file|file_link(collector.controller.line) %} - {% if link %}{% endif %} + {% if link %}{% else %}{% endif %} - - {{ collector.controller.class|abbr_class }} - + {{ collector.controller.class|abbr_class|striptags }} - {% if collector.controller.method %} - - {{ collector.controller.method }} - - {% endif %} + {%- if collector.controller.method -%} +  :: {{ collector.controller.method }} + {%- endif -%} - {% if link %}{% endif %} + {% if link %}{% else %}{% endif %} {% else %} - {{ collector.controller }} + {{ collector.controller }} {% endif %} {% endset %} @@ -26,8 +24,10 @@ {% set icon %} {{ collector.statuscode }} - @ - {{ collector.route }} + {% if collector.route %} + @ + {{ collector.route }} + {% endif %} {% endset %} {% set text %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig index 558a155bdb..8b5330df6b 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig @@ -21,6 +21,7 @@ {% set status_color = collector.events|length ? collector.duration > 1000 ? 'yellow' : '' %} {% set icon %} + {{ include('@WebProfiler/Icon/time.svg.twig') }} {{ total_time }} ms {% endset %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg.twig new file mode 100644 index 0000000000..07bd665507 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg.twig @@ -0,0 +1 @@ + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg.twig new file mode 100644 index 0000000000..b29b2071d4 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg.twig @@ -0,0 +1 @@ + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg.twig new file mode 100644 index 0000000000..90b195a521 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg.twig @@ -0,0 +1 @@ + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig index da9802c388..d4136c0958 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig @@ -1 +1 @@ - + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg.twig new file mode 100644 index 0000000000..65f3671084 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg.twig @@ -0,0 +1 @@ + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig index 03a242b627..d0f51c42d2 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig @@ -180,12 +180,10 @@ requestCounter[0].className = className; var ajaxToolbarPanel = document.querySelectorAll('.sf-toolbar-block-ajax'); - if (state == 'ok') { - ajaxToolbarPanel.className = 'sf-toolbar-status-green'; - } else if (state == 'error') { - ajaxToolbarPanel.className = 'sf-toolbar-status-red'; + if (state == 'error') { + Sfjs.addClass(ajaxToolbarPanel[0], 'sf-toolbar-status-red'); } else { - ajaxToolbarPanel.className = 'sf-ajax-request-loading'; + Sfjs.addClass(ajaxToolbarPanel[0], 'sf-ajax-request-loading'); } }; diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index de56ad35db..975ed9639f 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -1,15 +1,12 @@ .sf-minitoolbar { - display: none; - - position: fixed; - bottom: 0; - right: 0; - - padding: 5px 5px 0; - background-color: #222; - - z-index: 6000000; + bottom: 0; + display: none; + height: 36px; + padding: 5px 6px 0; + position: fixed; + right: 0; + z-index: 9999; } .sf-toolbarreset * { @@ -21,8 +18,8 @@ .sf-toolbarreset { background-color: #222; - box-shadow: 0 -1px 0px rgba(0, 0, 0, 0.2); bottom: 0; + box-shadow: 0 -1px 0px rgba(0, 0, 0, 0.2); color: #EEE; font: 11px Arial, sans-serif; height: 36px; @@ -32,30 +29,16 @@ position: fixed; right: 0; text-align: left; - z-index: 6000000; + z-index: 9999; } .sf-toolbarreset abbr { border: none; cursor: text; } -.sf-toolbarreset img { - width: auto; - display: inline; -} .sf-toolbarreset svg, .sf-toolbarreset img { max-height: 24px; } -.sf-toolbarreset table { - border-collapse: collapse; - border-spacing: 0; - background-color: #000; - margin: 0; - padding: 0; - border: 0; - width: 100%; - table-layout: auto; -} .sf-toolbarreset .hide-button { background: #444; cursor: pointer; @@ -78,20 +61,17 @@ cursor: default; display: block; float: left; - margin-right: 0px; + height: 36px; + margin-right: 0; white-space: nowrap; } -.sf-toolbar-block a, -.sf-toolbar-block a:hover { +.sf-toolbar-block > a, +.sf-toolbar-block > a:hover { + display: block; text-decoration: none; } -.sf-toolbar-block-config { - float: right; - margin-left: 0; - margin-right: 0; -} .sf-toolbar-block-config svg { - padding-right: 4px; + max-height: 22px; } .sf-toolbar-block span { @@ -103,25 +83,33 @@ line-height: 36px; padding: 0; } -.sf-toolbar-block .sf-toolbar-label { +.sf-toolbar-block .sf-toolbar-label, +.sf-toolbar-block .sf-toolbar-class-separator { color: #AAA; font-size: 12px; } -.sf-toolbar-block-config-php .sf-toolbar-label, -.sf-toolbar-block-config-symfony .sf-toolbar-label { - font-size: 11px; -} +/* TODO: remove it when Twig uses SVG icons */ .sf-toolbar-block-twig img { opacity: .8; } .sf-toolbar-block .sf-toolbar-info { + border-collapse: collapse; display: table; } +.sf-toolbar-block .sf-toolbar-info-piece-group { + border-top: 1px solid #777; + margin-top: 4px; + padding-top: 4px; +} .sf-toolbar-block .sf-toolbar-info-piece { + /* this 'border-bottom' trick is needed because 'margin-bottom' doesn't work for table rows */ + border-bottom: solid transparent 3px; display: table-row; - line-height: 1.4; - margin-bottom: 8px; +} +.sf-toolbar-block .sf-toolbar-info-piece-additional, +.sf-toolbar-block .sf-toolbar-info-piece-additional-detail { + display: none; } .sf-toolbar-block .sf-toolbar-info-piece .sf-toolbar-status { @@ -198,7 +186,7 @@ background-color: rgba(200, 43, 43, 0.8); } .sf-toolbar-block .sf-toolbar-status-yellow { - background-color: rgba(255, 158, 43, 0.8); + background-color: rgb(189, 132, 0); } .sf-toolbar-block.sf-toolbar-status-green { @@ -213,16 +201,21 @@ fill: #FFF; } .sf-toolbar-block.sf-toolbar-status-yellow { - background-color: rgba(255, 158, 43, 0.8); + background-color: rgb(189, 132, 0); color: #FFF; } .sf-toolbar-block-request .sf-toolbar-status { color: #FFF; font-size: 14px; - margin-right: 4px; max-height: 36px; - padding: 10px; + padding: 10px 7px; +} +.sf-toolbar-block-request .sf-toolbar-info-piece a { + text-decoration: none; +} +.sf-toolbar-block-request .sf-toolbar-info-piece a:hover { + text-decoration: underline; } .sf-toolbar-status-green .sf-toolbar-label, @@ -238,17 +231,23 @@ .sf-toolbar-block .sf-toolbar-icon { display: block; - padding: 0 10px; + height: 36px; + padding: 0 7px; } .sf-toolbar-block-request .sf-toolbar-icon { padding-left: 0; + padding-right: 0; } -.sf-toolbar-block .sf-toolbar-icon img, .sf-toolbar-block .sf-toolbar-icon svg { +.sf-toolbar-block .sf-toolbar-icon img, +.sf-toolbar-block .sf-toolbar-icon svg { border-width: 0; - vertical-align: middle; position: relative; - top: -1px; + top: 5px; +} +.sf-toolbar-block-translation .sf-toolbar-icon svg, +.sf-toolbar-block-config .sf-toolbar-icon svg { + top: 8px; } .sf-toolbar-block .sf-toolbar-icon img + span, @@ -256,27 +255,10 @@ margin-left: 4px; } -.sf-toolbar-block-time .sf-toolbar-icon { - padding-right: 5px; -} -.sf-toolbar-block-memory .sf-toolbar-icon { - padding-left: 5px; -} - .sf-toolbar-info-php-ext .sf-toolbar-status + .sf-toolbar-status { margin-left: 4px; } -.sf-toolbar-block a .sf-toolbar-info-piece-additional, -.sf-toolbar-block a .sf-toolbar-info-piece-additional-detail { - display: inline-block; -} - -.sf-toolbar-block a .sf-toolbar-info-piece-additional:empty, -.sf-toolbar-block a .sf-toolbar-info-piece-additional-detail:empty { - display: none; -} - .sf-toolbar-block:hover { position: relative; } @@ -289,13 +271,7 @@ .sf-toolbar-block:hover .sf-toolbar-info { display: block; - min-width: -webkit-calc(100% + 2px); - min-width: calc(100% + 2px); - z-index: 10001; - box-sizing: border-box; - padding: 9px; - line-height: 1.5; - + padding: 8px; max-width: 480px; max-height: 480px; word-wrap: break-word; @@ -309,7 +285,6 @@ .sf-toolbar-ajax-requests { width: 100%; } - .sf-toolbar-ajax-requests td { background-color: #444; border-bottom: 1px solid #777; @@ -342,9 +317,6 @@ .sf-ajax-request-duration { text-align: right; } -.sf-ajax-request-error { - color: #a33 !important; -} .sf-ajax-request-loading { -webkit-animation: sf-blink .5s ease-in-out infinite; -o-animation: sf-blink .5s ease-in-out infinite; @@ -352,24 +324,24 @@ animation: sf-blink .5s ease-in-out infinite; } @-webkit-keyframes sf-blink { - 0% { color: black; } - 50% { color: #bbb; } - 100% { color: black; } + 0% { background: #222; } + 50% { background: #444; } + 100% { background: #222; } } @-moz-keyframes sf-blink { - 0% { color: black; } - 50% { color: #bbb; } - 100% { color: black; } + 0% { background: #222; } + 50% { background: #444; } + 100% { background: #222; } } @-o-keyframes sf-blink { - 0% { color: black; } - 50% { color: #bbb; } - 100% { color: black; } + 0% { background: #222; } + 50% { background: #444; } + 100% { background: #222; } } @keyframes sf-blink { - 0% { color: black; } - 50% { color: #bbb; } - 100% { color: black; } + 0% { background: #222; } + 50% { background: #444; } + 100% { background: #222; } } .sf-toolbar-block-dump pre.sf-dump { @@ -390,7 +362,7 @@ display: none; } -/***** Override the setting when the toolbar is on the top *****/ +/* Override the setting when the toolbar is on the top */ {% if position == 'top' %} .sf-minitoolbar { bottom: auto; @@ -416,38 +388,75 @@ } {% endif %} -/***** Media query *****/ -@media screen and (max-width: 779px) { - .sf-toolbar-block .sf-toolbar-icon > * > :first-child ~ * { +/* Responsive Design */ +.sf-toolbar-icon .sf-toolbar-label, +.sf-toolbar-icon .sf-toolbar-value { + display: none; +} +.sf-toolbar-block-config .sf-toolbar-icon .sf-toolbar-label { + display: inline-block; +} + +@media (min-width: 768px) { +.navbar-brand::before { content: "768 px"; background: red; + color: white; + position: absolute; } + + .sf-toolbar-icon .sf-toolbar-label, + .sf-toolbar-icon .sf-toolbar-value { + display: inline; + } + + .sf-toolbar-block .sf-toolbar-icon img, + .sf-toolbar-block .sf-toolbar-icon svg { + top: 6px; + } + .sf-toolbar-block-config .sf-toolbar-icon svg { + top: 8px; + } + .sf-toolbar-block-time .sf-toolbar-icon svg, + .sf-toolbar-block-memory .sf-toolbar-icon svg { display: none; } - .sf-toolbar-block .sf-toolbar-icon > * > .sf-toolbar-info-piece-additional, - .sf-toolbar-block .sf-toolbar-icon > * > .sf-toolbar-info-piece-additional-detail { - display: none !important; + .sf-toolbar-block .sf-toolbar-icon { + padding: 0 10px; + } + .sf-toolbar-block-time .sf-toolbar-icon { + padding-right: 5px; + } + .sf-toolbar-block-memory .sf-toolbar-icon { + padding-left: 5px; + } + .sf-toolbar-block-request .sf-toolbar-icon { + padding-left: 0; + } + .sf-toolbar-block-request .sf-toolbar-status { + margin-right: 4px; + padding: 10px; + } + .sf-toolbar-block-config { + float: right; + margin-left: 0; + margin-right: 0; } } -@media screen and (min-width: 880px) { - .sf-toolbar-block .sf-toolbar-icon a[href$="config"] .sf-toolbar-info-piece-additional { +@media (min-width: 1024px) { +.navbar-brand::before { content: "1024 px"; } + + .sf-toolbar-block .sf-toolbar-info-piece-additional, + .sf-toolbar-block .sf-toolbar-info-piece-additional-detail { display: inline-block; } -} -@media screen and (min-width: 980px) { - .sf-toolbar-block .sf-toolbar-icon a[href$="security"] .sf-toolbar-info-piece-additional { - display: inline-block; - } -} - -@media screen and (max-width: 1179px) { - .sf-toolbar-block .sf-toolbar-icon > * > .sf-toolbar-info-piece-additional { + .sf-toolbar-block .sf-toolbar-info-piece-additional:empty, + .sf-toolbar-block .sf-toolbar-info-piece-additional-detail:empty { display: none; } } -@media screen and (max-width: 1439px) { - .sf-toolbar-block .sf-toolbar-icon > * > .sf-toolbar-info-piece-additional-detail { - display: none; - } +@media (min-width: 1200px) { +.navbar-brand::before { content: "1200 px"; } + } From e14fb6d5c9f65d99aae169e136293da6e8d9ba8e Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 9 Jul 2015 18:11:29 +0200 Subject: [PATCH 28/63] Fixed a minor syntax issue --- .../Bundle/WebProfilerBundle/Profiler/TemplateManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php b/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php index 2a12198542..7be8c7296a 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php @@ -141,7 +141,7 @@ class TemplateManager * It changes the default order of collector templates to show them in a * different order which is better for design and aesthetic reasons. * - * @param array $templates + * @param array $templates * @return array */ protected function reorderTemplates($templates) From 7c35d25baeecfd0c8687d5692f7992f8169acabb Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 9 Jul 2015 18:22:31 +0200 Subject: [PATCH 29/63] Fixed another insignificant syntax issue --- .../Bundle/WebProfilerBundle/Profiler/TemplateManager.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php b/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php index 7be8c7296a..3cb004c460 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php @@ -142,6 +142,7 @@ class TemplateManager * different order which is better for design and aesthetic reasons. * * @param array $templates + * * @return array */ protected function reorderTemplates($templates) From 23dc884dcfefb205f5139470016a9018244ebcc3 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 9 Jul 2015 22:41:25 +0200 Subject: [PATCH 30/63] Fixed a potential issue in the request panel --- .../Resources/views/Collector/request.html.twig | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig index 25cecdc201..b7d693b6e7 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig @@ -40,10 +40,12 @@ Controller method {{ request_handler }}
    -
    - Controller file - {{ collector.controller.class }} -
    + {% if collector.controller.class is defined %} +
    + Controller file + {{ collector.controller.class }} +
    + {% endif %}
    Route name {{ collector.route|default('NONE') }} From e28f895a182fb27f780b9f8e350da1cef2b56ec1 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 9 Jul 2015 22:43:30 +0200 Subject: [PATCH 31/63] A very high z-index value is required to avoid issues in the profiler view --- .../Resources/views/Profiler/toolbar.css.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 975ed9639f..02cadc5790 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -6,7 +6,7 @@ padding: 5px 6px 0; position: fixed; right: 0; - z-index: 9999; + z-index: 99999; } .sf-toolbarreset * { @@ -29,7 +29,7 @@ position: fixed; right: 0; text-align: left; - z-index: 9999; + z-index: 99999; } .sf-toolbarreset abbr { border: none; From cd5321016116b7768822a3517e6aa1ae98160f75 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 10 Jul 2015 10:08:14 +0200 Subject: [PATCH 32/63] Fixed another z-index issue --- .../WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 02cadc5790..cc35f17d9c 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -96,6 +96,7 @@ .sf-toolbar-block .sf-toolbar-info { border-collapse: collapse; display: table; + z-index: 99999; } .sf-toolbar-block .sf-toolbar-info-piece-group { border-top: 1px solid #777; From 0dfcb602ef69ada4d64ea83cb7653c8ea9b80ffa Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 10 Jul 2015 10:11:14 +0200 Subject: [PATCH 33/63] Fixed an issue with the Config panel in the Profiler view --- .../Resources/views/Profiler/toolbar.css.twig | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index cc35f17d9c..eb6eaeff64 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -399,10 +399,6 @@ } @media (min-width: 768px) { -.navbar-brand::before { content: "768 px"; background: red; - color: white; - position: absolute; } - .sf-toolbar-icon .sf-toolbar-label, .sf-toolbar-icon .sf-toolbar-value { display: inline; @@ -415,6 +411,9 @@ .sf-toolbar-block-config .sf-toolbar-icon svg { top: 8px; } + .sf-toolbar-block-config:hover .sf-toolbar-info { + right: 0; + } .sf-toolbar-block-time .sf-toolbar-icon svg, .sf-toolbar-block-memory .sf-toolbar-icon svg { display: none; @@ -444,8 +443,6 @@ } @media (min-width: 1024px) { -.navbar-brand::before { content: "1024 px"; } - .sf-toolbar-block .sf-toolbar-info-piece-additional, .sf-toolbar-block .sf-toolbar-info-piece-additional-detail { display: inline-block; @@ -458,6 +455,4 @@ } @media (min-width: 1200px) { -.navbar-brand::before { content: "1200 px"; } - } From 9e38a8aa963e5be67db9fef0e80652c700b04469 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 10 Jul 2015 10:28:54 +0200 Subject: [PATCH 34/63] Minor CSS tweaks and made font sizes bigger --- .../views/Collector/security.html.twig | 10 ++++++--- .../Resources/views/Profiler/toolbar.css.twig | 22 +++++-------------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig index 2ca6a02ee5..7ecaf82759 100644 --- a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig +++ b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig @@ -26,13 +26,17 @@ {% if collector.tokenClass != null %}
    Token class - {{ collector.tokenClass|abbr_class }} + {{ collector.tokenClass|abbr_class }}
    {% endif %} {% elseif collector.enabled %} - You are not authenticated. +
    + You are not authenticated. +
    {% else %} - The security is disabled. +
    + The security is disabled. +
    {% endif %} {% endset %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index eb6eaeff64..3e3fa44041 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -133,27 +133,15 @@ .sf-toolbar-block .sf-toolbar-info-piece b { color: #AAA; display: table-cell; - font-size: 11px; + font-size: 12px; padding: 4px 8px 4px 4px; } .sf-toolbar-block .sf-toolbar-info-piece span { } -.sf-toolbar-block .sf-toolbar-info-piece span, -.sf-toolbar-block .sf-toolbar-info-piece abbr { +.sf-toolbar-block .sf-toolbar-info-piece span { color: #F5F5F5; - font-size: 12px; -} - -.sf-toolbar-block .sf-toolbar-info-with-next-pointer:after { - content: ' :: '; - color: #999; -} - -.sf-toolbar-block .sf-toolbar-info-with-delimiter { - border-right: 1px solid #999; - padding-right: 5px; - margin-right: 5px; + font-size: 13px; } .sf-toolbar-block .sf-toolbar-info { @@ -279,7 +267,9 @@ overflow: hidden; overflow-y: auto; } - +.sf-toolbar-block-request:hover .sf-toolbar-info { + max-width: none; +} .sf-toolbar-info-piece b.sf-toolbar-ajax-info { color: #F5F5F5; } From f087ac0bcd5a3e7e08fd3cb1be6c208364b0e3d2 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 10 Jul 2015 10:47:29 +0200 Subject: [PATCH 35/63] More vertical aligning fixes --- .../Resources/views/Collector/twig.html.twig | 8 +++----- .../Resources/views/Profiler/toolbar.css.twig | 11 +++++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig index 293180757f..4f758a1d12 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig @@ -3,11 +3,9 @@ {% block toolbar %} {% set time = collector.templatecount ? '%0.0f'|format(collector.time) : 'n/a' %} {% set icon %} - - {{ include('@WebProfiler/Icon/twig.html.twig') }} - {{ time }} - ms - + {{ include('@WebProfiler/Icon/twig.html.twig') }} + {{ time }} + ms {% endset %} {% set text %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 3e3fa44041..2314f0896d 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -393,11 +393,22 @@ .sf-toolbar-icon .sf-toolbar-value { display: inline; } + .sf-toolbar-block .sf-toolbar-value { + /* needed for perfect vertical aligning */ + line-height: 37px; + } .sf-toolbar-block .sf-toolbar-icon img, .sf-toolbar-block .sf-toolbar-icon svg { top: 6px; } + /* TODO: needed for perfect vertical aligning, remove when icons are recreated */ + .sf-toolbar-block-twig .sf-toolbar-icon img { + top: 7px; + } + .sf-toolbar-block-security .sf-toolbar-icon svg { + top: 7px; + } .sf-toolbar-block-config .sf-toolbar-icon svg { top: 8px; } From 3ab2e20913e70aa7524a1c13f93174ed55666f4f Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 14 Jul 2015 13:03:21 +0200 Subject: [PATCH 36/63] fixed all vertical aligning issues and tweaked icons --- .../Resources/views/Profiler/dump.html.twig | 5 +- .../views/Collector/security.html.twig | 4 +- .../Resources/views/Icon/ajax.svg.twig | 7 +- .../Resources/views/Icon/close.svg.twig | 6 +- .../Resources/views/Icon/form.svg.twig | 7 +- .../Resources/views/Icon/logger.svg.twig | 8 ++- .../Resources/views/Icon/memory.svg.twig | 6 +- .../Resources/views/Icon/symfony.svg.twig | 13 +++- .../Resources/views/Icon/time.svg.twig | 6 +- .../Resources/views/Icon/translation.svg.twig | 14 +++- .../Resources/views/Icon/twig.html.twig | 6 +- .../Resources/views/Profiler/toolbar.css.twig | 64 ++++++------------- 12 files changed, 92 insertions(+), 54 deletions(-) diff --git a/src/Symfony/Bundle/DebugBundle/Resources/views/Profiler/dump.html.twig b/src/Symfony/Bundle/DebugBundle/Resources/views/Profiler/dump.html.twig index 2ce0899080..7f23547469 100644 --- a/src/Symfony/Bundle/DebugBundle/Resources/views/Profiler/dump.html.twig +++ b/src/Symfony/Bundle/DebugBundle/Resources/views/Profiler/dump.html.twig @@ -5,7 +5,10 @@ {% if dumps_count %} {% set icon %} - + + + + {{ dumps_count }} {% endset %} diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig index 7ecaf82759..6c5b85356d 100644 --- a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig +++ b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig @@ -9,7 +9,9 @@ {% endif %} {% set icon %} - + + + {{ collector.user|default('n/a') }} {% endset %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg.twig index ba77a3aa7f..d8cad847d4 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg.twig @@ -1 +1,6 @@ - + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg.twig index 70b4d589bc..49a75fc165 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg.twig @@ -1 +1,5 @@ - + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg.twig index 07bd665507..18bdb6e793 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg.twig @@ -1 +1,6 @@ - + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg.twig index b29b2071d4..3270a33618 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg.twig @@ -1 +1,7 @@ - + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg.twig index 90b195a521..5cd2fc4d84 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg.twig @@ -1 +1,5 @@ - + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig index d4136c0958..8d0ab1417f 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig @@ -1 +1,12 @@ - + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg.twig index 65f3671084..ec280a59a6 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg.twig @@ -1 +1,5 @@ - + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg.twig index ed8601a2a9..93d42327ed 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg.twig @@ -1 +1,13 @@ - + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.html.twig index a8e72424cf..21d81ea216 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.html.twig @@ -1 +1,5 @@ -Twig + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 2314f0896d..6f7f95ebc9 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -37,7 +37,7 @@ } .sf-toolbarreset svg, .sf-toolbarreset img { - max-height: 24px; + max-height: 20px; } .sf-toolbarreset .hide-button { background: #444; @@ -47,15 +47,11 @@ top: 0; right: 0; width: 36px; - height: 30px; + height: 28px; cursor: pointer; - padding-top: 6px; + padding-top: 8px; text-align: center; } -.sf-toolbarreset .hide-button svg { - max-height: 24px; - max-width: 24px; -} .sf-toolbar-block { cursor: default; @@ -70,9 +66,6 @@ display: block; text-decoration: none; } -.sf-toolbar-block-config svg { - max-height: 22px; -} .sf-toolbar-block span { display: inline-block; @@ -117,6 +110,9 @@ padding: 2px 5px; margin-bottom: 0px; } +.sf-toolbar-block .sf-toolbar-info-piece .sf-toolbar-status + .sf-toolbar-status { + margin-left: 4px; +} .sf-toolbar-block .sf-toolbar-info-piece:last-child { margin-bottom: 0; @@ -134,7 +130,7 @@ color: #AAA; display: table-cell; font-size: 12px; - padding: 4px 8px 4px 4px; + padding: 4px 8px 4px 0; } .sf-toolbar-block .sf-toolbar-info-piece span { @@ -186,9 +182,6 @@ background-color: rgba(200, 43, 43, 0.8); color: #FFF; } -.sf-toolbar-block.sf-toolbar-status-red svg > g > path { - fill: #FFF; -} .sf-toolbar-block.sf-toolbar-status-yellow { background-color: rgb(189, 132, 0); color: #FFF; @@ -196,9 +189,11 @@ .sf-toolbar-block-request .sf-toolbar-status { color: #FFF; + display: inline-block; font-size: 14px; - max-height: 36px; - padding: 10px 7px; + height: 36px; + line-height: 36px; + padding: 0 10px; } .sf-toolbar-block-request .sf-toolbar-info-piece a { text-decoration: none; @@ -212,9 +207,12 @@ .sf-toolbar-status-red .sf-toolbar-label { color: #FFF; } -.sf-toolbar-status-green svg > g > path, -.sf-toolbar-status-red svg > g > path, -.sf-toolbar-status-yellow svg > g > path { +.sf-toolbar-status-green svg path, +.sf-toolbar-status-red svg path, +.sf-toolbar-status-yellow svg path { + fill: #FFF; +} +.sf-toolbar-block-config svg path { fill: #FFF; } @@ -232,10 +230,6 @@ .sf-toolbar-block .sf-toolbar-icon svg { border-width: 0; position: relative; - top: 5px; -} -.sf-toolbar-block-translation .sf-toolbar-icon svg, -.sf-toolbar-block-config .sf-toolbar-icon svg { top: 8px; } @@ -243,24 +237,21 @@ .sf-toolbar-block .sf-toolbar-icon svg + span { margin-left: 4px; } - -.sf-toolbar-info-php-ext .sf-toolbar-status + .sf-toolbar-status { +.sf-toolbar-block-config .sf-toolbar-icon .sf-toolbar-value { margin-left: 4px; } .sf-toolbar-block:hover { position: relative; } - .sf-toolbar-block:hover .sf-toolbar-icon { background-color: #444; position: relative; z-index: 10002; } - .sf-toolbar-block:hover .sf-toolbar-info { display: block; - padding: 8px; + padding: 10px; max-width: 480px; max-height: 480px; word-wrap: break-word; @@ -393,25 +384,11 @@ .sf-toolbar-icon .sf-toolbar-value { display: inline; } - .sf-toolbar-block .sf-toolbar-value { - /* needed for perfect vertical aligning */ - line-height: 37px; - } .sf-toolbar-block .sf-toolbar-icon img, .sf-toolbar-block .sf-toolbar-icon svg { top: 6px; } - /* TODO: needed for perfect vertical aligning, remove when icons are recreated */ - .sf-toolbar-block-twig .sf-toolbar-icon img { - top: 7px; - } - .sf-toolbar-block-security .sf-toolbar-icon svg { - top: 7px; - } - .sf-toolbar-block-config .sf-toolbar-icon svg { - top: 8px; - } .sf-toolbar-block-config:hover .sf-toolbar-info { right: 0; } @@ -432,10 +409,11 @@ .sf-toolbar-block-request .sf-toolbar-icon { padding-left: 0; } + .sf-toolbar-block-request .sf-toolbar-status { margin-right: 4px; - padding: 10px; } + .sf-toolbar-block-config { float: right; margin-left: 0; From 9b585b980855938b69e9db5d54a0ae8d356caf3d Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 14 Jul 2015 15:44:49 +0200 Subject: [PATCH 37/63] Made the close icon a bit smaller --- .../Resources/views/Profiler/toolbar.css.twig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 6f7f95ebc9..8698818f9f 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -39,6 +39,7 @@ .sf-toolbarreset img { max-height: 20px; } + .sf-toolbarreset .hide-button { background: #444; cursor: pointer; @@ -47,11 +48,14 @@ top: 0; right: 0; width: 36px; - height: 28px; + height: 36px; cursor: pointer; - padding-top: 8px; text-align: center; } +.sf-toolbarreset .hide-button svg { + max-height: 18px; + padding-top: 10px; +} .sf-toolbar-block { cursor: default; From e94a6a02b15098450c073e54a109c29532dd6dc1 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 20 Jul 2015 11:29:57 +0200 Subject: [PATCH 38/63] Smaller font sizes for smartphones, fixed request status padding issue and make too long panels always be displayed at the leftmost part of browser window --- .../Resources/views/Profiler/toolbar.css.twig | 26 ++++++++++++++----- .../views/Profiler/toolbar_js.html.twig | 5 +++- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 8698818f9f..909198b948 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -133,7 +133,7 @@ .sf-toolbar-block .sf-toolbar-info-piece b { color: #AAA; display: table-cell; - font-size: 12px; + font-size: 11px; padding: 4px 8px 4px 0; } .sf-toolbar-block .sf-toolbar-info-piece span { @@ -141,7 +141,7 @@ } .sf-toolbar-block .sf-toolbar-info-piece span { color: #F5F5F5; - font-size: 13px; + font-size: 12px; } .sf-toolbar-block .sf-toolbar-info { @@ -262,9 +262,6 @@ overflow: hidden; overflow-y: auto; } -.sf-toolbar-block-request:hover .sf-toolbar-info { - max-width: none; -} .sf-toolbar-info-piece b.sf-toolbar-ajax-info { color: #F5F5F5; } @@ -384,6 +381,7 @@ } @media (min-width: 768px) { + .sf-toolbar-icon .sf-toolbar-label, .sf-toolbar-icon .sf-toolbar-value { display: inline; @@ -412,10 +410,24 @@ } .sf-toolbar-block-request .sf-toolbar-icon { padding-left: 0; + padding-right: 0; + } + .sf-toolbar-block-request .sf-toolbar-status + .sf-toolbar-label { + margin-left: 4px; + } + .sf-toolbar-block-request .sf-toolbar-label + .sf-toolbar-value { + margin-right: 10px; } - .sf-toolbar-block-request .sf-toolbar-status { - margin-right: 4px; + .sf-toolbar-block-request:hover .sf-toolbar-info { + max-width: none; + } + + .sf-toolbar-block .sf-toolbar-info-piece b { + font-size: 12px; + } + .sf-toolbar-block .sf-toolbar-info-piece span { + font-size: 13px; } .sf-toolbar-block-config { diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig index 1814a004c9..1eadef3e96 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig @@ -46,7 +46,10 @@ toolbarInfo.style.right = ''; toolbarInfo.style.left = ''; - if (leftValue > 0 && rightValue > 0) { + if (elementWidth > pageWidth) { + toolbarInfo.style.left = 0; + } + else if (leftValue > 0 && rightValue > 0) { toolbarInfo.style.right = (rightValue * -1) + 'px'; } else if (leftValue < 0) { toolbarInfo.style.left = 0; From 002dda5bd392bea90f6a0493e4c412f9811e9ba2 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 20 Jul 2015 11:59:57 +0200 Subject: [PATCH 39/63] Fixed toolbar issues when displaying it inside the profiler --- .../WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 909198b948..77eb3e858b 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -357,6 +357,7 @@ bottom: auto; box-shadow: 0 1px 0px rgba(0, 0, 0, 0.2); top: 0; + overflow: hidden; /* needed to aovid issues for toolbars with lots of elements */ } .sf-toolbar-block .sf-toolbar-info { From a0e03f6b2c8ef98f59ec2ee81f1ce64f07275c85 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 20 Jul 2015 12:14:53 +0200 Subject: [PATCH 40/63] Minor tweaks --- .../Resources/views/Profiler/toolbar.css.twig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 77eb3e858b..ae6ad02844 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -370,6 +370,10 @@ .sf-toolbarreset { position: static; } + + .sf-toolbar-block:hover .sf-toolbar-icon { + background-color: inherit; + } {% endif %} /* Responsive Design */ @@ -399,6 +403,10 @@ .sf-toolbar-block-memory .sf-toolbar-icon svg { display: none; } + .sf-toolbar-block-time .sf-toolbar-icon svg + span, + .sf-toolbar-block-memory .sf-toolbar-icon svg + span { + margin-left: 0; + } .sf-toolbar-block .sf-toolbar-icon { padding: 0 10px; From 18472853226756ed1abe3feb1c2de7d6924a4883 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 20 Jul 2015 15:23:16 +0200 Subject: [PATCH 41/63] Pass the toolbar version number from the controller, to ease transition and keep BC --- .../Controller/ProfilerController.php | 19 +++++++++++++------ .../views/Profiler/toolbar.html.twig | 3 ++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php index cada4ee6ca..558966f415 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php @@ -11,13 +11,14 @@ namespace Symfony\Bundle\WebProfilerBundle\Controller; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\RedirectResponse; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Symfony\Component\HttpKernel\Profiler\Profiler; -use Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag; -use Symfony\Component\HttpFoundation\Request; use Symfony\Bundle\WebProfilerBundle\Profiler\TemplateManager; +use Symfony\Component\HttpFoundation\RedirectResponse; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag; +use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\HttpKernel\Kernel; +use Symfony\Component\HttpKernel\Profiler\Profiler; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; /** @@ -27,6 +28,9 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; */ class ProfilerController { + const TOOLBAR_VERSION_1 = 1; + const TOOLBAR_VERSION_2 = 2; + private $templateManager; private $generator; private $profiler; @@ -201,12 +205,15 @@ class ProfilerController // the profiler is not enabled } + $toolbarVersion = Kernel::VERSION_ID < 20800 ? self::TOOLBAR_VERSION_1 : self::TOOLBAR_VERSION_2; + return new Response($this->twig->render('@WebProfiler/Profiler/toolbar.html.twig', array( 'position' => $position, 'profile' => $profile, 'templates' => $this->getTemplateManager()->getTemplates($profile), 'profiler_url' => $url, 'token' => $token, + 'toolbar_version' => $toolbarVersion, )), 200, array('Content-Type' => 'text/html')); } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig index 58c125268e..cc47a2ef7d 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig @@ -30,7 +30,8 @@ 'collector': profile.getcollector(name), 'profiler_url': profiler_url, 'token': profile.token, - 'name': name + 'name': name, + 'toolbar_version': toolbar_version }) }} {% endfor %} From ebb44e483225ef5920816be76b212d90cae793d1 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 20 Jul 2015 16:27:08 +0200 Subject: [PATCH 42/63] Added some styles to make old panels look better in the new design --- .../Resources/views/Profiler/toolbar.css.twig | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index ae6ad02844..6473543870 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -385,6 +385,18 @@ display: inline-block; } +/* Legacy Design - these styles are maintained to make old panels look + a bit better on the new toolbar */ +.sf-toolbar-block .sf-toolbar-info-piece-additional-detail { + color: #AAA; + font-size: 12px; +} +.sf-toolbar-status-green .sf-toolbar-info-piece-additional-detail, +.sf-toolbar-status-yellow .sf-toolbar-info-piece-additional-detail, +.sf-toolbar-status-red .sf-toolbar-info-piece-additional-detail { + color: #FFF; +} + @media (min-width: 768px) { .sf-toolbar-icon .sf-toolbar-label, From 972a92e778e08505c77bb7b6f5187828fcf935d4 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 22 Jul 2015 17:55:10 +0200 Subject: [PATCH 43/63] Misc. tweaks and improvements --- .../Bundle/WebProfilerBundle/Profiler/TemplateManager.php | 2 +- .../Resources/views/Collector/request.html.twig | 4 ++-- .../Resources/views/Collector/time.html.twig | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php b/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php index 3cb004c460..d074db31bd 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php @@ -145,7 +145,7 @@ class TemplateManager * * @return array */ - protected function reorderTemplates($templates) + private function reorderTemplates($templates) { $templates = $this->moveArrayElementToFirstPosition($templates, 'twig'); $templates = $this->moveArrayElementToFirstPosition($templates, 'memory'); diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig index b7d693b6e7..ad799c6b23 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig @@ -37,12 +37,12 @@ {{ collector.statuscode }} {{ collector.statustext }}
    - Controller method + Controller {{ request_handler }}
    {% if collector.controller.class is defined %}
    - Controller file + Controller class {{ collector.controller.class }}
    {% endif %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig index 8b5330df6b..7d341a09d3 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig @@ -18,7 +18,7 @@ {% block toolbar %} {% set total_time = collector.events|length ? '%.0f'|format(collector.duration) : 'n/a' %} {% set initialization_time = collector.events|length ? '%.0f'|format(collector.inittime) : 'n/a' %} - {% set status_color = collector.events|length ? collector.duration > 1000 ? 'yellow' : '' %} + {% set status_color = collector.events|length and collector.duration > 1000 ? 'yellow' : '' %} {% set icon %} {{ include('@WebProfiler/Icon/time.svg.twig') }} From 084cca644df7a3675fe9eb07c86b64aac6c49167 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 22 Jul 2015 18:16:40 +0200 Subject: [PATCH 44/63] Minor JavaScript optimizations --- .../Resources/views/Profiler/base_js.html.twig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig index d0f51c42d2..6c8826dabe 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig @@ -169,8 +169,8 @@ infoSpan.textContent = text; } } else { - var ajaxToolbarPanel = document.querySelectorAll('.sf-toolbar-block-ajax'); - ajaxToolbarPanel[0].style.display = 'none'; + var ajaxToolbarPanel = document.querySelector('.sf-toolbar-block-ajax'); + ajaxToolbarPanel.style.display = 'none'; } } @@ -179,11 +179,11 @@ var className = 'sf-toolbar-ajax-requests sf-toolbar-value'; requestCounter[0].className = className; - var ajaxToolbarPanel = document.querySelectorAll('.sf-toolbar-block-ajax'); + var ajaxToolbarPanel = document.querySelector('.sf-toolbar-block-ajax'); if (state == 'error') { - Sfjs.addClass(ajaxToolbarPanel[0], 'sf-toolbar-status-red'); + Sfjs.addClass(ajaxToolbarPanel, 'sf-toolbar-status-red'); } else { - Sfjs.addClass(ajaxToolbarPanel[0], 'sf-ajax-request-loading'); + Sfjs.addClass(ajaxToolbarPanel, 'sf-ajax-request-loading'); } }; From 7ec1cd491da1bd696499c79d044d96f0fa58870e Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 27 Jul 2015 09:36:22 +0200 Subject: [PATCH 45/63] Reverted the feature to display different toolbar versions --- .../WebProfilerBundle/Controller/ProfilerController.php | 6 ------ .../Resources/views/Profiler/toolbar.html.twig | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php index 558966f415..1af8644850 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php @@ -28,9 +28,6 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; */ class ProfilerController { - const TOOLBAR_VERSION_1 = 1; - const TOOLBAR_VERSION_2 = 2; - private $templateManager; private $generator; private $profiler; @@ -205,15 +202,12 @@ class ProfilerController // the profiler is not enabled } - $toolbarVersion = Kernel::VERSION_ID < 20800 ? self::TOOLBAR_VERSION_1 : self::TOOLBAR_VERSION_2; - return new Response($this->twig->render('@WebProfiler/Profiler/toolbar.html.twig', array( 'position' => $position, 'profile' => $profile, 'templates' => $this->getTemplateManager()->getTemplates($profile), 'profiler_url' => $url, 'token' => $token, - 'toolbar_version' => $toolbarVersion, )), 200, array('Content-Type' => 'text/html')); } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig index cc47a2ef7d..58c125268e 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig @@ -30,8 +30,7 @@ 'collector': profile.getcollector(name), 'profiler_url': profiler_url, 'token': profile.token, - 'name': name, - 'toolbar_version': toolbar_version + 'name': name }) }} {% endfor %} From 2fb33191fe71430ac42528deeb5d5855ae7e4ac8 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 30 Jul 2015 09:30:53 +0200 Subject: [PATCH 46/63] Removed an unused import --- .../Bundle/WebProfilerBundle/Controller/ProfilerController.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php index 1af8644850..19d8322eb0 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php @@ -17,7 +17,6 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\HttpKernel\Profiler\Profiler; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; From 6b02601e7b3368b9725bd3b37829ac877d124821 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 30 Jul 2015 09:37:09 +0200 Subject: [PATCH 47/63] Fix merge --- .../HttpKernel/Tests/EventListener/RouterListenerTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php index fd66a602a6..271aaf5b2b 100644 --- a/src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php @@ -139,15 +139,15 @@ class RouterListenerTest extends \PHPUnit_Framework_TestCase $kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface'); $request = Request::create('http://localhost/'); - $listener = new RouterListener($requestMatcher, new RequestContext(), $logger, $this->requestStack); + $listener = new RouterListener($requestMatcher, new RequestContext(), $logger); $listener->onKernelRequest(new GetResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST)); } public function getLoggingParameterData() { return array( - array(array('_route' => 'foo'), 'Matched route "foo".'), - array(array(), 'Matched route "n/a".'), + array(array('_route' => 'foo'), 'Matched route "foo" (parameters: "_route": "foo")'), + array(array(), 'Matched route "n/a" (parameters: )'), ); } } From 5070861326346efe932673d837e4d14e60df1af1 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 30 Jul 2015 13:21:10 +0200 Subject: [PATCH 48/63] Added a new profiler_markup_version to improve BC of the new toolbar --- .../Bundle/WebProfilerBundle/Controller/ProfilerController.php | 1 + .../Resources/views/Profiler/toolbar.html.twig | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php index 19d8322eb0..261d0afcb9 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php @@ -207,6 +207,7 @@ class ProfilerController 'templates' => $this->getTemplateManager()->getTemplates($profile), 'profiler_url' => $url, 'token' => $token, + 'profiler_markup_version' => 2, // 1 = original toolbar, 2 = Symfony 2.8+ toolbar )), 200, array('Content-Type' => 'text/html')); } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig index 58c125268e..e141a0df11 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig @@ -30,7 +30,8 @@ 'collector': profile.getcollector(name), 'profiler_url': profiler_url, 'token': profile.token, - 'name': name + 'name': name, + 'profiler_markup_version': profiler_markup_version }) }} {% endfor %} From 22f6bc5003e4536c8114731c576cb54ebd8250b2 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 30 Jul 2015 15:15:53 +0200 Subject: [PATCH 49/63] Removed an useless CSS class and added styles for
    --- .../Resources/views/Profiler/toolbar.css.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 6473543870..1cd7fd541b 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -95,9 +95,9 @@ display: table; z-index: 99999; } -.sf-toolbar-block .sf-toolbar-info-piece-group { +.sf-toolbar-block hr { border-top: 1px solid #777; - margin-top: 4px; + margin: 4px 0; padding-top: 4px; } .sf-toolbar-block .sf-toolbar-info-piece { From 801e5e28051a1e7ed20af3574c0a8926425ab417 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Thu, 30 Jul 2015 16:26:35 +0200 Subject: [PATCH 50/63] Fix the return value on error for intl methods returning arrays When the resource is missing, an empty array should be returned rather than null to respect the interface saying an array is always returned. --- .../Component/Intl/ResourceBundle/CurrencyBundle.php | 4 ++-- .../Component/Intl/ResourceBundle/LanguageBundle.php | 6 +++--- src/Symfony/Component/Intl/ResourceBundle/LocaleBundle.php | 4 ++-- src/Symfony/Component/Intl/ResourceBundle/RegionBundle.php | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Symfony/Component/Intl/ResourceBundle/CurrencyBundle.php b/src/Symfony/Component/Intl/ResourceBundle/CurrencyBundle.php index 38254fa036..5a4b35519f 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/CurrencyBundle.php +++ b/src/Symfony/Component/Intl/ResourceBundle/CurrencyBundle.php @@ -76,7 +76,7 @@ class CurrencyBundle extends CurrencyDataProvider implements CurrencyBundleInter try { return $this->getNames($displayLocale); } catch (MissingResourceException $e) { - return; + return array(); } } @@ -112,7 +112,7 @@ class CurrencyBundle extends CurrencyDataProvider implements CurrencyBundleInter try { return $this->localeProvider->getLocales(); } catch (MissingResourceException $e) { - return; + return array(); } } } diff --git a/src/Symfony/Component/Intl/ResourceBundle/LanguageBundle.php b/src/Symfony/Component/Intl/ResourceBundle/LanguageBundle.php index bb393d2063..cfe82ca3c3 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/LanguageBundle.php +++ b/src/Symfony/Component/Intl/ResourceBundle/LanguageBundle.php @@ -80,7 +80,7 @@ class LanguageBundle extends LanguageDataProvider implements LanguageBundleInter try { return $this->getNames($displayLocale); } catch (MissingResourceException $e) { - return; + return array(); } } @@ -104,7 +104,7 @@ class LanguageBundle extends LanguageDataProvider implements LanguageBundleInter try { return $this->scriptProvider->getNames($displayLocale); } catch (MissingResourceException $e) { - return; + return array(); } } @@ -116,7 +116,7 @@ class LanguageBundle extends LanguageDataProvider implements LanguageBundleInter try { return $this->localeProvider->getLocales(); } catch (MissingResourceException $e) { - return; + return array(); } } } diff --git a/src/Symfony/Component/Intl/ResourceBundle/LocaleBundle.php b/src/Symfony/Component/Intl/ResourceBundle/LocaleBundle.php index 22c9aecfb3..b14048a40f 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/LocaleBundle.php +++ b/src/Symfony/Component/Intl/ResourceBundle/LocaleBundle.php @@ -31,7 +31,7 @@ class LocaleBundle extends LocaleDataProvider implements LocaleBundleInterface try { return parent::getLocales(); } catch (MissingResourceException $e) { - return; + return array(); } } @@ -55,7 +55,7 @@ class LocaleBundle extends LocaleDataProvider implements LocaleBundleInterface try { return $this->getNames($displayLocale); } catch (MissingResourceException $e) { - return; + return array(); } } } diff --git a/src/Symfony/Component/Intl/ResourceBundle/RegionBundle.php b/src/Symfony/Component/Intl/ResourceBundle/RegionBundle.php index 126d62ac04..29697d6883 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/RegionBundle.php +++ b/src/Symfony/Component/Intl/ResourceBundle/RegionBundle.php @@ -64,7 +64,7 @@ class RegionBundle extends RegionDataProvider implements RegionBundleInterface try { return $this->getNames($displayLocale); } catch (MissingResourceException $e) { - return; + return array(); } } @@ -76,7 +76,7 @@ class RegionBundle extends RegionDataProvider implements RegionBundleInterface try { return $this->localeProvider->getLocales(); } catch (MissingResourceException $e) { - return; + return array(); } } } From 8d025cbc91f9b788a6b03728e6b75864a5f53ff3 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 31 Jul 2015 08:49:15 +0200 Subject: [PATCH 51/63] fixed typo in translation keys --- .../Validator/Resources/translations/validators.ja.xlf | 2 +- .../Validator/Resources/translations/validators.th.xlf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf index 63eecc0e19..a58f5b8d8c 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf @@ -175,7 +175,7 @@ 画像の高さが小さすぎます({{ height }}ピクセル)。{{ min_height }}ピクセル以上にしてください。 - This value should be the user current password. + This value should be the user's current password. ユーザーの現在のパスワードでなければなりません。 diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.th.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.th.xlf index 0237a308ac..d5b57031b9 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.th.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.th.xlf @@ -175,7 +175,7 @@ ความสูงของภาพไม่ได้ขนาด ({{ height }}px) อนุญาตให้สูงอย่างน้อยที่สุด {{ min_height }}px - This value should be the user current password. + This value should be the user's current password. ค่านี้ควรจะเป็นรหัสผ่านปัจจุบันของผู้ใช้ From 9df0f8b4b819c975532694043a3fcf76f929167d Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 31 Jul 2015 12:12:25 +0200 Subject: [PATCH 52/63] Added some upgrade notes about the new toolbar design --- UPGRADE-2.8.md | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/UPGRADE-2.8.md b/UPGRADE-2.8.md index 966f1f4711..04792dee87 100644 --- a/UPGRADE-2.8.md +++ b/UPGRADE-2.8.md @@ -136,3 +136,64 @@ DependencyInjection ``` + +Web Development Toolbar +----------------------- + +The web development toolbar has been completely redesigned. This update has +introduced some changes in the HTML markup of the toolbar items. + +Before: + +Information was wrapped with simple `` elements: + +```twig +{% block toolbar %} + {% set icon %} + + + {{ '%.1f'|format(collector.memory / 1024 / 1024) }} MB + + {% endset %} +{% endblock %} +``` + +After: + +Information is now semantically divided into values and labels according to +the `class` attribute of each `` element: + +```twig +{% block toolbar %} + {% set icon %} + + + {{ '%.1f'|format(collector.memory / 1024 / 1024) }} + + MB + {% endset %} +{% endblock %} +``` + +Most of the blocks designed for the previous toolbar will still be displayed +correctly. However, if you want to support both the old and the new toolbar, +it's better to make use of the new `profiler_markup_version` variable passed +to the toolbar templates: + +```twig +{% block toolbar %} + {% set profiler_markup_version = profiler_markup_version|default(1) %} + + {% set icon %} + {% if profiler_markup_version == 1 %} + + {# code for the original toolbar #} + + {% else %} + + {# code for the new toolbar (Symfony 2.8+) #} + + {% endif %} + {% endset %} +{% endblock %} +``` From 597637eceaff6f1605fc952e2053b2e833c373dc Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 31 Jul 2015 13:11:01 +0200 Subject: [PATCH 53/63] Tweaks and bug fixes --- .../Resources/views/Collector/ajax.html.twig | 2 +- .../Resources/views/Collector/config.html.twig | 7 +++++-- .../Resources/views/Collector/form.html.twig | 2 +- .../Resources/views/Collector/logger.html.twig | 4 ++-- .../Resources/views/Collector/memory.html.twig | 2 +- .../Resources/views/Collector/time.html.twig | 2 +- .../Resources/views/Collector/translation.html.twig | 8 ++++---- .../Resources/views/Collector/twig.html.twig | 2 +- .../Resources/views/Icon/{ajax.svg.twig => ajax.svg} | 0 .../Resources/views/Icon/{close.svg.twig => close.svg} | 0 .../Resources/views/Icon/{form.svg.twig => form.svg} | 0 .../Resources/views/Icon/{logger.svg.twig => logger.svg} | 0 .../Resources/views/Icon/{memory.svg.twig => memory.svg} | 0 .../views/Icon/{symfony.svg.twig => symfony.svg} | 0 .../Resources/views/Icon/{time.svg.twig => time.svg} | 0 .../views/Icon/{translation.svg.twig => translation.svg} | 0 .../Resources/views/Icon/{twig.html.twig => twig.svg} | 0 .../Resources/views/Profiler/base_js.html.twig | 3 +-- .../Resources/views/Profiler/toolbar.css.twig | 9 --------- .../Resources/views/Profiler/toolbar.html.twig | 4 ++-- 20 files changed, 19 insertions(+), 26 deletions(-) rename src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/{ajax.svg.twig => ajax.svg} (100%) rename src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/{close.svg.twig => close.svg} (100%) rename src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/{form.svg.twig => form.svg} (100%) rename src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/{logger.svg.twig => logger.svg} (100%) rename src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/{memory.svg.twig => memory.svg} (100%) rename src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/{symfony.svg.twig => symfony.svg} (100%) rename src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/{time.svg.twig => time.svg} (100%) rename src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/{translation.svg.twig => translation.svg} (100%) rename src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/{twig.html.twig => twig.svg} (100%) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig index fd9ee91c56..fe73b662bd 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig @@ -2,7 +2,7 @@ {% block toolbar %} {% set icon %} - {{ include('@WebProfiler/Icon/ajax.svg.twig') }} + {{ include('@WebProfiler/Icon/ajax.svg') }} 0 {% endset %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig index 4b66f4589a..7379beaae8 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig @@ -21,7 +21,7 @@ {% set icon %} {% if collector.symfonyState is defined %} - {{ include('@WebProfiler/Icon/symfony.svg.twig') }} + {{ include('@WebProfiler/Icon/symfony.svg') }} {{ collector.symfonyversion }} {% elseif collector.applicationname %} @@ -71,7 +71,10 @@
    PHP version - {{ collector.phpversion }} + + {{ collector.phpversion }} +   View phpinfo() +
    diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig index 27515f7522..f226e644af 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig @@ -6,7 +6,7 @@ {% if collector.data.nb_errors > 0 or collector.data.forms|length %} {% set status_color = collector.data.nb_errors ? 'red' : '' %} {% set icon %} - {{ include('@WebProfiler/Icon/form.svg.twig') }} + {{ include('@WebProfiler/Icon/form.svg') }} {% if collector.data.nb_errors %} {{ collector.data.nb_errors }} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig index 6344197eff..5053657e2b 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig @@ -7,7 +7,7 @@ {% set icon %} {% set status_color = collector.counterrors ? 'red' : collector.countdeprecations ? 'yellow' : '' %} {% set error_count = collector.counterrors + collector.countdeprecations + collector.countscreams %} - {{ include('@WebProfiler/Icon/logger.svg.twig') }} + {{ include('@WebProfiler/Icon/logger.svg') }} {{ error_count }} {% endset %} @@ -80,7 +80,7 @@ -{% if collector.logs %} + {% if collector.logs %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig index 5dd2269747..702b4df365 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig @@ -3,7 +3,7 @@ {% block toolbar %} {% set icon %} {% set status_color = (collector.memory / 1024 / 1024) > 50 ? 'yellow' : '' %} - {{ include('@WebProfiler/Icon/memory.svg.twig') }} + {{ include('@WebProfiler/Icon/memory.svg') }} {{ '%.1f'|format(collector.memory / 1024 / 1024) }}MB {% endset %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig index 7d341a09d3..39f8f62abd 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig @@ -21,7 +21,7 @@ {% set status_color = collector.events|length and collector.duration > 1000 ? 'yellow' : '' %} {% set icon %} - {{ include('@WebProfiler/Icon/time.svg.twig') }} + {{ include('@WebProfiler/Icon/time.svg') }} {{ total_time }}ms {% endset %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig index 7eefbde73c..3d75c46768 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig @@ -5,7 +5,7 @@ {% block toolbar %} {% if collector.messages|length %} {% set icon %} - {{ include('@WebProfiler/Icon/translation.svg.twig') }} + {{ include('@WebProfiler/Icon/translation.svg') }} {% set status_color = collector.countMissings ? 'red' : collector.countFallbacks ? 'yellow' : '' %} {% set error_count = collector.countMissings + collector.countFallbacks %} {{ error_count ?: collector.countdefines }} @@ -15,20 +15,20 @@
    Missing messages - {{ collector.countMissings|default(0) }} + {{ collector.countMissings }}
    Fallback messages - {{ collector.countFallbacks|default(0) }} + {{ collector.countFallbacks }}
    Defined messages - {{ collector.countdefines|default(0) }} + {{ collector.countdefines }}
    {% endset %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig index 4f758a1d12..95713b93db 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig @@ -3,7 +3,7 @@ {% block toolbar %} {% set time = collector.templatecount ? '%0.0f'|format(collector.time) : 'n/a' %} {% set icon %} - {{ include('@WebProfiler/Icon/twig.html.twig') }} + {{ include('@WebProfiler/Icon/twig.svg') }} {{ time }}ms {% endset %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg similarity index 100% rename from src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg.twig rename to src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg similarity index 100% rename from src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg.twig rename to src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg similarity index 100% rename from src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg.twig rename to src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg similarity index 100% rename from src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg.twig rename to src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg similarity index 100% rename from src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg.twig rename to src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg similarity index 100% rename from src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg.twig rename to src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg similarity index 100% rename from src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg.twig rename to src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg similarity index 100% rename from src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg.twig rename to src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.svg similarity index 100% rename from src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.html.twig rename to src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.svg diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig index 6c8826dabe..2b1eeff3c0 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig @@ -86,6 +86,7 @@ return; } + var ajaxToolbarPanel = document.querySelector('.sf-toolbar-block-ajax'); var tbodies = document.querySelectorAll('.sf-toolbar-ajax-request-list'); var state = 'ok'; if (tbodies.length) { @@ -169,7 +170,6 @@ infoSpan.textContent = text; } } else { - var ajaxToolbarPanel = document.querySelector('.sf-toolbar-block-ajax'); ajaxToolbarPanel.style.display = 'none'; } } @@ -179,7 +179,6 @@ var className = 'sf-toolbar-ajax-requests sf-toolbar-value'; requestCounter[0].className = className; - var ajaxToolbarPanel = document.querySelector('.sf-toolbar-block-ajax'); if (state == 'error') { Sfjs.addClass(ajaxToolbarPanel, 'sf-toolbar-status-red'); } else { diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 1cd7fd541b..5b2e4f6666 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -85,10 +85,6 @@ color: #AAA; font-size: 12px; } -/* TODO: remove it when Twig uses SVG icons */ -.sf-toolbar-block-twig img { - opacity: .8; -} .sf-toolbar-block .sf-toolbar-info { border-collapse: collapse; @@ -316,11 +312,6 @@ 50% { background: #444; } 100% { background: #222; } } -@-o-keyframes sf-blink { - 0% { background: #222; } - 50% { background: #444; } - 100% { background: #222; } -} @keyframes sf-blink { 0% { background: #222; } 50% { background: #444; } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig index e141a0df11..e4fea4b00b 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig @@ -15,7 +15,7 @@ Sfjs.setPreference('toolbar/displayState', 'block'); "> - {{ include('@WebProfiler/Icon/symfony.svg.twig') }} + {{ include('@WebProfiler/Icon/symfony.svg') }}
    #