/**
  * Register a new route.
  * This method will not register duplicate routes.
  *
  * @param CmsRoute The route to register
  * @return boolean
  */
 public static function register(CmsRoute $route)
 {
     if (self::route_exists($route)) {
         return TRUE;
     }
     if (!is_array(self::$_routes)) {
         self::$_routes = array();
     }
     self::$_routes[] = $route;
     return TRUE;
 }
Пример #2
0
 private static function _clear_cache()
 {
     @unlink(self::_get_cache_filespec());
     self::$_routes = null;
     self::$_routes_loaded = FALSE;
     // note: dynamic routes don't get cleared.
 }