summaryrefslogtreecommitdiffstats
path: root/common/admin/purgecache.php
diff options
context:
space:
mode:
authorNicolas Lécureuil <neoclust@mageia.org>2020-05-17 14:46:00 +0200
committerNicolas Lécureuil <neoclust@mageia.org>2020-05-17 14:46:00 +0200
commite3de9d7dd1331f9718e04cc98e9ca7cfa27cf4aa (patch)
tree336981502f93ceb9fa5ed33ea3b47dcefc5a8402 /common/admin/purgecache.php
parentff32e499745367b816d10f25e63ff3328214c32f (diff)
downloadplanet-user/wally/upstream-10-dev.tar
planet-user/wally/upstream-10-dev.tar.gz
planet-user/wally/upstream-10-dev.tar.bz2
planet-user/wally/upstream-10-dev.tar.xz
planet-user/wally/upstream-10-dev.zip
Sync with master of moonmoon ( version 9.0.0-rc)HEADuser/wally/upstream-10-devmaster
Source from https://github.com/Emmafrs/moonmoon/
Diffstat (limited to 'common/admin/purgecache.php')
-rw-r--r--common/admin/purgecache.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/common/admin/purgecache.php b/common/admin/purgecache.php
index a5af5cf..23a5712 100644
--- a/common/admin/purgecache.php
+++ b/common/admin/purgecache.php
@@ -1,16 +1,18 @@
<?php
-require_once dirname(__FILE__).'/inc/auth.inc.php';
+
+require_once __DIR__.'/../app/app.php';
+require_once __DIR__.'/inc/auth.inc.php';
if (isset($_POST['purge'])){
- $dir = dirname(__FILE__).'/../cache/';
-
+ $dir = __DIR__.'/../cache/';
+
$dh = opendir($dir);
-
+
while ($filename = readdir($dh)) {
if ($filename == '.' OR $filename == '..') {
continue;
}
-
+
if (filemtime($dir . DIRECTORY_SEPARATOR . $filename) < time()) {
@unlink($dir . DIRECTORY_SEPARATOR . $filename);
}
@@ -18,4 +20,4 @@ if (isset($_POST['purge'])){
}
header('Location: administration.php');
-die(); \ No newline at end of file
+die();