3 require_once 'lib/WikiDB/backend.php';
6 * This backlink iterator will work with any WikiDB_backend
7 * which has a working get_links(,'links_from') method.
9 * This is mostly here for testing, 'cause it's slow,slow,slow.
11 class WikiDB_backend_dumb_BackLinkIter
12 extends WikiDB_backend_iterator
14 function WikiDB_backend_dumb_BackLinkIter(&$backend, &$all_pages, $pagename) {
15 $this->_pages = $all_pages;
16 $this->_backend = &$backend;
17 $this->_target = $pagename;
21 while ($page = $this->_pages->next()) {
22 $pagename = $page['pagename'];
23 $links = $this->_backend->get_links($pagename, false);
24 while ($link = $links->next()) {
25 if ($link['pagename'] == $this->_target) {
34 $this->_pages->free();
42 // c-hanging-comment-ender-p: nil
43 // indent-tabs-mode: nil