예제 #1
0
 private function disableDebugClassLoader()
 {
     if (!class_exists('Symfony\\Component\\Debug\\DebugClassLoader')) {
         return;
     }
     DebugClassLoader::disable();
 }
예제 #2
0
 /**
  * {@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();
     }
 }
예제 #3
0
 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');
 }
예제 #4
0
 protected function tearDown()
 {
     DebugClassLoader::disable();
     spl_autoload_unregister(array($this->loader, 'loadClass'));
     error_reporting($this->errorReporting);
 }