- Move 45 debug/test files from root to organized scripts/ directories - Secure public/ directory by removing debug files (security improvement) - Create structured scripts organization: • scripts/debug/ (20 files) - Framework debugging tools • scripts/test/ (18 files) - Test and validation scripts • scripts/maintenance/ (5 files) - Maintenance utilities • scripts/dev/ (2 files) - Development tools Security improvements: - Removed all debug/test files from public/ directory - Only production files remain: index.php, health.php Root directory cleanup: - Reduced from 47 to 2 PHP files in root - Only essential production files: console.php, worker.php This improves: ✅ Security (no debug code in public/) ✅ Organization (clear separation of concerns) ✅ Maintainability (easy to find and manage scripts) ✅ Professional structure (clean root directory)
57 lines
1.9 KiB
PHP
57 lines
1.9 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
// Enable error reporting
|
|
ini_set('display_errors', '1');
|
|
ini_set('log_errors', '1');
|
|
error_reporting(E_ALL);
|
|
|
|
echo "🧪 Framework Debug Check\n";
|
|
echo "======================\n\n";
|
|
|
|
try {
|
|
echo "1. ✅ Basic PHP OK (Version: " . PHP_VERSION . ")\n";
|
|
|
|
echo "2. Testing Autoloader...\n";
|
|
require __DIR__ . '/../vendor/autoload.php';
|
|
echo " ✅ Autoloader loaded\n";
|
|
|
|
echo "3. Testing Basic Classes...\n";
|
|
$testClasses = [
|
|
'App\\Framework\\Core\\Application',
|
|
'App\\Framework\\Core\\AppBootstrapper',
|
|
'App\\Framework\\Http\\HttpRequest',
|
|
'App\\Framework\\Http\\Method',
|
|
];
|
|
|
|
foreach ($testClasses as $class) {
|
|
if (class_exists($class)) {
|
|
echo " ✅ $class: EXISTS\n";
|
|
} else {
|
|
echo " ❌ $class: MISSING\n";
|
|
}
|
|
}
|
|
|
|
echo "4. Testing DateTime Components...\n";
|
|
$clock = new App\Framework\DateTime\SystemClock();
|
|
echo " ✅ SystemClock: " . $clock->now()->format('Y-m-d H:i:s') . "\n";
|
|
|
|
echo "5. Testing Memory Monitor...\n";
|
|
$memoryMonitor = new App\Framework\Performance\MemoryMonitor();
|
|
echo " ✅ MemoryMonitor: Current usage " . number_format(memory_get_usage(true) / 1024 / 1024, 2) . " MB\n";
|
|
|
|
echo "\n🎉 Basic framework components working!\n";
|
|
echo "The issue is likely in the Discovery System during bootstrap.\n";
|
|
|
|
} catch (Exception $e) {
|
|
echo "\n❌ ERROR: " . $e->getMessage() . "\n";
|
|
echo "Class: " . get_class($e) . "\n";
|
|
echo "File: " . $e->getFile() . ":" . $e->getLine() . "\n";
|
|
echo "\nStack Trace:\n" . $e->getTraceAsString() . "\n";
|
|
} catch (Error $e) {
|
|
echo "\n❌ FATAL ERROR: " . $e->getMessage() . "\n";
|
|
echo "Class: " . get_class($e) . "\n";
|
|
echo "File: " . $e->getFile() . ":" . $e->getLine() . "\n";
|
|
echo "\nStack Trace:\n" . $e->getTraceAsString() . "\n";
|
|
} |