Update of /cvsroot/phpwiki/phpwiki/lib
In directory usw-pr-cvs1:/tmp/cvs-serv25218/lib
Modified Files:
TextSearchQuery.php
Log Message:
New convenience class NullTextSearchQuery: a TextSearchQuery
which doesn't match anything.
Index: TextSearchQuery.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/TextSearchQuery.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** TextSearchQuery.php 2001/11/21 19:48:15 1.2
--- TextSearchQuery.php 2001/12/16 19:35:12 1.3
***************
*** 171,174 ****
--- 171,191 ----
}
+ /**
+ * This is a TextSearchQuery which matches nothing.
+ */
+ class NullTextSearchQuery extends TextSearchQuery {
+ /**
+ * Create a new query.
+ *
+ * @see TextSearchQuery
+ */
+ function NullTextSearchQuery() {}
+ function asRegexp() { return '/^(?!a)a/x'; }
+ function match($string) { return false; }
+ function getHighlightRegexp() { return ""; }
+ function makeSqlClause($make_sql_clause_cb) { return "(1 = 0)"; }
+ function asString() { return "NullTextSearchQuery"; }
+ };
+
////////////////////////////////////////////////////////////////
|