-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcleanup.php
25 lines (23 loc) · 1.01 KB
/
cleanup.php
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
<?php
# +--------------------------------------------------------------------+
# | phpEasyVCS |
# | The file-based version control system |
# +--------------------------------------------------------------------+
# | Copyright (c) 2011 Martin Vlcek |
# | License: GPLv3 (http://www.gnu.org/licenses/gpl-3.0.html) |
# +--------------------------------------------------------------------+
require_once('inc/basic.php');
header('Content-Type: text/plain; charset=UTF-8');
$delete = isset($_GET['delete']);
$dir = @opendir(DATAPATH) or die("Unable to open data directory");
if (!$delete) {
echo "The following files will be deleted, if you call cleanup.php?delete:\r\n";
} else {
echo "Deleting files:\r\n";
}
while ($filename = readdir($dir)) {
if (strpos($filename,'\\') !== false) {
echo " - $filename\r\n";
if ($delete) unlink(DATAPATH.$filename);
}
}