feat: Complete Woles Framework v1.0 with enterprise-grade UI

- 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
This commit is contained in:
mwpn
2025-10-11 07:08:23 +07:00
commit 0b42271bfe
90 changed files with 8315 additions and 0 deletions

View File

@@ -0,0 +1,203 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Error Reports - Woles Framework</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<script>
tailwind.config = {
theme: {
extend: {
fontFamily: {
'sans': ['Inter', 'system-ui', 'sans-serif'],
}
}
}
}
</script>
</head>
<body class="font-sans bg-slate-50 min-h-screen">
<div class="max-w-7xl mx-auto px-4 py-8">
<!-- Header -->
<div class="mb-8">
<div class="flex items-center justify-between">
<div>
<h1 class="text-3xl font-bold text-slate-900">Error Reports</h1>
<p class="text-slate-600 mt-2">System error logs and debugging information</p>
</div>
<div class="flex space-x-4">
<a href="/" class="bg-slate-900 hover:bg-slate-800 text-white px-4 py-2 rounded-md text-sm font-medium transition-colors">
Back to Home
</a>
<button onclick="location.reload()" class="bg-white border border-slate-300 hover:bg-slate-50 text-slate-700 px-4 py-2 rounded-md text-sm font-medium transition-colors">
Refresh
</button>
</div>
</div>
</div>
<!-- System Info -->
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
<div class="bg-white rounded-lg shadow-sm border border-slate-200 p-6">
<div class="flex items-center">
<div class="w-12 h-12 bg-slate-100 rounded-lg flex items-center justify-center mr-4">
<svg class="w-6 h-6 text-slate-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"></path>
</svg>
</div>
<div>
<h3 class="font-semibold text-slate-900">PHP Version</h3>
<p class="text-2xl font-bold text-slate-900"><?php echo PHP_VERSION; ?></p>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow-sm border border-slate-200 p-6">
<div class="flex items-center">
<div class="w-12 h-12 bg-slate-100 rounded-lg flex items-center justify-center mr-4">
<svg class="w-6 h-6 text-slate-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4"></path>
</svg>
</div>
<div>
<h3 class="font-semibold text-slate-900">Memory Usage</h3>
<p class="text-2xl font-bold text-slate-900"><?php echo round(memory_get_usage(true) / 1024 / 1024, 2); ?>MB</p>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow-sm border border-slate-200 p-6">
<div class="flex items-center">
<div class="w-12 h-12 bg-slate-100 rounded-lg flex items-center justify-center mr-4">
<svg class="w-6 h-6 text-slate-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
</svg>
</div>
<div>
<h3 class="font-semibold text-slate-900">Framework</h3>
<p class="text-2xl font-bold text-slate-900">Woles v1.0.0</p>
</div>
</div>
</div>
</div>
<!-- Error Log -->
<div class="bg-white rounded-lg shadow-sm border border-slate-200">
<div class="px-6 py-4 border-b border-slate-200">
<h2 class="text-xl font-semibold text-slate-900">Error Log</h2>
<p class="text-slate-600 text-sm">Recent error entries from the system log</p>
</div>
<div class="p-6">
<?php
$logFile = storage_path('logs/error.log');
if (file_exists($logFile)) {
$logContent = file_get_contents($logFile);
if (!empty($logContent)) {
$entries = explode("\n\n", trim($logContent));
$entries = array_reverse(array_filter($entries)); // Reverse to show newest first
if (count($entries) > 0) {
echo '<div class="space-y-4">';
foreach (array_slice($entries, 0, 10) as $entry) { // Show last 10 entries
$lines = explode("\n", $entry);
if (count($lines) >= 2) {
$timestamp = $lines[0];
$error = $lines[1];
$file = isset($lines[2]) ? $lines[2] : '';
echo '<div class="bg-red-50 border border-red-200 rounded-lg p-4">';
echo '<div class="flex items-start justify-between">';
echo '<div class="flex-1">';
echo '<div class="text-sm text-red-600 font-medium">' . htmlspecialchars($timestamp) . '</div>';
echo '<div class="text-red-800 font-semibold mt-1">' . htmlspecialchars($error) . '</div>';
if ($file) {
echo '<div class="text-sm text-red-600 mt-1">' . htmlspecialchars($file) . '</div>';
}
echo '</div>';
echo '<div class="text-2xl ml-4">🐛</div>';
echo '</div>';
echo '</div>';
}
}
echo '</div>';
} else {
echo '<div class="text-center py-12">';
echo '<div class="text-6xl mb-4">✅</div>';
echo '<h3 class="text-lg font-semibold text-gray-900 mb-2">No Errors Found</h3>';
echo '<p class="text-gray-600">The system is running smoothly with no recent errors.</p>';
echo '</div>';
}
} else {
echo '<div class="text-center py-12">';
echo '<div class="text-6xl mb-4">✅</div>';
echo '<h3 class="text-lg font-semibold text-gray-900 mb-2">No Errors Found</h3>';
echo '<p class="text-gray-600">The system is running smoothly with no recent errors.</p>';
echo '</div>';
}
} else {
echo '<div class="text-center py-12">';
echo '<div class="text-6xl mb-4">📝</div>';
echo '<h3 class="text-lg font-semibold text-gray-900 mb-2">No Log File</h3>';
echo '<p class="text-gray-600">Error log file does not exist yet. Errors will appear here when they occur.</p>';
echo '</div>';
}
?>
</div>
</div>
<!-- Debug Information -->
<div class="mt-8 bg-white rounded-lg shadow-sm border border-gray-200">
<div class="px-6 py-4 border-b border-gray-200">
<h2 class="text-xl font-semibold text-gray-900">Debug Information</h2>
<p class="text-gray-600 text-sm">System configuration and environment details</p>
</div>
<div class="p-6">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<h3 class="font-semibold text-gray-900 mb-3">Environment</h3>
<div class="space-y-2 text-sm">
<div class="flex justify-between">
<span class="text-gray-600">Environment:</span>
<span class="font-medium"><?php echo getenv('APP_ENV') ?: 'development'; ?></span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Debug Mode:</span>
<span class="font-medium"><?php echo getenv('APP_DEBUG') === 'true' ? 'Enabled' : 'Disabled'; ?></span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Log Level:</span>
<span class="font-medium"><?php echo getenv('LOG_LEVEL') ?: 'debug'; ?></span>
</div>
</div>
</div>
<div>
<h3 class="font-semibold text-gray-900 mb-3">System</h3>
<div class="space-y-2 text-sm">
<div class="flex justify-between">
<span class="text-gray-600">Server:</span>
<span class="font-medium"><?php echo $_SERVER['SERVER_SOFTWARE'] ?? 'Unknown'; ?></span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Document Root:</span>
<span class="font-medium"><?php echo $_SERVER['DOCUMENT_ROOT'] ?? 'Unknown'; ?></span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Current Time:</span>
<span class="font-medium"><?php echo date('Y-m-d H:i:s'); ?></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>