/** * Initialize the object */ public function initializeObject() { $this->sessionStorageAdapter = Tx_PtExtbase_State_Session_Storage_SessionAdapter::getInstance(); $this->registry = t3lib_div::makeInstance('t3lib_Registry'); $this->initOAuth(); $this->dropbox = new Dropbox_API($this->oAuth); }
public function initializeAction() { $this->sessionStorageAdapter = Tx_PtExtbase_State_Session_Storage_SessionAdapter::getInstance(); try { $this->dropbox = $this->objectManager->get(Tx_DlDropboxsync_Domain_Dropbox_Dropbox); } catch (Exception $e) { $this->flashMessageContainer->add($e->getMessage(), 'Error', t3lib_FlashMessage::ERROR); $this->forward('dropboxNotConfigured'); } }
/** @test */ public function sessionAdapterCanBeInjectedWithConstructor() { $sessionAdapter = Tx_PtExtbase_State_Session_Storage_SessionAdapter::getInstance(); new Tx_PtExtbase_State_Session_SessionPersistenceManager($sessionAdapter); }
/** * Initialize the sessionAdapter * * @return Tx_PtExtbase_State_Session_Storage_AdapterInterface storageAdapter */ private static function getStorageAdapter() { if (\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager')->get('Tx_PtExtbase_Context')->isInCachedMode()) { return Tx_PtExtbase_State_Session_Storage_DBAdapterFactory::getInstance(); } else { return Tx_PtExtbase_State_Session_Storage_SessionAdapter::getInstance(); } }
/** * @todo If several tree widgets are needed on the same page, provide an identifier and select the right repo from session * * Restore the repository settings from namespace */ public function restoreTreeSettingsFromSession() { $settings = Tx_PtExtbase_State_Session_Storage_SessionAdapter::getInstance()->read('Tx_PtExtbase_Tree_Configuration'); $settings = array('repository' => 'Tx_PtCertification_Domain_Repository_CategoryRepository', 'namespace' => 'tx_ptcertification_domain_model_category', 'respectEnableFields' => $this->treeContext->respectEnableFields()); if (array_key_exists('repository', $settings)) { $nodeRepositoryClassName = $settings['repository']; if ($nodeRepositoryClassName && class_exists($nodeRepositoryClassName)) { $this->nodeRepositoryClassName = $nodeRepositoryClassName; } } if (array_key_exists('namespace', $settings)) { $this->treeNameSpace = $settings['namespace']; } }
/** * Save settings to user session */ protected function saveTreeSettingsToSession() { $treeSettings = array('repository' => $this->arguments['repository'], 'namespace' => $this->arguments['namespace'], 'respectEnableFields' => $this->arguments['respectEnableFields']); Tx_PtExtbase_State_Session_Storage_SessionAdapter::getInstance()->store('Tx_PtExtbase_Tree_Configuration', $treeSettings); }
public function initializeAction() { $this->sessionStorageAdapter = Tx_PtExtbase_State_Session_Storage_SessionAdapter::getInstance(); $this->registry = t3lib_div::makeInstance('t3lib_Registry'); $this->dropbox = $this->objectManager->get('Tx_DlDropboxsync_Domain_Dropbox_Dropbox'); }
/** * Method determines which session storage adapter to use depending on injected context. */ protected function determineSessionStorageAdapterForGivenContext() { if ($this->context->isInCachedMode()) { return Tx_PtExtbase_State_Session_Storage_DBAdapterFactory::getInstance(); } else { return Tx_PtExtbase_State_Session_Storage_SessionAdapter::getInstance(); } }