/**
  * @since 2.3
  *
  * @param string $type
  * @param Title $title
  * @param array $parameters
  */
 public function dispatchJobRequestFor($type, Title $title, $parameters = array())
 {
     $this->httpRequest->setOption(ONOI_HTTP_REQUEST_URL, SpecialDeferredRequestDispatcher::getTargetURL());
     if (!$this->doPreliminaryCheckForType($type, $parameters)) {
         return null;
     }
     $dispatchableCallbackJob = $this->getDispatchableCallbackJobFor($type);
     // Build requestToken as source verification during the POST request
     $parameters['timestamp'] = time();
     $parameters['requestToken'] = SpecialDeferredRequestDispatcher::getRequestToken($parameters['timestamp']);
     if ($this->enabledHttpDeferredJobRequestState && $this->canConnectToUrl()) {
         return $this->doPostJobWith($type, $title, $parameters, $dispatchableCallbackJob);
     }
     call_user_func_array($dispatchableCallbackJob, array($title, $parameters));
     return true;
 }
 public function testGetTargetURL()
 {
     $this->assertContains(':DeferredRequestDispatcher', SpecialDeferredRequestDispatcher::getTargetURL());
 }
 /**
  * @since 2.3
  *
  * @param HttpRequest $httpRequest
  */
 public function __construct(HttpRequest $httpRequest)
 {
     $this->httpRequest = $httpRequest;
     $this->httpRequest->setOption(ONOI_HTTP_REQUEST_URL, SpecialDeferredRequestDispatcher::getTargetURL());
 }
 /**
  * @since 2.3
  *
  * @param string $type
  * @param Title $title
  * @param array $parameters
  */
 public function dispatchJobRequestWith($type, Title $title, $parameters = array())
 {
     if (!$this->isAllowedJobType($type)) {
         return null;
     }
     $this->httpRequest->setOption(ONOI_HTTP_REQUEST_URL, SpecialDeferredRequestDispatcher::getTargetURL());
     $dispatchableCallbackJob = $this->createDispatchableCallbackJob($type);
     if ($this->canUseDeferredRequest()) {
         return $this->doPostJobWith($type, $title, $parameters, $dispatchableCallbackJob);
     }
     call_user_func_array($dispatchableCallbackJob, array($title, $parameters));
     return true;
 }