From b866305a858769ef59a1bdad5e98096d108886a0 Mon Sep 17 00:00:00 2001 From: rurban Date: Thu, 8 Jul 2004 17:31:43 +0000 Subject: [PATCH] improve numPages for file (fixing AllPagesTest) git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@3881 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/WikiDB.php | 10 +++++++--- lib/WikiDB/backend/file.php | 10 +++++++++- lib/plugin/AllPages.php | 16 +++++++++++++--- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/lib/WikiDB.php b/lib/WikiDB.php index 0b208bbcf..9e443b478 100644 --- a/lib/WikiDB.php +++ b/lib/WikiDB.php @@ -1,5 +1,5 @@ _backend,'numPages')) - $count = $this->_backend->numPages($filter,$exclude); + if (method_exists($this->_backend, 'numPages')) + $count = $this->_backend->numPages($filter, $exclude); else { $iter = $this->getAllPages(); $count = $iter->count(); + $iter->free(); } return (int)$count; } @@ -1891,6 +1892,9 @@ class WikiDB_cache }; // $Log: not supported by cvs2svn $ +// Revision 1.75 2004/07/05 13:56:22 rurban +// sqlite autoincrement fix +// // Revision 1.74 2004/07/03 16:51:05 rurban // optional DBADMIN_USER:DBADMIN_PASSWD for action=upgrade (if no ALTER permission) // added atomic mysql REPLACE for PearDB as in ADODB diff --git a/lib/WikiDB/backend/file.php b/lib/WikiDB/backend/file.php index ea671ce50..183d84948 100644 --- a/lib/WikiDB/backend/file.php +++ b/lib/WikiDB/backend/file.php @@ -1,5 +1,5 @@ _loadLatestVersions(); + return count($this->_latest_versions); + } /** * Title or full text search. @@ -781,6 +786,9 @@ class WikiDB_backend_file_iter extends WikiDB_backend_iterator } // $Log: not supported by cvs2svn $ +// Revision 1.13 2004/07/08 15:23:59 rurban +// less verbose for tests +// // Revision 1.12 2004/07/08 13:50:32 rurban // various unit test fixes: print error backtrace on _DEBUG_TRACE; allusers fix; new PHPWIKI_NOMAIN constant for omitting the mainloop // diff --git a/lib/plugin/AllPages.php b/lib/plugin/AllPages.php index 2ce79d00a..cab3be7a4 100644 --- a/lib/plugin/AllPages.php +++ b/lib/plugin/AllPages.php @@ -1,5 +1,5 @@