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
45
46
47
48
49
50
51
52
53
54
|
<?php
function getPHPFiles($folder, $exclude) { global $_files; $dir = opendir($folder); while (($file = readdir($dir)) !== false) { $file = str_replace('\\', '/', $file); if ($file != '.' && $file != '..') { if (is_dir($folder . '/' . $file) && !in_array($file, $exclude)) { getPHPFiles($folder . '/' . $file, $exclude); } else { if (getSuffix($file) == 'php') { $entry = $folder . '/' . $file; $_files[] = $entry; } } } } closedir($dir); }
function listUses($base) { global $_files, $pattern, $report; $output = false; foreach ($_files as $file) { if (basename($file) != 'deprecated-functions.php') { @set_time_limit(120); $subject = file_get_contents($file); preg_match_all('/' . $pattern . '/', $subject, $matches); if ($matches && !empty($matches[0])) { $script = basename($file); $location = str_replace($base . '/', '', dirname($file)); if (!$output) { echo '<br /><strong>' . $location . '</strong><ul>'; } echo '<li> ' . $script; echo '<ul>'; foreach ($matches[0] as $match) { $match = preg_replace('/(.*)?\s/', '', $match); $match = preg_replace('/\s?\(/', '', $match); echo '<li>' . $match . '</li>'; } echo '</ul></li>'; $output = true; } } } if ($output) { echo '</ul>'; } return $output; }
?>
|