Net_Sieve
[ class tree: Net_Sieve ] [ index: Net_Sieve ] [ all elements ]

Class: Net_Sieve

Source Location: /Net_Sieve-1.3.2/Sieve.php

Class Overview


A class for talking to the timsieved server which comes with Cyrus IMAP.


Author(s):

Version:

  • Release: 1.3.2

Copyright:

  • 2006-2008 Anish Mistry

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 93]
A class for talking to the timsieved server which comes with Cyrus IMAP.


[ Top ]


Class Variables

$supportedAuthMethods = array('DIGEST-MD5', 'CRAM-MD5', 'EXTERNAL',
                                      'PLAIN' , 'LOGIN')

[line 102]

The authentication methods this class supports.

Can be overwritten if having problems with certain methods.


Type:   array


[ Top ]

$supportedSASLAuthMethods = array('DIGEST-MD5', 'CRAM-MD5')

[line 110]

SASL authentication methods that require Auth_SASL.

Type:   array


[ Top ]



Method Detail

Net_Sieve (Constructor)   [line 209]

Net_Sieve Net_Sieve( [string $user = null], [string $pass = null], [string $host = 'localhost'], [string $port = 2000], [string $logintype = ''], [string $euser = ''], [boolean $debug = false], [string $bypassAuth = false], [boolean $useTLS = true], [array $options = null], [mixed $handler = null])

Constructor.

Sets up the object, connects to the server and logs in. Stores any generated error in $this->_error, which can be retrieved using the getError() method.


Parameters:

string   $user     Login username.
string   $pass     Login password.
string   $host     Hostname of server.
string   $port     Port of server.
string   $logintype     Type of login to perform (see $supportedAuthMethods).
string   $euser     Effective user. If authenticating as an administrator, login as this user.
boolean   $debug     Whether to enable debugging (@see setDebug()).
string   $bypassAuth     Skip the authentication phase. Useful if the socket is already open.
boolean   $useTLS     Use TLS if available.
array   $options     Additional options for stream_context_create().
mixed   $handler     A callback handler for the debug output.

[ Top ]

connect   [line 297]

boolean connect( string $host, string $port, [array $options = null], [boolean $useTLS = true])

Handles connecting to the server and checks the response validity.
  • Return: True on success, PEAR_Error otherwise.

Parameters:

string   $host     Hostname of server.
string   $port     Port of server.
array   $options     List of options to pass to stream_context_create().
boolean   $useTLS     Use TLS if available.

[ Top ]

disconnect   [line 351]

boolean disconnect( [boolean $sendLogoutCMD = true])

Disconnect from the Sieve server.
  • Return: True on success, PEAR_Error otherwise.

Parameters:

boolean   $sendLogoutCMD     Whether to send LOGOUT command before disconnecting.

[ Top ]

getActive   [line 409]

string getActive( )

Returns the active script.
  • Return: The active scriptname.

[ Top ]

getAuthMechs   [line 542]

array getAuthMechs( )

Returns the list of authentication methods the server supports.
  • Return: List of authentication methods or PEAR_Error on failure.

[ Top ]

getError   [line 249]

boolean|PEAR_Error getError( )

Returns any error that may have been generated in the constructor.
  • Return: False if no error, PEAR_Error otherwise.

[ Top ]

getExtensions   [line 503]

array getExtensions( )

Returns the list of extensions the server supports.
  • Return: List of extensions or PEAR_Error on failure.

[ Top ]

getScript   [line 439]

string getScript( string $scriptname)

Retrieves a script.
  • Return: The script on success, PEAR_Error on failure.

Parameters:

string   $scriptname     The name of the script to be retrieved.

[ Top ]

hasAuthMech   [line 558]

boolean hasAuthMech( string $method)

Returns whether the server supports an authentication method.
  • Return: Whether the method is supported or PEAR_Error on failure.

Parameters:

string   $method     The method to check.

[ Top ]

hasExtension   [line 519]

boolean hasExtension( string $extension)

Returns whether the server supports an extension.
  • Return: Whether the extension is supported or PEAR_Error on failure.

Parameters:

string   $extension     The extension to check.

[ Top ]

haveSpace   [line 486]

boolean|PEAR_Error haveSpace( string $scriptname, integer $size)

Checks if the server has space to store the script by the server.
  • Return: True if there is space, PEAR_Error otherwise.
  • Todo: Rename to hasSpace()

Parameters:

string   $scriptname     The name of the script to mark as active.
integer   $size     The size of the script.

[ Top ]

installScript   [line 453]

boolean installScript( string $scriptname, string $script, [boolean $makeactive = false])

Adds a script to the server.
  • Return: True on success, PEAR_Error on failure.

Parameters:

string   $scriptname     Name of the script.
string   $script     The script content.
boolean   $makeactive     Whether to make this the active script.

[ Top ]

listScripts   [line 394]

array listScripts( )

Returns an indexed array of scripts currently on the server.
  • Return: Indexed array of scriptnames.

[ Top ]

login   [line 367]

boolean login( string $user, string $pass, [string $logintype = null], [string $euser = ''], [boolean $bypassAuth = false])

Logs into server.
  • Return: True on success, PEAR_Error otherwise.

Parameters:

string   $user     Login username.
string   $pass     Login password.
string   $logintype     Type of login method to use.
string   $euser     Effective UID (perform on behalf of $euser).
boolean   $bypassAuth     Do not perform authentication.

[ Top ]

removeScript   [line 471]

boolean removeScript( string $scriptname)

Removes a script from the server.
  • Return: True on success, PEAR_Error on failure.

Parameters:

string   $scriptname     Name of the script.

[ Top ]

setActive   [line 427]

boolean setActive( string $scriptname)

Sets the active script.
  • Return: True on success, PEAR_Error on failure.

Parameters:

string   $scriptname     The name of the script to be set as active.

[ Top ]

setDebug   [line 262]

void setDebug( [boolean $debug = true], [string $handler = null])

Sets the debug state and handler function.

Parameters:

boolean   $debug     Whether to enable debugging.
string   $handler     A custom debug handler. Must be a valid callback.

[ Top ]


Documentation generated on Sat, 06 Aug 2011 22:30:03 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.