-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscan.php
executable file
·38 lines (30 loc) · 974 Bytes
/
scan.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
26
27
28
29
30
31
32
33
34
35
36
<?php
set_include_path(".:./offwave/lib:" . get_include_path());
if (!is_file(__DIR__ . "/config.php")) {
die("missing config.php file!");
}
include("config.php");
function __autoload($className) {
$ds = DIRECTORY_SEPARATOR;
$className = strtr($className, '_', $ds);
$paths = explode(PATH_SEPARATOR, get_include_path());
foreach ($paths as $dir) {
$file = "{$dir}{$ds}{$className}.php";
if (is_readable($file)) {
require_once $file;
return;
}
}
throw new Exception("Sorry, {$className} is nowhere to be found in ".get_include_path());
}
$Scanner = new Offwave_Scanner();
foreach ($pathList as $path) {
$result = $Scanner->scan($path);
if (isset($result[$path]) && count($result[$path])) {
foreach($result[$path] as $webappData){
echo "{$path};{$webappData["application"]};{$webappData["version"]};\n";
}
} else {
echo "{$path};;;\n";
}
}