Files
coursehub/scan.php
T
Harwinder Sekhon c4c88e52da UI improved
2026-07-27 13:58:47 -04:00

16 lines
640 B
PHP

<?php
// CLI library scan (for cron or manual runs): php scan.php
// From the browser, use the "Rescan library" button (api/scan.php).
require_once __DIR__ . '/includes/functions.php';
if (PHP_SAPI !== 'cli') {
header('Location: index.php');
exit;
}
$stats = scanLibrary();
echo "Scan complete: {$stats['folders']} folders, {$stats['videos']} videos, {$stats['quizzes']} quizzes"
. " ({$stats['missing_folders']} folders / {$stats['missing_videos']} videos"
. " / {$stats['missing_quizzes']} quizzes flagged missing)\n"
. "Thumbnails: {$stats['thumbnails_generated']} generated, {$stats['thumbnails_failed']} failed\n";