permission update, routes, etc.

This commit is contained in:
2024-03-27 20:50:57 +01:00
parent a8f4c84f60
commit 50ae32595d
15 changed files with 131 additions and 69 deletions

View File

@@ -56,6 +56,10 @@ abstract class Route extends DatabaseEntity {
$this->active = true;
}
public function isActive(): bool {
return $this->active;
}
private static function parseParamType(?string $type): ?int {
if ($type === null || trim($type) === "") {
return null;
@@ -115,7 +119,7 @@ abstract class Route extends DatabaseEntity {
}
}
public function match(string $url) {
public function match(string $url): bool|array {
# /test/{abc}/{param:?}/{xyz:int}/{aaa:int?}
$patternParts = self::getParts(Router::cleanURL($this->pattern, false));

View File

@@ -61,7 +61,7 @@ class DocumentRoute extends Route {
return true;
}
public function match(string $url) {
public function match(string $url): bool|array {
$match = parent::match($url);
if ($match === false || !$this->loadClass()) {
return false;