Esempio n. 1
0
 /**
  * Initializes the Object framework.
  *
  * @return void
  * @author Robert Lemke <*****@*****.**>
  * @see initialize()
  */
 public function initializeObjectManager()
 {
     $this->objectFactory = new \F3\FLOW3\Object\ObjectFactory();
     $objectBuilder = new \F3\FLOW3\Object\ObjectBuilder();
     $objectBuilder->injectConfigurationManager($this->configurationManager);
     $singletonObjectsRegistry = new \F3\FLOW3\Object\TransientRegistry();
     $preliminaryReflectionService = new \F3\FLOW3\Reflection\ReflectionService();
     $this->objectManager = new \F3\FLOW3\Object\ObjectManager();
     $this->objectManager->injectSingletonObjectsRegistry($singletonObjectsRegistry);
     $this->objectManager->injectObjectBuilder($objectBuilder);
     $this->objectManager->injectObjectFactory($this->objectFactory);
     $this->objectManager->injectReflectionService($preliminaryReflectionService);
     $this->objectManager->injectConfigurationManager($this->configurationManager);
     $this->objectManager->setContext($this->context);
     $this->objectManager->initializeManager();
     // Remove the preliminary reflection service and rebuild it, this time with the proper object configuration:
     $singletonObjectsRegistry->removeObject('F3\\FLOW3\\Reflection\\ReflectionService');
     $this->objectManager->injectReflectionService($this->objectManager->getObject('F3\\FLOW3\\Reflection\\ReflectionService'));
     $singletonObjectsRegistry->putObject('F3\\FLOW3\\Resource\\ClassLoader', $this->classLoader);
     $singletonObjectsRegistry->putObject('F3\\FLOW3\\Configuration\\ConfigurationManager', $this->configurationManager);
     $this->configurationManager->injectEnvironment($this->objectManager->getObject('F3\\FLOW3\\Utility\\Environment'));
 }