예제 #1
0
 /**
  * Starts the execution of a frontend helper.
  *
  * @param PageIndexerRequest $request Page indexer request
  * @param PageIndexerResponse $response Page indexer response
  */
 public function processRequest(PageIndexerRequest $request, PageIndexerResponse $response)
 {
     $this->request = $request;
     $this->response = $response;
     if ($request->getParameter('loggingEnabled')) {
         GeneralUtility::devLog('Page indexer request received', 'solr', 0, array('request' => (array) $request));
     }
 }
예제 #2
0
 /**
  * Takes the request's actions and hands them of to the according frontend
  * helpers.
  *
  * @param PageIndexerRequest $request The request to dispatch
  * @param PageIndexerResponse $response The request's response
  */
 public function dispatch(PageIndexerRequest $request, PageIndexerResponse $response)
 {
     $actions = $request->getActions();
     foreach ($actions as $action) {
         $frontendHelper = $this->frontendHelperManager->resolveAction($action);
         $frontendHelper->activate();
         $frontendHelper->processRequest($request, $response);
     }
 }
 /**
  * Authenticates the request, runs the frontend helpers defined by the
  * request, and registers its own shutdown() method for execution at
  * hook_eofe in tslib/class.tslib_fe.php.
  *
  * @return void
  */
 public function run()
 {
     if (!$this->request->isAuthenticated()) {
         GeneralUtility::devLog('Invalid Index Queue Frontend Request detected!', 'solr', 3, array('page indexer request' => (array) $this->request, 'index queue header' => $_SERVER['HTTP_X_TX_SOLR_IQ']));
         http_response_code(403);
         die('Invalid Index Queue Request!');
     }
     $this->dispatcher->dispatch($this->request, $this->response);
     // register shutdown method here instead of in ext_localconf.php to
     // allow frontend helpers to execute at hook_eofe in
     // tslib/class.tslib_fe.php before shuting down
     $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe'][__CLASS__] = '&ApacheSolrForTypo3\\Solr\\IndexQueue\\PageIndexerRequestHandler->shutdown';
 }