first commit

This commit is contained in:
Lars Behrends
2025-10-17 13:29:28 +02:00
commit 929ee43001
85 changed files with 10361 additions and 0 deletions

47
check_db.php Normal file
View File

@@ -0,0 +1,47 @@
<?php
require_once __DIR__ . '/vendor/autoload.php';
// Load environment variables
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->load();
// Load database configuration
$dbConfig = require __DIR__ . '/config/database.php';
\App\Database\Database::setConfig($dbConfig);
// Initialize database
try {
$pdo = \App\Database\Database::getInstance();
echo "✅ Database connection successful\n";
} catch (Exception $e) {
die('❌ Database connection failed: ' . $e->getMessage());
}
// Check current movie count
try {
$stmt = $pdo->query("SELECT COUNT(*) as count FROM movies");
$result = $stmt->fetch(PDO::FETCH_ASSOC);
echo "📊 Current movies in database: {$result['count']}\n";
// Check recent sync logs
$stmt = $pdo->query("SELECT * FROM sync_logs ORDER BY created_at DESC LIMIT 5");
$syncLogs = $stmt->fetchAll(PDO::FETCH_ASSOC);
if (empty($syncLogs)) {
echo "📋 No sync logs found\n";
} else {
echo "📋 Recent sync logs:\n";
foreach ($syncLogs as $log) {
echo " - ID: {$log['id']}, Status: {$log['status']}, Items: {$log['processed_items']}/{$log['total_items']}, Created: {$log['created_at']}\n";
if ($log['message']) {
echo " Message: {$log['message']}\n";
}
}
}
} catch (Exception $e) {
echo "❌ Error checking database: " . $e->getMessage() . "\n";
}
echo "\n✨ Database check completed!\n";