mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-07 04:58:40 +00:00
fixes #79
This commit is contained in:
parent
a6a56883a8
commit
0c5e3bfad4
|
|
@ -87,6 +87,38 @@ class UriFactory
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function clearAll() : bool
|
||||||
|
{
|
||||||
|
self::$uri = [];
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function clear(string $key) : bool
|
||||||
|
{
|
||||||
|
if(isset(self::$uri[$key])) {
|
||||||
|
unset(self::$uri[$key]);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function clearLike(string $pattern) : bool
|
||||||
|
{
|
||||||
|
$success = false;
|
||||||
|
|
||||||
|
foreach(self::$uri as $key => $value) {
|
||||||
|
if(((bool) preg_match('~^' . $pattern . '$~', $key))) {
|
||||||
|
unset(self::$uri[$key]);
|
||||||
|
$success = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simplify url
|
* Simplify url
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user