[ Index ]
 

Code source de IMP H3 (4.1.5)

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/lib/IMAP/ -> Search.php (source)

   1  <?php
   2  
   3  require_once 'Horde/IMAP/Search.php';
   4  
   5  /**
   6   * The IMP_IMAP_Search:: class extends the IMAP_Search class in order to
   7   * provide necessary bug fixes to ensure backwards compatibility with Horde
   8   * 3.0.
   9   *
  10   * $Horde: imp/lib/IMAP/Search.php,v 1.5.2.2 2007/01/02 13:54:58 jan Exp $
  11   *
  12   * Copyright 2006-2007 Michael Slusarz <slusarz@horde.org>
  13   *
  14   * See the enclosed file COPYING for license information (GPL). If you did not
  15   * receive this file, see http://www.fsf.org/copyleft/gpl.html.
  16   *
  17   * @author  Michael Slusarz <slusarz@horde.org>
  18   * @since   IMP 4.1
  19   * @package Horde_IMAP
  20   */
  21  class IMP_IMAP_Search extends IMAP_Search {
  22  
  23      /**
  24       * Returns a reference to the global IMP_IMAP_Search object, only creating
  25       * it if it doesn't already exist.
  26       *
  27       * @see IMAP_Search::singleton()
  28       */
  29      function &singleton($params = array())
  30      {
  31          static $object;
  32  
  33          if (!isset($object)) {
  34              $object = new IMP_IMAP_Search($params);
  35          }
  36  
  37          return $object;
  38      }
  39  
  40      /**
  41       * Searches messages by ALL headers (rather than the limited set provided
  42       * by imap_search()).
  43       *
  44       * @see IMAP_Search::searchMailbox()
  45       */
  46      function searchMailbox($query, &$imap, $mbox)
  47      {
  48          /* Clear the search flag. */
  49          $this->_searchflag = 0;
  50  
  51          if ($_SESSION['imp']['base_protocol'] != 'pop3') {
  52              require_once  IMP_BASE . '/lib/IMAP.php';
  53              $imp_imap = &IMP_IMAP::singleton();
  54              if (!$imp_imap->changeMbox($mbox, OP_READONLY)) {
  55                  return array();
  56              }
  57          }
  58  
  59          return $this->_searchMailbox($query, $imap, $mbox);
  60      }
  61  
  62  }
  63  
  64  /**
  65   * The IMP_IMAP_Search_Query:: class extends the IMAP_Search_Query class in
  66   * order to provide necessary bug fixes to ensure backwards compatibility with
  67   * Horde 3.0.
  68   *
  69   * @author  Michael Slusarz <slusarz@horde.org>
  70   * @since   IMP 4.1
  71   * @package Horde_IMAP
  72   */
  73  class IMP_IMAP_Search_Query extends IMAP_Search_Query {
  74  
  75      /**
  76       * Builds the IMAP search query.
  77       */
  78      function build()
  79      {
  80          $search = parent::build();
  81          if (empty($search)) {
  82              if (!empty($this->_or)) {
  83                  return $search;
  84              }
  85              $search = new stdClass;
  86              $search->flags = null;
  87              $search->not = false;
  88              $search->fullquery = $search->query = 'ALL';
  89          }
  90          return $search;
  91      }
  92  }


Généré le : Thu Nov 29 12:30:07 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics