47 lines
1.3 KiB
PHP
47 lines
1.3 KiB
PHP
<?php
|
|
|
|
/**
|
|
* STANDALONE REPAIR SCRIPT
|
|
* Force clear Laravel cache without SSH access.
|
|
* DELETE THIS FILE AFTER USE!
|
|
*/
|
|
|
|
define('LARAVEL_START', microtime(true));
|
|
|
|
// Register the Composer autoloader...
|
|
if (!file_exists(__DIR__.'/../vendor/autoload.php')) {
|
|
die('Error: vendor/autoload.php not found. Did you run composer install?');
|
|
}
|
|
require __DIR__.'/../vendor/autoload.php';
|
|
|
|
// Bootstrap Laravel
|
|
/** @var Illuminate\Foundation\Application $app */
|
|
$app = require_once __DIR__.'/../bootstrap/app.php';
|
|
|
|
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
|
|
|
|
echo "<h1>Laravel Cache Repair</h1>";
|
|
echo "<ul>";
|
|
|
|
try {
|
|
$kernel->call('config:clear');
|
|
echo "<li>✅ Config cache cleared</li>";
|
|
|
|
$kernel->call('route:clear');
|
|
echo "<li>✅ Route cache cleared</li>";
|
|
|
|
$kernel->call('view:clear');
|
|
echo "<li>✅ View cache cleared</li>";
|
|
|
|
$kernel->call('cache:clear');
|
|
echo "<li>✅ Application cache cleared</li>";
|
|
|
|
echo "</ul>";
|
|
echo "<h2 style='color: green;'>Success!</h2>";
|
|
echo "<p>Your site should now be working. Please <b>DELETE</b> this file (<code>public/repair-cache.php</code>) immediately.</p>";
|
|
} catch (Exception $e) {
|
|
echo "</ul>";
|
|
echo "<h2 style='color: red;'>Error:</h2>";
|
|
echo "<pre>" . $e->getMessage() . "</pre>";
|
|
}
|