* * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ /** * ConfigDataCollector. * * @package Symfony * @subpackage Framework_FoundationBundle * @author Fabien Potencier */ class ConfigDataCollector extends DataCollector { protected $container; public function __construct(ContainerInterface $container) { $this->container = $container; } public function collect() { $kernel = $this->container->getKernelService(); $this->data = array( 'token' => $this->profiler->getProfilerStorage()->getToken(), 'symfony_version' => Kernel::VERSION, 'name' => $kernel->getName(), 'env' => $kernel->getEnvironment(), 'debug' => $kernel->isDebug(), 'php_version' => PHP_VERSION, 'xdebug' => extension_loaded('xdebug'), 'accel' => ( (extension_loaded('eaccelerator') && ini_get('eaccelerator.enable')) || (extension_loaded('apc') && ini_get('apc.enabled')) || (extension_loaded('xcache') && ini_get('xcache.cacher')) ), ); } public function getSummary() { return sprintf('Symfony %s PHP %s/xdebug/accel %s/%s/%s/%s ', $this->data['symfony_version'], $this->data['php_version'], $this->data['xdebug'] ? '#3a3' : '#a33', $this->data['accel'] ? '#3a3' : '#a33', $this->data['name'], $this->data['env'], $this->data['debug'] ? 'debug' : 'no-debug', $this->data['token'], $this->data['token']); } public function getName() { return 'config'; } }