hasXDebug() public method

Returns true if the XDebug is enabled.
public hasXDebug ( ) : boolean
return boolean true if XDebug is enabled, false otherwise
Exemplo n.º 1
0
 public function testCollect()
 {
     $kernel = new KernelForTest('test', true);
     $c = new ConfigDataCollector();
     $c->setCacheVersionInfo(false);
     $c->setKernel($kernel);
     $c->collect(new Request(), new Response());
     $this->assertSame('test', $c->getEnv());
     $this->assertTrue($c->isDebug());
     $this->assertSame('config', $c->getName());
     $this->assertSame('testkernel', $c->getAppName());
     $this->assertSame(PHP_VERSION, $c->getPhpVersion());
     $this->assertSame(Kernel::VERSION, $c->getSymfonyVersion());
     $this->assertNull($c->getToken());
     // if else clause because we don't know it
     if (extension_loaded('xdebug')) {
         $this->assertTrue($c->hasXDebug());
     } else {
         $this->assertFalse($c->hasXDebug());
     }
     // if else clause because we don't know it
     if (extension_loaded('eaccelerator') && ini_get('eaccelerator.enable') || extension_loaded('apc') && ini_get('apc.enabled') || extension_loaded('Zend OPcache') && ini_get('opcache.enable') || extension_loaded('xcache') && ini_get('xcache.cacher') || extension_loaded('wincache') && ini_get('wincache.ocenabled')) {
         $this->assertTrue($c->hasAccelerator());
     } else {
         $this->assertFalse($c->hasAccelerator());
     }
 }
 private function getConfigData(ConfigDataCollector $collector)
 {
     $data = array('symfony_version' => $collector->getSymfonyVersion(), 'os' => PHP_OS, 'php_version' => $collector->getPhpVersion(), 'php_extensions' => get_loaded_extensions(), 'debug' => $collector->isDebug(), 'xdebug' => $collector->hasXDebug(), 'eaccelerator' => $collector->hasEAccelerator(), 'apc' => $collector->hasApc(), 'xcache' => $collector->hasXCache(), 'bundles' => array());
     foreach (array_keys($collector->getBundles()) as $bundleName) {
         $class = get_class($this->kernel->getBundle($bundleName));
         if ($this->isNamespaceWhitelisted($class)) {
             $data['bundles'][$bundleName] = $class;
             continue;
         }
         $data['bundles'][] = 'XXX';
     }
     return $data;
 }