merged branch lmcd/php-sapi (PR #6636)

This PR was merged into the master branch.

Commits
-------

16b3426 Show PHP SAPI in WDT

Discussion
----------

[WDT] Show PHP SAPI in WDT

PHP running under Apache as a module:
![sapi-apache](https://f.cloud.github.com/assets/363540/53093/7709dc8a-5a48-11e2-8c09-031e0645e3ea.png)

PHP running with the in-built CLI web server (via `server:run`)
![sapi-cli](https://f.cloud.github.com/assets/363540/53094/96df9a0e-5a48-11e2-96e9-7bc2f452083d.png)
This commit is contained in:
Fabien Potencier 2013-01-11 08:00:38 +01:00
commit b868bf6249
2 changed files with 15 additions and 0 deletions

View File

@ -35,6 +35,10 @@
<span class="sf-toolbar-status sf-toolbar-status-{{ collector.hasxdebug ? 'green' : 'red' }}">xdebug</span>
<span class="sf-toolbar-status sf-toolbar-status-{{ collector.hasaccelerator ? 'green' : 'red' }}">accel</span>
</div>
<div class="sf-toolbar-info-piece">
<b>PHP SAPI</b>
<span>{{ collector.sapiName }}</span>
</div>
{% endspaceless %}
{% endset %}
{% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': false } %}

View File

@ -54,6 +54,7 @@ class ConfigDataCollector extends DataCollector
'xcache_enabled' => extension_loaded('xcache') && ini_get('xcache.cacher'),
'wincache_enabled' => extension_loaded('wincache') && ini_get('wincache.ocenabled'),
'bundles' => array(),
'sapi_name' => php_sapi_name()
);
if (isset($this->kernel)) {
@ -188,6 +189,16 @@ class ConfigDataCollector extends DataCollector
return $this->data['bundles'];
}
/**
* Gets the PHP SAPI name.
*
* @return string The environment
*/
public function getSapiName()
{
return $this->data['sapi_name'];
}
/**
* {@inheritdoc}
*/