/**
  * @return void
  */
 protected function buildAndInitSessionPersistenceManager()
 {
     $this->buildSessionPersistenceManager();
     $this->bookmarkManager = $this->bookmarkManagerFactory->getInstanceByConfigurationBuilder($this->configurationBuilder);
     $this->bookmarkManager->processRequest($this->request);
     $this->lifecycleManager->registerAndUpdateStateOnRegisteredObject($this->sessionPersistenceManager);
     //TODO: if session was restored from bookmark do not reset session
     // We reset session data, if we want to have a reset on empty submit
     if ($this->configurationBuilder->buildBaseConfiguration()->getResetOnEmptySubmit()) {
         $this->sessionPersistenceManager->resetSessionDataOnEmptyGpVars($this->getPostVarsAdapterFactory->getInstance());
     }
     $this->resetOnEmptySubmit();
 }
Пример #2
0
 /**
  * Hook in Configuration set Process
  *
  * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
  */
 public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager)
 {
     parent::injectConfigurationManager($configurationManager);
     $this->overwriteFlexFormWithTyposcriptSettings();
     $contextIdentifier = $this->getContextIdentifier();
     if ($this->settings != null) {
         $this->emSettings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['yag']);
         $resetContext = isset($this->settings['contextReset']) && (int) $this->settings['contextReset'] == 1 ? true : false;
         Tx_Yag_Domain_Configuration_ConfigurationBuilderFactory::injectSettings($this->settings);
         $this->configurationBuilder = Tx_Yag_Domain_Configuration_ConfigurationBuilderFactory::getInstance($contextIdentifier, $this->settings['theme'], $resetContext);
         if (TYPO3_MODE === 'FE') {
             GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager')->get('Tx_PtExtlist_Extbase_ExtbaseContext')->setInCachedMode(true);
             $storageAdapter = Tx_PtExtbase_State_Session_Storage_NullStorageAdapter::getInstance();
             $this->lifecycleManager->registerAndUpdateStateOnRegisteredObject($this->sessionPersistenceManagerBuilder->getInstance($storageAdapter));
         } else {
             $this->lifecycleManager->registerAndUpdateStateOnRegisteredObject($this->sessionPersistenceManagerBuilder->getInstance());
         }
         $this->yagContext = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager')->get('Tx_Yag_Domain_Context_YagContextFactory')->createInstance($contextIdentifier, $resetContext);
     }
 }
Пример #3
0
 /** @test */
 public function staticObserverCanBeRegisteredOnlyOnce()
 {
     $lifecycleManager = new Tx_PtExtbase_Lifecycle_Manager();
     $observeableObject1 = new Tx_PtExtbase_Tests_Unit_Lifecycle_ManagerTest_ObservableMock();
     $observeableObject1->state = 2;
     $observeableObject2 = new Tx_PtExtbase_Tests_Unit_Lifecycle_ManagerTest_ObservableMock();
     $observeableObject2->state = 2;
     $lifecycleManager->registerAndUpdateStateOnRegisteredObject($observeableObject1);
     $lifecycleManager->registerAndUpdateStateOnRegisteredObject($observeableObject2);
     $lifecycleManager->updateState(30);
     $this->assertEquals($observeableObject1->state, Tx_PtExtbase_Lifecycle_Manager::UNDEFINED);
     $this->assertEquals($observeableObject2->state, 30);
 }