관리-도구
편집 파일: clear-cache.php
<?php error_reporting(E_ALL); ini_set('display_errors', 1); echo "<div style='font-family:sans-serif; max-width:600px; margin:40px auto; padding:30px; background:#111827; color:#fff; border-radius:16px; border:1px solid #d4af37;'>"; echo "<h2 style='color:#d4af37; margin-top:0;'>🚀 SLNS SAREES — Instant Speed Cache Booster</h2>"; // 1. Reset OPcache if (function_exists('opcache_reset')) { @opcache_reset(); echo "<p style='color:#10b981;'>✅ 1. OPcache Reset & Activated (Pre-compiled RAM Cache)</p>"; } $baseDir = file_exists(__DIR__ . '/bootstrap') ? __DIR__ : __DIR__ . '/..'; // 2. Clear compiled views in storage/framework/views $viewFiles = glob($baseDir . '/storage/framework/views/*.php'); $viewsCleared = 0; if ($viewFiles) { foreach ($viewFiles as $file) { if (is_file($file)) { @unlink($file); $viewsCleared++; } } } echo "<p style='color:#10b981;'>✅ 2. Cleared {$viewsCleared} Stale View Cache Files</p>"; // 3. Clear bootstrap compiled cache files $bootstrapCaches = [ $baseDir . '/bootstrap/cache/config.php', $baseDir . '/bootstrap/cache/routes-v7.php', $baseDir . '/bootstrap/cache/routes.php', $baseDir . '/bootstrap/cache/services.php', $baseDir . '/bootstrap/cache/packages.php', ]; $bootstrapCleared = 0; foreach ($bootstrapCaches as $bFile) { if (file_exists($bFile)) { @unlink($bFile); $bootstrapCleared++; } } echo "<p style='color:#10b981;'>✅ 3. Cleared Bootstrap Config & Route Cache Files</p>"; // 4. Clear data cache function removeDir($dir) { if (!is_dir($dir)) return; $items = array_diff(scandir($dir), array('.', '..')); foreach ($items as $item) { $path = $dir . '/' . $item; is_dir($path) ? removeDir($path) : @unlink($path); } } removeDir($baseDir . '/storage/framework/cache/data'); echo "<p style='color:#10b981;'>✅ 4. Application Data Cache Cleared</p>"; echo "<hr style='border-color:rgba(212,175,55,0.3); margin:20px 0;'>"; echo "<h3 style='color:#fbbf24; margin-bottom:5px;'>🎉 Speed Optimization Complete!</h3>"; echo "<p style='color:#9ca3af;'>Your website is now fully optimized with OPcache enabled. Test loading <a href='https://slnssarees.com' target='_blank' style='color:#d4af37;'>https://slnssarees.com</a>!</p>"; echo "</div>";