summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 487bc4b)
raw | patch | inline | side by side (parent: 487bc4b)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 31 Jul 2007 08:54:04 +0000 (08:54 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 31 Jul 2007 08:54:04 +0000 (08:54 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6947 594d385d-05f5-0310-b6e9-bd551577e9d8
include/functions_debug.inc | patch | blob | history | |
include/php_setup.inc | patch | blob | history |
index 472ad7f7fca2f64f3d33b7c6b29d88519ea09989..340dd97317a9c247070d1df91fb35854be1753fb 100644 (file)
print '<pre>'.$sql_string.'</pre>';
}
+
+function print_array($array, $sort=true) {
+ $result= "";
+
+ if($array && is_array($array) && array_count_values($array) > 0) {
+
+ if($sort) {
+ sort($array);
+ }
+
+ $size= count($array);
+
+ foreach($array as $value) {
+ $result.= $value;
+
+ if($size > 1) {
+ $result.= ", ";
+ }
+
+ $size--;
+ }
+ }
+
+ return $result;
+}
+
+/**
+ * parse php modules from phpinfo
+ * taken from user comments on php-net site
+ */
+
+function parsePHPModules() {
+ ob_start();
+ phpinfo(INFO_MODULES);
+ $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;
+}
+
+function get_module_setting($pModuleName, $pSetting) {
+ $vModules= parsePHPModules();
+ return $vModules[$pModuleName][$pSetting];
+}
?>
diff --git a/include/php_setup.inc b/include/php_setup.inc
index 321238ceb6b4f05adbe6ae4cad6c88831051b830..7e7b3d573aa34c11f28dd31aea30915ce1dbc27c 100644 (file)
--- a/include/php_setup.inc
+++ b/include/php_setup.inc
/* Create header as needed */
if ($error_collector == ""){
-
+
/* Mailto body header */
$error_collector_mailto .=prepare4mailbody(
"Oups. Seems like you've catched some kind of bug inside GOsa/PHP. You may want to help ".
"\nGOsa Version: ".get_gosa_version().
"\nDate: ".date("d.m.Y").
"\nTime: ".date("H:i:s").
+ "\nUser-Agent: ".$_SERVER['HTTP_USER_AGENT']." ".
+ "(Javascript is ".( (isset($_SESSION['js']) && $_SESSION['js']==FALSE) ? "inactive" : "active" ).")".
"\n\n".
"Please describe what you did to produce this error as detailed as possible. Can you ".
"reproduce this bug using the demo on http://www.gosa-project.org ?".
"\n\n".
+ "*** PHP runtime information ***".
+ "\nPHP Version: ".phpversion().
+ "\nRunning on: ".php_uname().
+ "\nLoaded Extensions: ".print_array(get_loaded_extensions()).
+ "\nLDAP Module Version: ".get_module_setting('ldap','RCS Version').
+ "\n\n".
"*** PHP error information ***\n\n");
if (isset($_SESSION['js']) && $_SESSION['js']==FALSE){