/**
  * Fires end-of-lifecycle signal if processing backend request.
  * 
  * @see processRequest() in parent
  */
 public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
 {
     parent::processRequest($request, $response);
     if (TYPO3_MODE === 'BE') {
         // if we are in BE mode, this ist the last line called
         $this->lifecycleManager->updateState(Tx_PtExtbase_Lifecycle_Manager::END);
     }
 }
 /**
  * (non-PHPdoc)
  *
  * @see redirect() in parent
  */
 protected function redirect($actionName, $controllerName = NULL, $extensionName = NULL, array $arguments = NULL, $pageUid = NULL, $delay = 0, $statusCode = 303)
 {
     $this->lifecycleManager->updateState(Tx_PtExtbase_Lifecycle_Manager::END);
     parent::redirect($actionName, $controllerName, $extensionName, $arguments, $pageUid, $delay, $statusCode);
 }
示例#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);
 }