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 dc4eb861b9daa..d4fc494cc4edf 100644
--- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig
+++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig
@@ -5,15 +5,26 @@
{% set icon %}
- {{ collector.symfonyversion }}
+
+ {% if collector.applicationname %}
+ {{ collector.applicationname }} {{ collector.applicationversion }}
+ {% else %}
+ {{ collector.symfonyversion }}
+ {% endif %}
+
{% endset %}
{% set text %}
+ {% if collector.applicationname %}
+
+ {{ collector.applicationname }} {{ collector.applicationversion }}
+
+ {% endif %}
Symfony {{ collector.symfonyversion }}
{% endset %}
{% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': false } %}
@@ -97,8 +108,13 @@
Value |
- Symfony version |
- {{ collector.symfonyversion }} |
+ {% if collector.applicationname %}
+ Application |
+ {{ collector.applicationname }} {{ collector.applicationversion }} (on Symfony {{ collector.symfonyversion }}) |
+ {% else %}
+ Symfony version |
+ {{ collector.symfonyversion }} |
+ {% endif %}
Application name |
diff --git a/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php
index 3cd17b12cfcb0..9475431816e79 100644
--- a/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php
+++ b/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php
@@ -25,10 +25,24 @@
class ConfigDataCollector extends DataCollector
{
private $kernel;
+ private $name;
+ private $version;
/**
* Constructor.
*
+ * @param string $name The name of the application using the web profiler
+ * @param string $version The version of the application using the web profiler
+ */
+ public function __construct($name = null, $version = null)
+ {
+ $this->name = $name;
+ $this->version = $version;
+ }
+
+ /**
+ * Sets the Kernel associated with this Request.
+ *
* @param KernelInterface $kernel A KernelInterface instance
*/
public function setKernel(KernelInterface $kernel = null)
@@ -42,6 +56,8 @@ public function setKernel(KernelInterface $kernel = null)
public function collect(Request $request, Response $response, \Exception $exception = null)
{
$this->data = array(
+ 'app_name' => $this->name,
+ 'app_version' => $this->version,
'token' => $response->headers->get('X-Debug-Token'),
'symfony_version' => Kernel::VERSION,
'name' => isset($this->kernel) ? $this->kernel->getName() : 'n/a',
@@ -64,6 +80,16 @@ public function collect(Request $request, Response $response, \Exception $except
}
}
+ public function getApplicationName()
+ {
+ return $this->data['app_name'];
+ }
+
+ public function getApplicationVersion()
+ {
+ return $this->data['app_version'];
+ }
+
/**
* Gets the token.
*