diff --git a/init.php b/init.php index cfa0b08..7eef973 100644 --- a/init.php +++ b/init.php @@ -34,6 +34,7 @@ $dirs = [ 'WEBROOT/src/utils', 'WEBROOT/src/MVC', 'WEBROOT/src/MVC/Core', + 'WEBROOT/src/MVC/Classes', 'WEBROOT/src/MVC/Controller', 'WEBROOT/src/MVC/Model', 'WEBROOT/src/MVC/View', @@ -398,6 +399,148 @@ function db_connect() { } } PHP; +// -- CLASSES -- + +$files['WEBROOT/src/MVC/Classes/Api.php'] = <<<'PHP' + $statusCode === 200 ? 'success' : 'error', + 'data' => $data, + ], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE + ); + exit; + } +} +PHP; + +$files['WEBROOT/src/MVC/Classes/Client.php'] = <<<'PHP' +country ?? 'UNKNOWN'; + } + + public static function userAgent() { + return $_SERVER['HTTP_USER_AGENT'] ?? 'UNKNOWN'; + } +} +PHP; + +$files['WEBROOT/src/MVC/Classes/Cookie.php'] = <<<'PHP' + @@ -692,10 +836,31 @@ $files['WEBROOT/src/MVC/Layout/Templates/main.php'] = <<<'HTML' HTML; // --- CONTROLLERS --- +$files['WEBROOT/src/MVC/Controller/ApiController.php'] = <<<'PHP' + 'DummyData', + ]); + } +} +PHP; + $files['WEBROOT/src/MVC/Controller/HomeController.php'] = <<<'PHP' Service 1
= \$msg ?>
System Check