Chore: Bump version to v1.1.0 and implement automated release system

This commit is contained in:
dyzulk
2026-01-17 13:01:05 +07:00
parent 64609a5821
commit 5b0b6de2dc
69 changed files with 3157 additions and 2375 deletions

View File

@@ -0,0 +1,41 @@
<?php
namespace App\Middleware;
use App\Models\Config;
class RouterCheckMiddleware implements MiddlewareInterface {
public function handle($request, \Closure $next) {
// We need to extract the session from the URI
// Pattern: /{session}/...
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$scriptName = dirname($_SERVER['SCRIPT_NAME']);
if (strpos($path, $scriptName) === 0) {
$path = substr($path, strlen($scriptName));
}
$path = '/' . trim($path, '/');
// Regex to grab first segment
if (preg_match('#^/([^/]+)#', $path, $matches)) {
$session = $matches[1];
// Exclude system routes that might mimic this pattern if any (like 'settings')
// But 'settings' is usually top level.
// If the user name their router "settings", it would conflict anyway.
// Let's assume standard routing structure.
if ($session === 'login' || $session === 'logout' || $session === 'settings' || $session === 'install' || $session === 'api') {
return $next($request);
}
$configModel = new Config();
if ($session !== 'demo' && !$configModel->getSession($session)) {
// Router NOT FOUND
\App\Helpers\ErrorHelper::show(404, 'errors.router_not_found_title', 'errors.router_not_found_desc');
}
}
return $next($request);
}
}