示例#1
0
文件: Scripts.php 项目: nxpthx/FLOW3
 /**
  * Initializes the runtime Object Manager
  *
  * @param \TYPO3\FLOW3\Core\Bootstrap $bootstrap
  * @return void
  */
 public static function initializeObjectManager(Bootstrap $bootstrap)
 {
     $configurationManager = $bootstrap->getEarlyInstance('TYPO3\\FLOW3\\Configuration\\ConfigurationManager');
     $objectConfigurationCache = $bootstrap->getEarlyInstance('TYPO3\\FLOW3\\Cache\\CacheManager')->getCache('FLOW3_Object_Configuration');
     $objectManager = new \TYPO3\FLOW3\Object\ObjectManager($bootstrap->getContext());
     Bootstrap::$staticObjectManager = $objectManager;
     $objectManager->injectAllSettings($configurationManager->getConfiguration(\TYPO3\FLOW3\Configuration\ConfigurationManager::CONFIGURATION_TYPE_SETTINGS));
     $objectManager->setObjects($objectConfigurationCache->get('objects'));
     foreach ($bootstrap->getEarlyInstances() as $objectName => $instance) {
         $objectManager->setInstance($objectName, $instance);
     }
     $objectManager->get('TYPO3\\FLOW3\\SignalSlot\\Dispatcher')->injectObjectManager($objectManager);
     \TYPO3\FLOW3\Error\Debugger::injectObjectManager($objectManager);
     $bootstrap->setEarlyInstance('TYPO3\\FLOW3\\Object\\ObjectManagerInterface', $objectManager);
 }