[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/Horde/SQL/ -> Keywords.php (sommaire)

(pas de description)

Poids: 182 lignes (6 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

Horde_SQL_Keywords:: (5 méthodes):
  parse()
  _parseKeywords1()
  _parseKeywords2()
  _parseKeywords3()
  _parseKeywords4()


Classe: Horde_SQL_Keywords  - X-Ref

This class provides a parser which can construct an SQL WHERE
clause from a Google-like search expression.

$Horde: framework/SQL/SQL/Keywords.php,v 1.2.10.4 2006/01/01 21:28:33 jan Exp $

Copyright 2004-2006 Cronosys, LLC <http://www.cronosys.com/>

See the enclosed file COPYING for license information (LGPL).  If you
did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

The expression recognizes boolean "AND", "OR", and "NOT" (providing
no operator between keywords implies "AND"), like so:

cat and dog
cat or dog
cat and not dog

If no operator appears between keywords or quoted strings, "AND" is
assumed.  A comma can be used instead of "OR":

cat dog
cat, dog
cat not dog

The parser recognizes parentheses, so complex expressions can be
created:

cat and not (dog or puppy)

Quoted strings are also recognized, and are taken as literal
keywords:

"cat and dog"

Parsing is designed to be as fuzzy as possible, so it shouldn't
error unless people search for "AND", "OR", or "NOT" without
quoting it or use unbalanced parentheses.

parse($column, $expr)   X-Ref
Parse a keyword expression.

param: string $column        This is the SQL field name the resulting
param: string $expr          This is the keyword expression we want to
return: mixed the query expression or a PEAR_Error on failure.

_parseKeywords1($column, &$tokens)   X-Ref
Pas de description

_parseKeywords2($column, &$tokens)   X-Ref
Pas de description

_parseKeywords3($column, &$tokens)   X-Ref
Pas de description

_parseKeywords4($column, &$tokens)   X-Ref
Pas de description



Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7