function _ldap_api_parsePHPModules in Lightweight Directory Access Protocol (LDAP) 6
1 call to _ldap_api_parsePHPModules()
File
- ./
ldap_api.admin.inc, line 60 - Administrative page callbacks for the ldap_api module.
Code
function _ldap_api_parsePHPModules() {
ob_start();
phpinfo();
$s = ob_get_contents();
ob_end_clean();
$s = strip_tags($s, '<h2><th><td>');
$s = preg_replace('/<th[^>]*>([^<]+)<\\/th>/', "<info>\\1</info>", $s);
$s = preg_replace('/<td[^>]*>([^<]+)<\\/td>/', "<info>\\1</info>", $s);
$vtmp = preg_split('/(<h2>[^<]+<\\/h2>)/', $s, -1, PREG_SPLIT_DELIM_CAPTURE);
$vmodules = array();
for ($i = 1; $i < count($vtmp); $i++) {
if (preg_match('/<h2>([^<]+)<\\/h2>/', $vtmp[$i], $vmat)) {
$vname = trim($vmat[1]);
$vtmp2 = explode("\n", $vtmp[$i + 1]);
foreach ($vtmp2 as $vone) {
$vpat = '<info>([^<]+)<\\/info>';
$vpat3 = "/{$vPat}\\s*{$vpat}\\s*{$vpat}/";
$vpat2 = "/{$vPat}\\s*{$vpat}/";
if (preg_match($vpat3, $vone, $vmat)) {
// 3cols
$vmodules[$vname][trim($vmat[1])] = array(
trim($vmat[2]),
trim($vmat[3]),
);
}
elseif (preg_match($vpat2, $vone, $vmat)) {
// 2cols
$vmodules[$vname][trim($vmat[1])] = trim($vmat[2]);
}
}
}
}
return $vmodules;
}