public static function current() { if (!is_null(self::$uri)) { return self::$uri; } $uri = trim(Request::pathInfo(), "/"); $uri = $uri ? $uri : "/"; self::$uri = $uri; $segments = array_diff(explode("/", trim($uri, "/")), array("")); if (array_get($segments, 0) == "manager") { self::$isManager = true; array_shift($segments); } self::$segments = $segments; return $uri; }
public static function deleteSegment($segment) { unset(self::$segments[$segment]); $new = array(); foreach (self::$segments as $value) { $new[] = $value; } self::$segments = $new; return true; }
/** * Destroy the test environment. */ public function tearDown() { $_SERVER = array(); URI::$uri = null; URI::$segments = array(); }