- Add comprehensive error handling system with custom error pages - Implement professional enterprise-style design with Tailwind CSS - Create modular HMVC architecture with clean separation of concerns - Add security features: CSRF protection, XSS filtering, Argon2ID hashing - Include CLI tools for development workflow - Add error reporting dashboard with system monitoring - Implement responsive design with consistent slate color scheme - Replace all emoji icons with professional SVG icons - Add comprehensive test suite with PHPUnit - Include database migrations and seeders - Add proper exception handling with fallback pages - Implement template engine with custom syntax support - Add helper functions and facades for clean code - Include proper logging and debugging capabilities
55 lines
1.7 KiB
PHP
55 lines
1.7 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Woles Framework v1.0
|
|
* Entry Point
|
|
*/
|
|
|
|
// Enable error reporting for development
|
|
if (getenv('APP_DEBUG') === 'true' || getenv('APP_ENV') === 'development') {
|
|
error_reporting(E_ALL);
|
|
ini_set('display_errors', 1);
|
|
}
|
|
|
|
// Load Composer autoloader
|
|
require_once __DIR__ . '/../vendor/autoload.php';
|
|
|
|
// Load helper functions
|
|
require_once __DIR__ . '/../app/helpers.php';
|
|
|
|
// Load environment variables
|
|
if (file_exists(__DIR__ . '/../.env')) {
|
|
$lines = file(__DIR__ . '/../.env', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
|
foreach ($lines as $line) {
|
|
if (strpos($line, '=') !== false && strpos($line, '#') !== 0) {
|
|
list($key, $value) = explode('=', $line, 2);
|
|
$key = trim($key);
|
|
$value = trim($value);
|
|
putenv("$key=$value");
|
|
$_ENV[$key] = $value;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Initialize and run the application
|
|
try {
|
|
$bootstrap = new App\Core\Bootstrap();
|
|
$bootstrap->run();
|
|
} catch (Throwable $e) {
|
|
// Log error
|
|
error_log("Woles Error: " . $e->getMessage() . " in " . $e->getFile() . ":" . $e->getLine());
|
|
|
|
// Show error page
|
|
http_response_code(500);
|
|
if (getenv('APP_DEBUG') === 'true') {
|
|
echo "<h1>Woles Framework Error</h1>";
|
|
echo "<p><strong>Message:</strong> " . htmlspecialchars($e->getMessage()) . "</p>";
|
|
echo "<p><strong>File:</strong> " . htmlspecialchars($e->getFile()) . "</p>";
|
|
echo "<p><strong>Line:</strong> " . $e->getLine() . "</p>";
|
|
echo "<pre>" . htmlspecialchars($e->getTraceAsString()) . "</pre>";
|
|
} else {
|
|
echo "<h1>Internal Server Error</h1>";
|
|
echo "<p>Something went wrong. Please try again later.</p>";
|
|
}
|
|
}
|