-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforce_config_refresh.php
More file actions
55 lines (47 loc) · 1.43 KB
/
force_config_refresh.php
File metadata and controls
55 lines (47 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* Force Config Refresh - Touches files to force PHP to reload
*/
$laravelRoot = '/home/eunixmac/eunixmac_api';
echo "<h2>Force Config Refresh</h2>";
echo "<pre>";
// Touch .env file to update its timestamp
$envFile = $laravelRoot . '/.env';
if (file_exists($envFile)) {
touch($envFile);
echo "✅ Touched .env file\n";
}
// Touch bootstrap/app.php to force reload
$appFile = $laravelRoot . '/bootstrap/app.php';
if (file_exists($appFile)) {
touch($appFile);
echo "✅ Touched bootstrap/app.php\n";
}
// Clear all possible cache locations
$cacheDirs = [
$laravelRoot . '/bootstrap/cache',
$laravelRoot . '/storage/framework/cache',
$laravelRoot . '/storage/framework/sessions',
];
foreach ($cacheDirs as $dir) {
if (is_dir($dir)) {
$files = glob($dir . '/*');
$count = 0;
foreach ($files as $file) {
if (is_file($file) && !in_array(basename($file), ['.gitignore', 'data'])) {
@unlink($file);
$count++;
}
}
echo "✅ Cleared {$count} files from " . basename($dir) . "\n";
}
}
echo "\n==========================================\n";
echo "✅ FORCED REFRESH COMPLETED!\n";
echo "==========================================\n\n";
echo "Test now:\n";
echo "1. https://eunixma.com.ng/api/ads/51\n";
echo "2. Check if preview_image uses eunixma.com.ng (not localhost)\n";
echo "3. DELETE THIS FILE!\n";
echo "</pre>";
?>