refactor: reorganize project structure for better maintainability
- 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)
This commit is contained in:
26
scripts/test/test_request_factory.php
Normal file
26
scripts/test/test_request_factory.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
require_once 'vendor/autoload.php';
|
||||
|
||||
use App\Framework\Http\HttpRequest;
|
||||
use App\Framework\Http\Request;
|
||||
use App\Framework\DI\DefaultContainer;
|
||||
|
||||
echo "Testing DI Container Request binding..." . PHP_EOL;
|
||||
|
||||
try {
|
||||
// Test simple DI binding
|
||||
$container = new DefaultContainer();
|
||||
|
||||
// Manual binding (this should work)
|
||||
$container->bind(Request::class, HttpRequest::class);
|
||||
echo "Binding created successfully" . PHP_EOL;
|
||||
|
||||
// Test resolution
|
||||
$request = $container->get(Request::class);
|
||||
echo "Request resolved: " . get_class($request) . PHP_EOL;
|
||||
echo "Implements Request interface: " . (($request instanceof Request) ? "YES" : "NO") . PHP_EOL;
|
||||
|
||||
} catch (Exception $e) {
|
||||
echo "Error: " . $e->getMessage() . PHP_EOL;
|
||||
echo "Trace: " . $e->getTraceAsString() . PHP_EOL;
|
||||
}
|
||||
Reference in New Issue
Block a user