- 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)
40 lines
1.4 KiB
PHP
40 lines
1.4 KiB
PHP
#!/usr/bin/env php
|
|
<?php
|
|
declare(strict_types=1);
|
|
|
|
require_once __DIR__ . '/vendor/autoload.php';
|
|
|
|
use App\Framework\Console\ConsoleCommandMapper;
|
|
use App\Framework\Console\ConsoleCommand;
|
|
use App\Framework\Console\DemoCommand;
|
|
use App\Framework\Reflection\WrappedReflectionMethod;
|
|
|
|
echo "Testing ConsoleCommandMapper..." . PHP_EOL;
|
|
|
|
try {
|
|
$mapper = new ConsoleCommandMapper();
|
|
|
|
// Test the mapper configuration
|
|
echo "Mapper attribute class: " . $mapper->getAttributeClass() . PHP_EOL;
|
|
echo "ConsoleCommand class: " . ConsoleCommand::class . PHP_EOL;
|
|
echo "Classes match: " . ($mapper->getAttributeClass() === ConsoleCommand::class ? 'YES' : 'NO') . PHP_EOL;
|
|
|
|
// Test with a real method
|
|
$reflector = new ReflectionClass(DemoCommand::class);
|
|
$method = $reflector->getMethod('hello');
|
|
$attributes = $method->getAttributes(ConsoleCommand::class);
|
|
|
|
if (!empty($attributes)) {
|
|
$attribute = $attributes[0]->newInstance();
|
|
echo "Attribute found: " . $attribute->name . PHP_EOL;
|
|
|
|
// This would require complex setup, just test the basic mapping
|
|
echo "Basic mapper test passed!" . PHP_EOL;
|
|
} else {
|
|
echo "No attributes found on hello method!" . PHP_EOL;
|
|
}
|
|
|
|
} catch (Exception $e) {
|
|
echo "Error: " . $e->getMessage() . PHP_EOL;
|
|
echo "Trace: " . $e->getTraceAsString() . PHP_EOL;
|
|
} |