-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscan.php
More file actions
44 lines (39 loc) · 1.05 KB
/
scan.php
File metadata and controls
44 lines (39 loc) · 1.05 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
<?php
$indir = array_filter(scandir('./generated'), function($item) {
return !is_dir('../pages/' . $item);
});
$genMain = "generated";
$genFull = "generated/full";
$pathMain = sprintf("%s/%s", $_SERVER["DOCUMENT_ROOT"], $genMain);
$pathFull = sprintf("%s/%s", $_SERVER["DOCUMENT_ROOT"], $genFull);
$scanMain = scandir($pathMain);
$scanFull = scandir($pathFull);
$scanMain = array_filter($scanMain, function($item) {
global $pathMain;
if (is_dir($pathMain . "/" . $item)) {
echo "{$item} IS a directory<br>";
} else {
echo "{$item} is NOT a directory<br>";
}
return !is_dir($pathMain . "/" . $item);
});
$scanFull = array_filter($scanFull, function($item) {
global $pathFull;
if (is_dir($pathFull . "/" . $item)) {
echo "{$item} IS a directory<br>";
} else {
echo "{$item} is NOT a directory<br>";
}
return !is_dir($pathFull . "/" . $item);
});
echo $pathFull;
echo "<br>";
print_r(is_dir($pathFull));
echo "<br>";
echo "<pre>";
print_r($scanMain);
echo "</pre>";
echo "<br>-----<br>";
echo "<pre>";
print_r($scanFull);
echo "</pre>";