[dev] [patch] sizelimit in turba sql driver.
Matthieu Foillard
mgf at iota-online.com
Fri May 16 03:14:55 PDT 2003
This patch add sizelimit just like the ldap driver do.
It maybe needs some corrections since i'm still not very familiar w/ horde
dev.
This patch will allow me to begin the work on the turba paging.
Regards,
mgf
Index: lib/Driver/sql.php
===================================================================
RCS file: /repository/turba/lib/Driver/sql.php,v
retrieving revision 1.32
diff -u -3 -p -r1.32 sql.php
--- lib/Driver/sql.php 25 Apr 2003 03:13:44 -0000 1.32
+++ lib/Driver/sql.php 16 May 2003 10:11:49 -0000
@@ -117,6 +117,13 @@ class Turba_Driver_sql extends Turba_Dri
$query .= 'FROM ' . $this->_table;
$query .= $where;
+ /* Add a sizelimit, if specified. Default is 0, which means no limit.
*/
+ $sizelimit = 0;
+ if (!empty($this->params['sizelimit'])) {
+ $sizelimit = $this->params['sizelimit'];
+ $query = $this->_db->modifyLimitQuery($query, 0, $sizelimit);
+ }
+
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('SQL search by %s: table = %s; query =
"%s"',
Auth::getAuth(), $this->_table, $query),
More information about the dev
mailing list