48 lines
2.1 KiB
PHP
48 lines
2.1 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Application Entry Point
|
|
*
|
|
* This file initializes the application, sets up error handling, loads dependencies,
|
|
* and dispatches incoming requests using the Router.
|
|
*/
|
|
|
|
// Enable detailed error reporting for debugging
|
|
ini_set('display_errors', 1);
|
|
ini_set('display_startup_errors', 1);
|
|
error_reporting(E_ALL);
|
|
|
|
require_once __DIR__ . '/../vendor/autoload.php';
|
|
|
|
use WizdomNetworks\WizeWeb\Core\Router;
|
|
use WizdomNetworks\WizeWeb\Utils\ErrorHandler;
|
|
use WizdomNetworks\WizeWeb\Utils\Logger;
|
|
use Dotenv\Dotenv;
|
|
|
|
$dotenv = Dotenv::createImmutable(__DIR__ . '/../');
|
|
$dotenv->load();
|
|
|
|
// Register error handler
|
|
ErrorHandler::register();
|
|
|
|
// Initialize Logger
|
|
Logger::init();
|
|
|
|
// Initialize and configure router
|
|
$router = new Router();
|
|
|
|
// Define routes
|
|
$router->add('', \WizdomNetworks\WizeWeb\Controllers\HomeController::class, 'index');
|
|
$router->add('about', \WizdomNetworks\WizeWeb\Controllers\AboutController::class, 'index');
|
|
$router->add('contact', \WizdomNetworks\WizeWeb\Controllers\ContactController::class, 'index');
|
|
$router->add('testimonials', \WizdomNetworks\WizeWeb\Controllers\TestimonialsController::class, 'index');
|
|
$router->add('services', \WizdomNetworks\WizeWeb\Controllers\ServicesController::class, 'index');
|
|
$router->add('services/it-consulting', \WizdomNetworks\WizeWeb\Controllers\ITConsultingController::class, 'index', 'pages/services/it_consulting');
|
|
$router->add('services/emergency-support', \WizdomNetworks\WizeWeb\Controllers\EmergencySupportController::class, 'index', 'pages/services/emergency_support');
|
|
$router->add('services/managed-services', \WizdomNetworks\WizeWeb\Controllers\ManagedServicesController::class, 'index', 'pages/services/managed_services');
|
|
$router->add('services/online-brand-management', \WizdomNetworks\WizeWeb\Controllers\OnlineBrandManagementController::class, 'index', 'pages/services/online_brand_management');
|
|
$router->add('services/project-management', \WizdomNetworks\WizeWeb\Controllers\ProjectManagementController::class, 'index', 'pages/services/project_management');
|
|
|
|
// Dispatch the request
|
|
$router->dispatch($_SERVER['REQUEST_URI']);
|