summaryrefslogtreecommitdiffstats
path: root/admin/purgecache.php
diff options
context:
space:
mode:
authornashe <contact@nashe.fr>2015-08-11 11:59:40 +0200
committernashe <contact@nashe.fr>2015-08-11 11:59:40 +0200
commitf2788a4ed2eae7f0056ab200b8fc787ed20a32da (patch)
treec9c5ded4176bb6390f6f5773ebfa2f8b91d67a5a /admin/purgecache.php
parente47418ee75998ae22a506b8fd596dbba58388266 (diff)
downloadplanet-f2788a4ed2eae7f0056ab200b8fc787ed20a32da.tar
planet-f2788a4ed2eae7f0056ab200b8fc787ed20a32da.tar.gz
planet-f2788a4ed2eae7f0056ab200b8fc787ed20a32da.tar.bz2
planet-f2788a4ed2eae7f0056ab200b8fc787ed20a32da.tar.xz
planet-f2788a4ed2eae7f0056ab200b8fc787ed20a32da.zip
Fix class autoloading
Made some mistakes with my last PR: I tested that everything were working, but on the wrong branch. This commit fixes all the autoloading error that were left.
Diffstat (limited to 'admin/purgecache.php')
-rw-r--r--admin/purgecache.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/admin/purgecache.php b/admin/purgecache.php
index a5af5cf..8657938 100644
--- a/admin/purgecache.php
+++ b/admin/purgecache.php
@@ -1,16 +1,18 @@
<?php
+
+require_once __DIR__.'/../app/app.php';
require_once dirname(__FILE__).'/inc/auth.inc.php';
if (isset($_POST['purge'])){
$dir = dirname(__FILE__).'/../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();