class PhpConfigDataCollector in Devel 8
Same name and namespace in other branches
- 8.3 webprofiler/src/DataCollector/PhpConfigDataCollector.php \Drupal\webprofiler\DataCollector\PhpConfigDataCollector
- 8.2 webprofiler/src/DataCollector/PhpConfigDataCollector.php \Drupal\webprofiler\DataCollector\PhpConfigDataCollector
- 4.x webprofiler/src/DataCollector/PhpConfigDataCollector.php \Drupal\webprofiler\DataCollector\PhpConfigDataCollector
Provides a data collector to collect all kind of php information.
Hierarchy
- class \Drupal\webprofiler\DataCollector\PhpConfigDataCollector extends \Symfony\Component\HttpKernel\DataCollector\DataCollector implements DrupalDataCollectorInterface uses StringTranslationTrait
Expanded class hierarchy of PhpConfigDataCollector
1 string reference to 'PhpConfigDataCollector'
- webprofiler.services.yml in webprofiler/
webprofiler.services.yml - webprofiler/webprofiler.services.yml
1 service uses PhpConfigDataCollector
File
- webprofiler/
src/ DataCollector/ PhpConfigDataCollector.php, line 15
Namespace
Drupal\webprofiler\DataCollectorView source
class PhpConfigDataCollector extends DataCollector implements DrupalDataCollectorInterface {
use StringTranslationTrait, DrupalDataCollectorTrait, LinkGeneratorTrait;
/**
* {@inheritdoc}
*/
public function collect(Request $request, Response $response, \Exception $exception = NULL) {
$this->data = [
'token' => $response->headers
->get('X-Debug-Token'),
'php_version' => PHP_VERSION,
'xdebug_enabled' => extension_loaded('xdebug'),
'xhprof_enabled' => extension_loaded('xhprof'),
'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'),
'wincache_enabled' => extension_loaded('wincache') && ini_get('wincache.ocenabled'),
'zend_opcache_enabled' => extension_loaded('Zend OPcache') && ini_get('opcache.enable'),
'sapi_name' => php_sapi_name(),
];
}
/**
* Gets the token.
*
* @return string The token
*/
public function getToken() {
return $this->data['token'];
}
/**
* Gets the PHP version.
*
* @return string The PHP version
*/
public function getPhpVersion() {
return $this->data['php_version'];
}
/**
* Returns true if the XDebug is enabled.
*
* @return Boolean true if XDebug is enabled, false otherwise
*/
public function hasXDebug() {
return $this->data['xdebug_enabled'];
}
/**
* Returns true if the XHProf is enabled.
*
* @return Boolean true if XHProf is enabled, false otherwise
*/
public function hasXHProf() {
return $this->data['xhprof_enabled'];
}
/**
* Returns true if EAccelerator is enabled.
*
* @return Boolean true if EAccelerator is enabled, false otherwise
*/
public function hasEAccelerator() {
return $this->data['eaccel_enabled'];
}
/**
* Returns true if APC is enabled.
*
* @return Boolean true if APC is enabled, false otherwise
*/
public function hasApc() {
return $this->data['apc_enabled'];
}
/**
* Returns true if Zend OPcache is enabled
*
* @return Boolean true if Zend OPcache is enabled, false otherwise
*/
public function hasZendOpcache() {
return $this->data['zend_opcache_enabled'];
}
/**
* Returns true if XCache is enabled.
*
* @return Boolean true if XCache is enabled, false otherwise
*/
public function hasXCache() {
return $this->data['xcache_enabled'];
}
/**
* Returns true if WinCache is enabled.
*
* @return Boolean true if WinCache is enabled, false otherwise
*/
public function hasWinCache() {
return $this->data['wincache_enabled'];
}
/**
* Returns true if any accelerator is enabled.
*
* @return Boolean true if any accelerator is enabled, false otherwise
*/
public function hasAccelerator() {
return $this
->hasApc() || $this
->hasZendOpcache() || $this
->hasEAccelerator() || $this
->hasXCache() || $this
->hasWinCache();
}
/**
* Gets the PHP SAPI name.
*
* @return string The environment
*/
public function getSapiName() {
return $this->data['sapi_name'];
}
/**
* {@inheritdoc}
*/
public function getTitle() {
return $this
->t('PHP Config');
}
/**
* {@inheritdoc}
*/
public function getPanelSummary() {
return $this
->t('PHP: @version', [
'@version' => $this
->getPhpVersion(),
]);
}
/**
* {@inheritdoc}
*/
public function getName() {
return 'php_config';
}
/**
* {@inheritdoc}
*/
public function getIcon() {
return 'iVBORw0KGgoAAAANSUhEUgAAABUAAAAcCAMAAAC5xgRsAAAAZlBMVEX///////////////////////////////////////////////////////////////////////////////////////////+ZmZmZmZlISEhJSUmdnZ1HR0fR0dFZWVlpaWlfX18/Pz+puygPAAAAIXRSTlMACwwlJygpLzIzNjs8QEtMUmd6e32AucDBw8fIydTm6u5l8MjvAAAAo0lEQVR42r2P2Q6CMBBFL6XsZRGRfZv//0nbDBNEE19MnJeTc5ILKf58ahiUwzy/AJpIWwREwQnEXRdbGCLjrO+djWRvVMiJcigxB7viGogxDdJpSmHEmCVPS7YczJvgUu+CS30IvtbNYZMvsGVo2mVpG/kbm4auiCpdcC3YPCAhSpAdUzaAn6qPKZtUT6ZSzb4bi2hdo9MQ1nX4ASjfV+/4/Z40pyCHrNTbIgAAAABJRU5ErkJggg==';
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DrupalDataCollectorInterface:: |
public | function | 8 | |
DrupalDataCollectorInterface:: |
public | function | 1 | |
DrupalDataCollectorInterface:: |
public | function | Returns the libraries needed in detail panel. | 2 |
DrupalDataCollectorInterface:: |
public | function | Returns true if this datacollector has a detail panel. | 2 |
PhpConfigDataCollector:: |
public | function | Collects data for the given Request and Response. | |
PhpConfigDataCollector:: |
public | function |
Returns the collector icon in base64 format. Overrides DrupalDataCollectorInterface:: |
|
PhpConfigDataCollector:: |
public | function |
Returns the name of the collector. Overrides DrupalDataCollectorInterface:: |
|
PhpConfigDataCollector:: |
public | function |
Returns the string used in vertical tab summary. Overrides DrupalDataCollectorInterface:: |
|
PhpConfigDataCollector:: |
public | function | Gets the PHP version. | |
PhpConfigDataCollector:: |
public | function | Gets the PHP SAPI name. | |
PhpConfigDataCollector:: |
public | function |
Returns the datacollector title. Overrides DrupalDataCollectorInterface:: |
|
PhpConfigDataCollector:: |
public | function | Gets the token. | |
PhpConfigDataCollector:: |
public | function | Returns true if any accelerator is enabled. | |
PhpConfigDataCollector:: |
public | function | Returns true if APC is enabled. | |
PhpConfigDataCollector:: |
public | function | Returns true if EAccelerator is enabled. | |
PhpConfigDataCollector:: |
public | function | Returns true if WinCache is enabled. | |
PhpConfigDataCollector:: |
public | function | Returns true if XCache is enabled. | |
PhpConfigDataCollector:: |
public | function | Returns true if the XDebug is enabled. | |
PhpConfigDataCollector:: |
public | function | Returns true if the XHProf is enabled. | |
PhpConfigDataCollector:: |
public | function | Returns true if Zend OPcache is enabled | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |