Class IMAP_Search

Description

The IMAP_Search:: class performs complex searching of an IMAP mailbox.

Classes to help with complex searching of an IMAP mailbox. The built-in PHP search() function only allows IMAPv2 search queries (see RFC 1176). This library allows more complex searches to be created (e.g. OR searches, searching specific headers).

$Horde: framework/IMAP/IMAP/Search.php,v 1.29.10.32 2009/01/06 15:23:11 jan Exp $

Copyright 2003-2009 The Horde Project (http://www.horde.org/)

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

Located in /IMAP/IMAP/Search.php (line 21)


	
			
Variable Summary
 string $_charset
 array $_headers
 array $_params
 array $_result
 integer $_searchflag
Method Summary
 IMAP_Search IMAP_Search ([array $params = array()])
 array searchMailbox (IMAP_Search_Query $query, resource $imap, string $mbox)
 array searchSortMailbox (IMAP_Search_Query $query, resource $imap, string $mbox, integer $sortby, [integer $sortdir = 0])
 IMAP_Search &singleton ([array $params = array()])
Variables
string $_charset (line 49)

The charset of the search values.

array $_headers = array() (line 28)

The headers cache.

array $_params = array() (line 42)

The paramater list.

array $_result = array() (line 35)

The results cache.

integer $_searchflag = 0 (line 56)

Internal flag used by searchMailbox().

Methods
Constructor IMAP_Search (line 91)

Constructor.

IMAP_Search IMAP_Search ([array $params = array()])
  • array $params: A hash containing the following entries:
                           'pop3' => boolean (using POP3 connection?)
                           'charset' => string (charset of search values)
                           'no_imap_search' => true if the IMAP server does
                                               not support the charset in
                                               the search command
searchMailbox (line 109)

Searches messages by ALL headers (rather than the limited set provided by imap_search()).

  • return: The list of indices that match the search rules in the current mailbox. Returns PEAR_Error on error.
array searchMailbox (IMAP_Search_Query $query, resource $imap, string $mbox)
  • IMAP_Search_Query $query: The search query.
  • resource $imap: An IMAP resource stream.
  • string $mbox: The name of the mailbox to search. For POP3, this should be empty.
searchSortMailbox (line 147)

Searches the mailbox and sorts the results.

  • return: The list of indices that match the search rules in the current mailbox and sorted. Returns PEAR_Error on error.
array searchSortMailbox (IMAP_Search_Query $query, resource $imap, string $mbox, integer $sortby, [integer $sortdir = 0])
  • IMAP_Search_Query $query: The search query.
  • resource $imap: An IMAP resource stream.
  • string $mbox: The name of the mailbox to search.
  • integer $sortby: The criteria to sort by (see imap_sort()).
  • integer $sortdir:
    1. for reverse sorting.
singleton (line 69)

Returns a reference to the global IMAP_Search object, only creating it if it doesn't already exist.

This method must be invoked as:

  1.    $imap_search &IMAP_Search::singleton();

  • return: The IMAP_Search instance.
IMAP_Search &singleton ([array $params = array()])
  • array $params: Any parameters the constructor may need.

Documentation generated on Sun, 30 Jan 2011 05:21:07 +0000 by phpDocumentor 1.4.3