From: Reini U. <ru...@x-...> - 2004-11-20 09:14:29
|
Charles Corrigan schrieb: > Hi, me again... > > The lib/plugin/WantedPages.php plugin does not work correctly. There are > three separate problems, I only know how to fix two of them. > > 1 - in lib/plugin/WantedPages.php, function _iterateLinks, the line > $links_iter = $page_handle->getLinks($reversed = false); > Must be changed to > $links_iter = $page_handle->getLinks($reversed = false, > $include_empty=true); Oh god. Who wrote this? It's completely wrong. Thanks for detecting this! But your fixes are wrong. :) $arg = false declares an optional arguemnt with the default argument false. but you may not use it in function calls, just declarations! if used in a call it's a temporary assignment. getLinks($reversed = false) sets $reversed to false, and calls it with false. No error in this case, but nevertheless wrong. > I have just started php - it looks to me like this syntax is actually > declaring additional variables - adding to the memory load. Maybe it should > be > $links_iter = $page_handle->getLinks(false, true); yes, like this. but we have now more descriptive names for the reverse part. $page_handle->getPageLinks(true) > 2 - in lib/WikiDB.php, function getLinks, the line > $result = $backend->get_links($this->_pagename, $reversed, > $include_empty=false); > Must be changed to > $result = $backend->get_links($this->_pagename, $reversed, $include_empty); Oh God! Cut&Paste programming! This was my fault. Good catches! > 3 - the limit parameter, I think, is meant to be the number of missing pages > to find. However, as actually used, it is the number of pages to search for > the links to missing pages. I do not know how to fix this - as a work > around, I edited WantedPages and added limit=10000 Well, limit'ing getAllPages() was needed for sf.net 8MB memory problems. But you are right that only the output should be limit'ed, not an internal list. I'll think about this how it can be enhanced better. Here and esp. in the sql backends to reduce the number queries. The number of SQL queries are our major time bottleneck. But caching queries clashes with memory problems on 8MB systems ... -- There is nobody so irritating as somebody with less intelligence and more sense than we have. (Don Herold) |