Jelajahi Sumber

[WebProfilerBundle] Config panel

Split the main Key / Value table in different sections.
Add a list of active bundles.
Victor Berchet 14 tahun lalu
induk
melakukan
36d51d7bbd

+ 3 - 3
src/Symfony/Bundle/WebProfilerBundle/Resources/public/css/profiler.css

@@ -80,7 +80,7 @@ tr
 table
 {
     width:100%;
-    margin:10px 0 60px;
+    margin:10px 0 30px;
 }
 
 table th
@@ -137,7 +137,7 @@ fieldset
 
 #header
 {
-    padding:30px 30px 20px 30px;
+    padding:30px 30px 20px;
 }
 
 #header h1
@@ -347,7 +347,7 @@ ul.alt li.error {
     margin-bottom: 1px;
 }
 
-td#main, td.menu {
+td.main, td.menu {
     text-align: left;
     margin: 0;
     padding: 0;

+ 25 - 2
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig

@@ -43,7 +43,7 @@
 {% endblock %}
 
 {% block panel %}
-    <h2>Configuration</h2>
+    <h2>Project Configuration</h2>
     <table>
         <tr>
             <th>Key</th>
@@ -54,7 +54,7 @@
             <td>{{ collector.symfonyversion }}</td>
         </tr>
         <tr>
-            <th>Application</th>
+            <th>Application name</th>
             <td>{{ collector.appname }}</td>
         </tr>
         <tr>
@@ -65,6 +65,14 @@
             <th>Debug</th>
             <td>{{ collector.debug ? 'enabled' : 'disabled' }}</td>
         </tr>
+    </table>
+
+    <h2>PHP configuration</h2>
+    <table>
+        <tr>
+            <th>Key</th>
+            <th>Value</th>
+        </tr>
         <tr>
             <th>PHP version</th>
             <td>{{ collector.phpversion }}</td>
@@ -90,4 +98,19 @@
             <td>{{ collector.haseaccelerator ? 'enabled' : 'disabled' }}</td>
         </tr>
     </table>
+
+    <h2>Active bundles</h2>
+    <table>
+        <tr>
+            <th>Name</th>
+            <th>Path</th>
+        </tr>
+        {% for name, path in collector.bundles %}
+        <tr>
+            <th>{{ name }}</th>
+            <td>{{ path }}</td>
+        </tr>
+        {% endfor %}
+    </table>
+
 {% endblock %}

+ 11 - 0
src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php

@@ -52,7 +52,13 @@ class ConfigDataCollector extends DataCollector
             'eaccel_enabled'  => extension_loaded('eaccelerator') && ini_get('eaccelerator.enable'),
             'apc_enabled'     => extension_loaded('apc') && ini_get('apc.enabled'),
             'xcache_enabled'  => extension_loaded('xcache') && ini_get('xcache.cacher'),
+            'bundles'         => array(),
         );
+
+        foreach ($this->kernel->getBundles() as $name => $bundle) {
+            $this->data['bundles'][$name] = $bundle->getPath();
+        }
+
     }
 
     /**
@@ -165,6 +171,11 @@ class ConfigDataCollector extends DataCollector
         return $this->hasApc() || $this->hasEAccelerator() || $this->hasXCache();
     }
 
+    public function getBundles()
+    {
+        return $this->data['bundles'];
+    }
+
     /**
      * {@inheritdoc}
      */