Tree: Memory_DBSimple sample warnings/errors
| From: | daniel dot garcia at assertio dot es | Date: | Thu, 01 May 2003 04:50:26 +0000 |
| Subject: | Tree: Memory_DBSimple sample warnings/errors | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-5148@lists.php.net to get a copy of this message | ||
Hi,
I get errors when I run the Memory_DBSimple.php example:
Warning: Invalid argument supplied for foreach() in c:\php\pear\Tree\Memory.php on line 1283
I tried downloading the CVS version of Memory.php, but got the same
results. I got rid of these warnings modifying the code as follows:
// if $node is an array, we assume it is a collection of elements
if( !is_array($node) )
$nodes = $this->getNode($node); // if $node==0 then the entire
tree is retreived
else $nodes = $node;
(added the else $nodes = $node line on line 1271). I hope I'm not breaking
anything.
The example runs then nicely dumping the info until a fatal error arises:
Fatal error: Call to undefined function: haschildren() in c:\php\pear\Tree\Memory\DBsimple.php on
line 221
When I try to upgrade the package, it says I'm ok:
C:\WINNT\system32>pear upgrade tree
downloading Tree-0.2.4.tgz ...
...done: 48,824 bytes
upgrade to a newer version (0.2.4 is not newer than 0.2.4)
Please advise...
-- Daniel