/**
  * Returns a singleton instance of Uri_Redirects
  * @uses is_array()
  * 
  * @access public
  * @return Uri_Redirects
  */
 public static function i()
 {
     if (!self::$_singleton instanceof Uri_Redirects) {
         include_once Usu_Main::i()->getVar('includes_path') . 'uri_redirects_array.php';
         if (isset($usu5_uri_redirects) && is_array($usu5_uri_redirects) && !empty($usu5_uri_redirects)) {
             self::$redirects = $usu5_uri_redirects;
         }
         self::$_singleton = new self();
     }
     return self::$_singleton;
 }
Пример #2
0
 /**
  * The page does not exist so we will show our custom 404 error page and header
  * 
  * @see Usu_Main::getVar()
  * @see Uri_Redirects::needsRedirect()
  * @see Usu_Validator::redirect()
  * @uses session_write_close()
  * @uses header()
  * @uses exit()
  * 
  * @access private
  * @return void
  */
 private function pageNotFound()
 {
     include_once Usu_Main::i()->getVar('includes_path') . 'uri_redirects_class.php';
     if (false !== ($url = Uri_Redirects::i()->needsRedirect())) {
         $this->redirect($url);
     }
     session_write_close();
     header("HTTP/1.0 404 Not Found");
     include_once Usu_Main::i()->getVar('includes_path') . 'notfound_404.php';
     exit;
 }