HTML_TreeMenu Memory overflow at output please help?

From: Date: Wed, 10 Nov 2004 12:40:56 +0000
Subject: HTML_TreeMenu Memory overflow at output please help?
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-15415@lists.php.net to get a copy of this message
Hello, yes i have an other posting here but now runs the script but i have an other problem if i run my script the my IE or netscape have an memory-overflow runs up to 150 MB and more and the machine-runs also up to 90 percent I use the latest Tree/Tree.php with combinied HTML/TreeMenu.php is would like use both classes to create a menu for ebay-categories (about 25000) I have stored all in my mysql-db (i use mysql-4.1 with php-5.0.2 and mysqli-support on pear) I have also updated my db-entrys like (all root-categories must have an "0" in the parentID (is coming from ebay this haven't this all root-categories have the same id like parentid i have update this to "0")) there is my code <?php require_once("DB.php"); require_once("Tree/Tree.php"); $options = array('table'=>'Categories','whereAddOn'=>'SiteId=0','order'=>'CategoryId','columnNameMaps'=>array('id' => 'CategoryId','parentId' => 'CategoryParentId','name' => 'CategoryName')); $tree = Tree::setupMemory('DBsimple', 'mysqli://myuser:mypass@unix(/tmp/mysqld-new.sock)/sell_by_web', $options); $tree->setup(); include("HTML/TreeMenu.php"); $_treeMenu = HTML_TreeMenu::createFromStructure(array( 'structure'=>$tree,'type'=>'kriesing')); $treeMenu = new HTML_TreeMenu_DHTML($_treeMenu, array('images' =>'imagesAlt2','defaultClass' => 'treeMenuDefault')); ?> <html> <head>
     <style type="text/css">
         .treeMenuDefault {
         font-style: italic;
         }
     </style>
     <script src="TreeMenu.js" language="JavaScript" type="text/javascript"></script>
</head> <body> <? $treeMenu->printMenu()?> </body> </html> my db-log have this entry SELECT * FROM Categories WHERE SiteId=0 ORDER BY CategoryParentId,CategoryId I think normal i have to sort CategoryId,CategoryParentId and not CategoryParentId,CategoryId the output was is comming (only html-source-code) <html> <head>
     <style type="text/css">
         .treeMenuDefault {
         font-style: italic;
         }
     </style>
     <script src="TreeMenu.js" language="JavaScript" type="text/javascript"></script>
</head> <body> <script language="javascript" type="text/javascript"> objTreeMenu_1 = new TreeMenu("imagesAlt2", "objTreeMenu_1", "_self", "treeMenuDefault", true, false); newNode = objTreeMenu_1.addItem(new TreeNode('Collectibles', null, null, false, true, '', '', null)); newNode_1 = newNode.addItem(new TreeNode('Advertising', null, null, false, true, '', '', null)); newNode_1_1 = newNode_1.addItem(new TreeNode('Soda', null, null, false, true, '', '', null)); newNode_1_1_1 = newNode_1_1.addItem(new TreeNode('Fountain', null, null, false, true, '', '', null)); newNode_1_1_2 = newNode_1_1.addItem(new TreeNode('Canada Dry', null, null, false, true, '', '', null)); newNode_1_1_3 = newNode_1_1.addItem(new TreeNode('7 UP', null, null, false, true, '', '', null)); newNode_1_1_4 = newNode_1_1.addItem(new TreeNode('Squirt', null, null, false, true, '', '', null)); newNode_1_1_5 = newNode_1_1.addItem(new TreeNode('Hires Root Beer', null, null, false, true, '', '', null)); newNode_1_1_6 = newNode_1_1.addItem(new TreeNode('Dr. Pepper', null, null, false, true, '', '', null)); . . . . . newNode_2 = newNode.addItem(new TreeNode('Comics', null, null, false, true, '', '', null)); newNode_2_1 = newNode_2.addItem(new TreeNode('Other Comics', null, null, false, true, '', '', null)); newNode_2_2 = newNode_2.addItem(new TreeNode('Platinum Age (1897-1937)', null, null, false, true, '', '', null)); newNode_2_3 = newNode_2.addItem(new TreeNode('Golden Age (1938-55)', null, null, false, true, '', '', null)); newNode_2_3_1 = newNode_2_3.addItem(new TreeNode('Other Golden Age', null, null, false, true, '', '', null)); . . . i think this isn't ok and so far then i have to stopped (run's over 10 minutes and over 150 MB system-memory and over 90 percent system-processing) objTreeMenu_1.drawMenu(); objTreeMenu_1.writeOutput(); objTreeMenu_1.resetBranches(); </script></body> </html> could any please help thank's a lot for any help best regards Achim

« previous php.pear.general (#15415) next »