예제 #1
0
 /**
  * {inheritdoc}
  */
 public function configureObjectManager(ConfigInterface $diConfig, &$sharedInstances)
 {
     $objectManager = ObjectManager::getInstance();
     $sharedInstances['Magento\\Framework\\ObjectManager\\ConfigLoaderInterface'] = $objectManager->get('Magento\\Framework\\App\\ObjectManager\\ConfigLoader');
     $diConfig->setCache($objectManager->get('Magento\\Framework\\App\\ObjectManager\\ConfigCache'));
     $objectManager->configure($objectManager->get('Magento\\Framework\\App\\ObjectManager\\ConfigLoader')->load(Area::AREA_GLOBAL));
     $objectManager->get('Magento\\Framework\\Config\\ScopeInterface')->setCurrentScope('global');
     $diConfig->setInterceptionConfig($objectManager->get('Magento\\Framework\\Interception\\Config\\Config'));
 }
예제 #2
0
 /**
  * {inheritdoc}
  */
 public function configureObjectManager(ConfigInterface $diConfig, &$sharedInstances)
 {
     $objectManager = ObjectManager::getInstance();
     $objectManager->configure($objectManager->get('Magento\\Framework\\ObjectManager\\ConfigLoaderInterface')->load(Area::AREA_GLOBAL));
     $objectManager->get('Magento\\Framework\\Config\\ScopeInterface')->setCurrentScope('global');
     $diConfig->setInterceptionConfig($objectManager->get('Magento\\Framework\\Interception\\Config\\Config'));
     $sharedInstances['Magento\\Framework\\Interception\\PluginList\\PluginList'] = $objectManager->create('Magento\\Framework\\Interception\\PluginListInterface', ['cache' => $objectManager->get('Magento\\Framework\\App\\Interception\\Cache\\CompiledConfig')]);
     $objectManager->get('Magento\\Framework\\App\\Cache\\Manager')->setEnabled([CompiledConfig::TYPE_IDENTIFIER], true);
 }
예제 #3
0
 /**
  * {inheritdoc}
  */
 public function configureObjectManager(ConfigInterface $diConfig, &$sharedInstances)
 {
     $originalSharedInstances = $sharedInstances;
     $objectManager = ObjectManager::getInstance();
     $sharedInstances['Magento\\Framework\\ObjectManager\\ConfigLoaderInterface'] = $objectManager->get('Magento\\Framework\\App\\ObjectManager\\ConfigLoader');
     $diConfig->setCache($objectManager->get('Magento\\Framework\\App\\ObjectManager\\ConfigCache'));
     $objectManager->configure($objectManager->get('Magento\\Framework\\App\\ObjectManager\\ConfigLoader')->load(Area::AREA_GLOBAL));
     $objectManager->get('Magento\\Framework\\Config\\ScopeInterface')->setCurrentScope('global');
     $diConfig->setInterceptionConfig($objectManager->get('Magento\\Framework\\Interception\\Config\\Config'));
     /** Reset the shared instances once interception config is set so classes can be intercepted if necessary */
     $sharedInstances = $originalSharedInstances;
     $sharedInstances['Magento\\Framework\\ObjectManager\\ConfigLoaderInterface'] = $objectManager->get('Magento\\Framework\\App\\ObjectManager\\ConfigLoader');
 }