RE: [PEAR] Tree: Memory_DBSimple sample warnings/errors
| From: | Joseph Blythe | Date: | Thu, 01 May 2003 06:19:44 +0000 |
| Subject: | RE: [PEAR] Tree: Memory_DBSimple sample warnings/errors | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-5150@lists.php.net to get a copy of this message | ||
Daniel,
I believe that that the function haschildren() should be: hasChildren() as I
was using that method today you might want to look into that ?
Regards,
Joseph
-----Original Message-----
From: daniel.garcia@assertio.es [mailto:daniel.garcia@assertio.es]
Sent: Thursday, 1 May 2003 2:20 PM
To: pear-general@lists.php.net
Subject: [PEAR] Tree: Memory_DBSimple sample warnings/errors
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