-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodules.php
More file actions
72 lines (53 loc) · 1.85 KB
/
Copy pathmodules.php
File metadata and controls
72 lines (53 loc) · 1.85 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
define('TEST_BASE', SITE_BASE . '/lib/php/tests');
define('INSTMOD_BASE', TEST_BASE . '/install/modules');
$dir_handle = opendir(INSTMOD_BASE);
/*
if (!$this->DirHandle) {
$this->Error = "Could not open directory: $dir";
throw new Exception($this->Error);
}
*/
$found = array();
$found['required'] = array();
$found['optional'] = array();
$not_found = array();
$not_found['required'] = array();
$not_found['optional'] = array();
while (($filename = readdir($dir_handle)) !== false) {
$tmpfname = INSTMOD_BASE . '/' . $filename;
if (!is_dir($tmpfname)) {
include($tmpfname);
$installed = true;
if (isset($functions) && is_array($functions))
foreach ($functions as $function)
if (!function_exists($function)) {
$installed = false;
continue;
}
if (isset($classes) && is_array($classes))
foreach ($classes as $class)
if (!class_exists($class)) {
$installed = false;
continue;
}
if ($installed == true)
$found[$importance][$module] = $comment;
else
$not_found[$importance][$module] = $comment;
}
}
print 'Required module failure list:<br/>';
foreach ($not_found['required'] as $key => $value)
print '<b>' . $key . '</b> - ' . $value . '<br/>';
print '<br/>Optional module failure list:<br/>';
foreach ($not_found['optional'] as $key => $value)
print '<b>' . $key . '</b> - ' . $value . '<br/>';
print '<br/>Required module success list:<br/>';
foreach ($found['required'] as $key => $value)
print '<b>' . $key . '</b> - ' . $value . '<br/>';
print '<br/>Optional module success list:<br/>';
foreach ($found['optional'] as $key => $value)
print '<b>' . $key . '</b> - ' . $value . '<br/>';
exit();
?>