RE: [PEAR] Tree: Memory_DBSimple sample warnings/errors
| From: | daniel dot garcia at assertio dot es | Date: | Thu, 01 May 2003 07:13:45 +0000 |
| Subject: | RE: [PEAR] Tree: Memory_DBSimple sample warnings/errors | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-5152@lists.php.net to get a copy of this message | ||
Hi Joseph,
After a test, it works in my code
$menu = Tree::setupMemory( 'DBsimple',
$this->dsn_local,
$opciones_tree);
$menu->setup();
if ($menu->hasChildren(10)) echo " --> Has children";
else echo " --> No children";
It's probably something with the sample, or more probably with the options
I used....
Regards,
-- Daniel
"Joseph Blythe" <joseph@optcom.net.au>
01/05/2003 08:19
Para: <daniel.garcia@assertio.es>
cc: "Pear-General \(E-mail\)" <pear-general@lists.php.net>
Asunto: RE: [PEAR] Tree: Memory_DBSimple sample warnings/errors
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