private function disableDebugClassLoader() { if (!class_exists('Symfony\\Component\\Debug\\DebugClassLoader')) { return; } DebugClassLoader::disable(); }
/** * {@inheritdoc} */ public function boot() { // it is a quick way to check if loader was enabled $wasDebugEnabled = class_exists('\\Symfony\\Component\\Debug\\DebugClassLoader', false); if ($wasDebugEnabled) { // disable temporary to apply AOP loader first DebugClassLoader::disable(); } $this->container->get('goaop.aspect.container'); if (!AopComposerLoader::wasInitialized()) { throw new \RuntimeException("Initialization of AOP loader was failed, probably due to Debug::enable()"); } if ($wasDebugEnabled) { DebugClassLoader::enable(); } }
public function testIdempotence() { DebugClassLoader::enable(); DebugClassLoader::enable(); $functions = spl_autoload_functions(); foreach ($functions as $function) { if (is_array($function) && $function[0] instanceof DebugClassLoader) { $reflClass = new \ReflectionClass($function[0]); $reflProp = $reflClass->getProperty('classFinder'); $reflProp->setAccessible(true); $this->assertNotInstanceOf('Symfony\\Component\\Debug\\DebugClassLoader', $reflProp->getValue($function[0])); DebugClassLoader::disable(); return; } } DebugClassLoader::disable(); $this->fail('DebugClassLoader did not register'); }
protected function tearDown() { DebugClassLoader::disable(); spl_autoload_unregister(array($this->loader, 'loadClass')); error_reporting($this->errorReporting); }