Class IMP_Folder

Description

The IMP_Folder:: class provides a set of methods for dealing with folders, accounting for subscription, errors, etc.

$Horde: imp/lib/Folder.php,v 1.130.10.49 2009/01/06 15:24:03 jan Exp $

Copyright 2000-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 /lib/Folder.php (line 17)


	
			
Variable Summary
 array $_listCache
Method Summary
 void clearFlistCache ()
 boolean create (string $folder, boolean $subscribe)
 boolean delete (array $folder_array, [boolean $force = false])
 boolean exists (string $folder)
 array flist ([boolean $sub = false], [array $filter = array()])
 array flist_IMP ([array $filter = array()], [boolean $sub = null])
 string &generateMbox (array $folder_list, [boolean $recursive = false])
 mixed importMbox (string $folder, string $mbox)
 boolean rename (string $old, string $new, [boolean $force = false])
 boolean subscribe (array $folder_array)
 boolean unsubscribe (array $folder_array)
Variables
array $_listCache = array() (line 25)

Keep around identical lists so that we don't hit the server more that once in the same page for the same thing.

Methods
clearFlistCache (line 154)

Clears the flist folder cache.

  • since: IMP 4.2
void clearFlistCache ()
create (line 259)

Create a new IMAP folder if it does not already exist, and subcribe to it as well if requested.

  • return: Whether or not the folder was successfully created.
boolean create (string $folder, boolean $subscribe)
  • string $folder: The full utf encoded folder to be created.
  • boolean $subscribe: A boolean describing whether or not to use folder subscriptions.
delete (line 176)

Deletes one or more folders.

  • return: Whether or not the folders were successfully deleted.
boolean delete (array $folder_array, [boolean $force = false])
  • array $folder_array: An array of full utf encoded folder names to be deleted.
  • boolean $force: Delete folders even if they are fixed.
exists (line 330)

Finds out if a specific folder exists or not.

  • return: Whether or not the folder exists.
boolean exists (string $folder)
  • string $folder: The full utf encoded folder name to be checked.
flist (line 64)

Lists folders.

  • return: An array of folders, where each array alement is an associative array containing three values: 'val', with entire folder name after the server specification; 'label', with the full-length folder name meant for display and 'abbrev', containing a shortened (26 characters max) label for display in situations where space is short.
array flist ([boolean $sub = false], [array $filter = array()])
  • boolean $sub: Should we list only subscribed folders?
  • array $filter: An list of mailboxes that should be left out of the list.
flist_IMP (line 144)

Returns an array of folders. This is a wrapper around the flist() function which reduces the number of arguments needed if we can assume that IMP's full environment is present.

  • return: The array of mailboxes returned by flist().
array flist_IMP ([array $filter = array()], [boolean $sub = null])
  • array $filter: An array of mailboxes to ignore.
  • boolean $sub: If set, will be used to determine if we should list only subscribed folders.
generateMbox (line 518)

Generates a string that can be saved out to an mbox format mailbox file for a folder or set of folders, optionally including all subfolders of the selected folders as well. All folders will be put into the same string.

string &generateMbox (array $folder_list, [boolean $recursive = false])
  • array $folder_list: A list of full utf encoded folder names to generate an mbox file for.
  • boolean $recursive: Include subfolders?
importMbox (line 559)

Imports messages into a given folder from a mbox format mailbox file.

  • return: False (boolean) on fail or the number of messages imported (integer) on success.
mixed importMbox (string $folder, string $mbox)
  • string $folder: The folder to put the messages into.
  • string $mbox: String containing the mbox filename.
rename (line 354)

Renames an IMAP folder. The subscription status remains the same. All subfolders will also be renamed.

  • return: Whether or not all folder(s) were successfully renamed.
boolean rename (string $old, string $new, [boolean $force = false])
  • string $old: The old utf encoded folder name.
  • string $new: The new utf encoded folder name.
  • boolean $force: Rename folders even if they are fixed.
singleton (line 38)

Returns a reference to the global IMP_Folder object, only creating it if it doesn't already exist. This ensures that only one IMP_Folder instance is instantiated for any given session.

This method must be invoked as:

  1.    $imp_folder &IMP_Folder::singleton();

  • return: The IMP_Folder instance.
IMP_Folder &singleton ()
subscribe (line 415)

Subscribes to one or more IMAP folders.

  • return: Whether or not the folders were successfully subscribed to.
boolean subscribe (array $folder_array)
  • array $folder_array: An array of full utf encoded folder names to be subscribed.
unsubscribe (line 463)

Unsubscribes from one or more IMAP folders.

  • return: Whether or not the folders were successfully unsubscribed from.
boolean unsubscribe (array $folder_array)
  • array $folder_array: An array of full utf encoded folder names to be unsubscribed.

Documentation generated on Sun, 30 Jan 2011 05:28:11 +0000 by phpDocumentor 1.4.3