- 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)
44 lines
1.4 KiB
PHP
44 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
require_once __DIR__ . '/vendor/autoload.php';
|
|
|
|
use App\Framework\Core\ContainerBootstrapper;
|
|
use App\Framework\OAuth\Providers\SpotifyProvider;
|
|
use App\Framework\Config\Environment;
|
|
|
|
try {
|
|
$envPath = __DIR__ . '/.env';
|
|
if (!file_exists($envPath)) {
|
|
throw new \RuntimeException(".env file not found at: {$envPath}");
|
|
}
|
|
|
|
$envVars = parse_ini_file($envPath);
|
|
if ($envVars === false) {
|
|
throw new \RuntimeException("Failed to parse .env file");
|
|
}
|
|
|
|
$env = new Environment($envVars);
|
|
|
|
echo "Environment loaded\n";
|
|
echo "SPOTIFY_CLIENT_ID: " . $env->get(\App\Framework\Config\EnvKey::fromString('SPOTIFY_CLIENT_ID'), 'NOT SET') . "\n";
|
|
echo "SPOTIFY_CLIENT_SECRET: " . $env->get(\App\Framework\Config\EnvKey::fromString('SPOTIFY_CLIENT_SECRET'), 'NOT SET') . "\n";
|
|
|
|
$containerBootstrapper = new ContainerBootstrapper($env);
|
|
$container = $containerBootstrapper->bootstrap();
|
|
|
|
echo "Container bootstrapped\n";
|
|
|
|
$spotifyProvider = $container->get(SpotifyProvider::class);
|
|
|
|
echo "✅ SpotifyProvider successfully resolved from container\n";
|
|
echo "Provider name: " . $spotifyProvider->getName() . "\n";
|
|
|
|
} catch (\Exception $e) {
|
|
echo "❌ Error: " . $e->getMessage() . "\n";
|
|
echo "File: " . $e->getFile() . ":" . $e->getLine() . "\n";
|
|
echo "\nStack trace:\n";
|
|
echo $e->getTraceAsString() . "\n";
|
|
}
|