You are here

public function PhpConfigDataCollector::collect in Devel 8.2

Same name and namespace in other branches
  1. 8.3 webprofiler/src/DataCollector/PhpConfigDataCollector.php \Drupal\webprofiler\DataCollector\PhpConfigDataCollector::collect()
  2. 8 webprofiler/src/DataCollector/PhpConfigDataCollector.php \Drupal\webprofiler\DataCollector\PhpConfigDataCollector::collect()
  3. 4.x webprofiler/src/DataCollector/PhpConfigDataCollector.php \Drupal\webprofiler\DataCollector\PhpConfigDataCollector::collect()

File

webprofiler/src/DataCollector/PhpConfigDataCollector.php, line 22

Class

PhpConfigDataCollector
Provides a data collector to collect all kind of php information.

Namespace

Drupal\webprofiler\DataCollector

Code

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(),
  ];
}