Ejemplo n.º 1
0
 /**
  *
  */
 public function __construct()
 {
     $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
     $this->configurationManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager');
     $this->configuration = $this->objectManager->get('Aijko\\SharepointConnector\\Configuration\\ConfigurationManager')->getConfiguration();
     $this->configurationManager->setConfiguration($this->configuration);
     $this->viewUtility = $this->objectManager->get('Aijko\\SharepointConnector\\Utility\\View');
 }
Ejemplo n.º 2
0
 /**
  * Initializes the Object framework.
  *
  * @param array $configuration
  * @return void
  * @see initialize()
  */
 public function initializeConfiguration($configuration)
 {
     $this->configurationManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
     /** @var \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $contentObject */
     $contentObject = isset($this->cObj) ? $this->cObj : \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
     $this->configurationManager->setContentObject($contentObject);
     $this->configurationManager->setConfiguration($configuration);
 }
Ejemplo n.º 3
0
 /**
  * This is the main method that is called when a task is executed
  * Note that there is no error handling, errors and failures are expected
  * to be handled and logged by the client implementations.
  * Should return TRUE on successful execution, FALSE on error.
  *
  * @return boolean Returns TRUE on successful execution, FALSE on error
  */
 public function execute()
 {
     $this->extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['t3chimp']);
     /** @var ObjectManager $objectManager */
     $this->objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
     $this->configurationManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager');
     $this->mailChimp = $this->objectManager->get('MatoIlic\\T3Chimp\\Service\\MailChimp');
     $this->userRepo = $this->objectManager->get('MatoIlic\\T3Chimp\\Domain\\Repository\\FrontendUserRepository');
     $this->configurationManager->setConfiguration(array('extensionName' => 'T3chimp'));
     $typoScriptSetup = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
     if (isset($typoScriptSetup['config.']['tx_extbase.']['objects.'])) {
         $objectContainer = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\Container\\Container');
         foreach ($typoScriptSetup['config.']['tx_extbase.']['objects.'] as $classNameWithDot => $classConfiguration) {
             if (isset($classConfiguration['className'])) {
                 $originalClassName = rtrim($classNameWithDot, '.');
                 $objectContainer->registerImplementation($originalClassName, $classConfiguration['className']);
             }
         }
     }
     /** @var ReflectionService $reflectionService */
     $reflectionService = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService');
     if (TYPO3_version < '7.1.0') {
         $reflectionService->setDataCache($GLOBALS['typo3CacheManager']->getCache('extbase_reflection'));
     } else {
         $cacheManager = $this->objectManager->get('TYPO3\\CMS\\Core\\Cache\\CacheManager');
         $reflectionService->setDataCache($cacheManager->getCache('extbase_reflection'));
     }
     if (!$reflectionService->isInitialized()) {
         $reflectionService->initialize();
     }
     $this->mailChimp->initialize();
     $state = $this->executeTask();
     /** @var PersistenceManager $persistenceManager */
     $persistenceManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager');
     $persistenceManager->persistAll();
     $reflectionService->shutdown();
     return $state;
 }
 /**
  * @param ConfigurationManagerInterface $configurationManager
  */
 public function injectConfigurationManager(ConfigurationManagerInterface $configurationManager)
 {
     $this->configurationManager = $configurationManager;
     $this->configurationManager->setConfiguration(array('extensionName' => 'supermailerreg'));
 }