Installed Midgard 1.4.1 on PHP4.0.4pl1 (thanks much, I have been looking
forward to the PHP4 code). Not too many problems. My current sites all
display correctly, but I have discovered a problem in logging into Asgard.
I receive the following:
Parse error: parse error, expecting `')'' in
snippet:///Asgard/Functions/debug on line 30
?><?
# coded by thomas hansmann ([EMAIL PROTECTED]) and if you copy it,
# you're right ;-)
# if you find this code usefull, please send me an email. thanks...
# only use the first 2 arguments (a describing name and the variable
# itself, $a and $o are used only from within the function).
# Modified by David Guerizec to return a string instead of
# displaying the result.
function show_var($n,$v,$a=0,$o=0) {
$code = "";
$m1 = "is an array";
$m2 = "is an object";
$m3 = "functions";
$t = "<table class=debug border=0 cellpadding=0 cellspacing=0>";
if (!$a) $code .= $t;
$code .= "<tr><td class=debug valign=top>";
$code .= ($n == "[\"~\"]")? "<br>$m3: ": "$n ";
$code .= "</td><td class=debug>";
if (is_array($v)) {
$code .= ($o? "": "$m1:<br>"). "$t";
for (reset($v);list($k,$vv) = each($v);$code .= show_var(
"[\"$k\"]",$vv,$a+1));
$code .= "</table>";
} elseif (is_object($v)) { # very tricky
$code .= "$m2:<br>";
$v = serialize($v); # object -> string
$v = "a".substr($v,1); # fake an array
$f = unserialize($v); # string -> array
$v = ereg_replace( "s:[^;]+;i:0;", "",$v); # delete functions
$v = unserialize($v); # string -> array
for (reset($v);list($key,$val) = each($v);unset($f[$key]));
for (reset($f);list($key,$val) = each($f);$v[ "~"].= "$key(); ");
$code .= show_var( "",$v,$a+1,1);
} elseif ($n == "[\"~\"]") {
$code .= "<br>$v<br>";
} elseif (is_string($v)) {
if(strchr($v,"\n")) $code .= ConvertToCode($v);
else $code .= ": \"" . htmlentities($v). "\"<br>";
} else $code .= " : $v<br>";
$code .= "</td></tr>";
if (!$a) $code .= "</table>";
return $code;
}
?><?
Could this be why we need PHP4.0.5? Let me know if this can be easily
remedied without going to the CVS version of PHP4.
Thanks
Fred
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]