-
Notifications
You must be signed in to change notification settings - Fork 0
/
getmodconfig.php
executable file
·49 lines (41 loc) · 1.27 KB
/
getmodconfig.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
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
$q=$_GET["q"];
#echo "q is $q";
$doc = new DOMDocument();
$doc->load( 'mod.xml' );
$mods = $doc->getElementsByTagName( "mod" );
foreach( $mods as $mod )
{
$id = $mod->getAttribute("id");
$params = $mod->getAttribute("param");
if($id == $q) {
# $params = $int->getElementsByTagName( "param" );
echo $params;
}
# $titles = $book->getElementsByTagName( "title" );
# $title = $titles->item(0)->nodeValue;
}
$doc = new DOMDocument();
$doc->load( 'config.xml' );
$configs = $doc->getElementsByTagName( "config" );
foreach( $configs as $config )
{
$id = $config->getAttribute("id");
$params = $config->getAttribute("param");
$value = NULL;
foreach ($config->getElementsByTagName('param') as $param) {
$value = $value . $param->nodeValue;
}
if($id == $q) {
# $params = $int->getElementsByTagName( "param" );
$items = explode(",",$value);
$params = implode(",",$items);
echo $params;
}
# $titles = $book->getElementsByTagName( "title" );
# $title = $titles->item(0)->nodeValue;
}
#exec("sudo ./getconfig.pl", $info);
#echo "info is $info\n\n\n\n";
#echo "$q Config show here";
?>