From 70cd7184e9bc43f77f7cc2201ef1098237ff42cb Mon Sep 17 00:00:00 2001 From: rurban Date: Wed, 14 Sep 2005 05:59:03 +0000 Subject: [PATCH] optimized explodePageList to use SQL when available (titleSearch instead of getAllPages) git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@4835 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/PageList.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/PageList.php b/lib/PageList.php index c4478fa1a..b841466af 100644 --- a/lib/PageList.php +++ b/lib/PageList.php @@ -1,4 +1,4 @@ -getDbh(); - // $dbi->titleSearch($input); + $iter = $dbi->titleSearch($search, $sortby, $limit, $exclude); + $pages = array(); + while ($pagehandle = $iter->next()) { + $pages[] = $pagehandle->getName(); + } + return $pages; + /* //TODO: need an SQL optimization here $allPagehandles = $dbi->getAllPages($include_empty, $sortby, $limit, $exclude); @@ -828,9 +836,10 @@ class PageList { $allPages[] = $pagehandle->getName(); } return explodeList($input, $allPages); + */ } else { //TODO: do the sorting, normally not needed if used for exclude only - return explode(',',$input); + return explode(',', $input); } } @@ -1475,6 +1484,9 @@ extends PageList { } // $Log: not supported by cvs2svn $ +// Revision 1.134 2005/09/11 14:55:05 rurban +// implement fulltext stoplist +// // Revision 1.133 2005/08/27 09:41:37 rurban // new helper method // -- 2.45.0