Example #1
0
 private function redirectBack()
 {
     $referrer = $this->request->getReferer();
     $current = $this->request->getUrl();
     if ($referrer && !$referrer->isEqual($current)) {
         header('Location: ' . $referrer);
         exit;
     }
 }
Example #2
0
 /**
  * @return void
  */
 private function returnBack()
 {
     $currentUrl = $this->request->getUrl();
     $refererUrl = $this->request->getReferer();
     if ($refererUrl === NULL) {
         throw new \RuntimeException('Unable to redirect back because your browser did not send referrer');
     } elseif ($refererUrl->isEqual($currentUrl)) {
         throw new \RuntimeException('Unable to redirect back because it would create loop');
     }
     header('Location: ' . $refererUrl);
     exit;
 }
Example #3
0
 protected function runCronJobs()
 {
     $this->cron->run();
     header('Location: ' . $this->request->getReferer());
     exit;
 }