Initial commit

This commit is contained in:
Kwesi Banson Jnr
2026-04-08 05:53:02 +00:00
commit 592a161ee6
63 changed files with 4105 additions and 0 deletions

14
public/.htaccess Normal file
View File

@@ -0,0 +1,14 @@
RewriteEngine On
#RewriteBase /mse_api/public
# 1. Prevent directory browsing
Options -Indexes
# 2. If the request is NOT a real directory...
RewriteCond %{REQUEST_FILENAME} !-d
# 3. ...and is NOT a real file...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
# 4. ...send the request to index.php
RewriteRule ^ index.php [L]

30
public/index.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
require_once __DIR__ . '/../vendor/autoload.php';
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/../');
$dotenv->load();
$dotenv->required(['DB_HOST', 'DB_NAME', 'DB_USER', 'DB_PASS'])->notEmpty();
use App\Core\Router;
$router = new Router();
$router->get('/', 'HomeController@index');
$router->post('/disbursement', 'DisbursementController@index');
$router->get('/test', 'DisbursementController@testUpdate');
$request_uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$base_path = str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']));
if ($base_path !== '/' && strpos($request_uri, $base_path) === 0) {
$request_uri = substr($request_uri, strlen($base_path));
}
$request_uri = '/' . ltrim($request_uri, '/');
$router->resolve($request_uri, $_SERVER['REQUEST_METHOD']);
?>