Charles Sprickman wrote:
Hello all,
Recently I upgraded a box running phpwiki from php 5.2.8 to 5.2.9.
After the upgrade, phpwiki (1.3.14) started spitting out the following
two errors, both of which are basically leaving the wiki dead in the water:
[30-Mar-2009 22:01:23] PHP Parse error: syntax error, unexpected
T_CLONE, expecting T_STRING in
/usr/local/www/data/wikisvn/lib/config.php(500) : eval()'d code on line 2
[30-Mar-2009 22:01:23] PHP Fatal error: Class
'WikiDB_backend_PearDB_PearDB' not found in
/usr/local/www/data/wikisvn/lib/WikiDB/SQL.php on line 25
first error is in this block:
/**
* safe php4 definition for clone.
* php5 copies objects by reference, but we need to clone "deep copy" in
some places.
* (BlockParser)
* We need to eval it as workaround for the php5 parser.
* See http://www.acko.net/node/54
*/
if (!check_php_version(5)) {
eval('
function clone($object) {
return $object;
}
');
}
I know nothing about phpwiki - but it looks like check_php_version() is
a function they have defined?
Because reading the code, if check_php_version(5) is support to return
true for php 5 then the eval should only be triggered if the version of
php is not 5 - in which case, where phpwiki is broken is in the
check_php_version() function.
What happens when you run
<?php
if (check_php_version(5)) {
echo "php 5";
} else {
echo "not php 5";
}
?>
of course you'll need to copy their check_php version() function into
your page.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php