Base class for a generic PHP5 IMAP client library. This code is derived from the IMAP library used in Hastymail2 (www.hastymail.org) and is covered by the same license restrictions (GPL2)
| Methods | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
protected
|
parse_line(string $line, int $current_size, int $max, int $line_length): array
break up a "line" response from imap. If we find
a literal we read ahead on the stream and include it.
break up a "line" response from imap. If we find a literal we read ahead on the stream and include it. Parameters
Returnsa line continuation marker and the parsed data from the IMAP server |
# | ||||||||
protected
|
fgets(int $len = false): string
wrapper around fgets using $this->handle
wrapper around fgets using $this->handle Parameters
Returnsdata read from the IMAP server |
# | ||||||||
public
|
get_response(int $max = false, bool $chunked = false, int $line_length = 8192, bool $sort = false): array
loop through "lines" returned from imap and parse them with parse_line() and read_literal.
it can return the lines in a…
loop through "lines" returned from imap and parse them with parse_line() and read_literal. it can return the lines in a raw format, or parsed into atoms. It also supports a maximum number of lines to return, in case we did something stupid like list a loaded unix homedir used by scram lib, so keep it public Parameters
Returnsof parsed or raw results |
# | ||||||||
public
|
send_command(mixed $command, bool $no_prefix = false): void
put a prefix on a command and send it to the server
used by scram lib, so keep it public
put a prefix on a command and send it to the server used by scram lib, so keep it public Parameters
|
# | ||||||||
protected
|
check_response(array $data, bool $chunked = false, $log_failures = true): bool
determine if an imap response returned an "OK", returns true or false
determine if an imap response returned an "OK", returns true or false Parameters
Returnstrue to indicate a success response from the IMAP server |
# | ||||||||
protected
|
utf7_decode(string $string): encoded
convert UTF-7 encoded forlder names to UTF-8
convert UTF-7 encoded forlder names to UTF-8 Parameters
Returnsmailbox |
# | ||||||||
protected
|
utf7_encode(string $string): decoded
convert UTF-8 encoded forlder names to UTF-7
convert UTF-8 encoded forlder names to UTF-7 Parameters
Returnsmailbox |
# | ||||||||
protected
|
input_validate(string $val, string $type): bool
type checks
type checks Parameters
Returnstrue if the type check passed |
# | ||||||||
protected
|
is_clean($val, $type)
|
# | ||||||||
protected
|
apply_config(array $config): void
overwrite defaults with supplied config array
overwrite defaults with supplied config array Parameters
|
# | ||||||||
| Properties | |||
|---|---|---|---|
public
|
|
$cached_response = false
|
# |
public
|
|
$supported_extensions = []
|
# |
protected
|
|
$handle = false
|
# |
protected
|
|
$debug = []
|
# |
protected
|
|
$commands = []
|
# |
protected
|
|
$responses = []
|
# |
protected
|
|
$current_command = false
|
# |
protected
|
|
$max_read = false
|
# |
protected
|
|
$command_count = 0
|
# |
protected
|
|
$cache_data = []
|
# |
protected
|
|
$enabled_extensions = []
|
# |
protected
|
|
$capability = false
|
# |
protected
|
|
$server_id = []
|
# |
protected
|
|
$literal_overflow = false
|
# |
public
|
|
$struct_object = false
|
# |
protected
|
|
$config = [
'server',
'port',
'tls',
'read_only',
'utf7_folders',
'auth',
'search_charset',
'sort_speedup',
'folder_max',
'use_cache',
'max_history',
'blacklisted_extensions',
'app_name',
'app_version',
'app_vendor',
'app_support_url',
'cache_limit',
'no_caps',
]
|
# |
protected
|
|
$client_extensions = [
'SORT',
'COMPRESS',
'NAMESPACE',
'CONDSTORE',
'ENABLE',
'QRESYNC',
'MOVE',
'SPECIAL-USE',
'LIST-STATUS',
'UNSELECT',
'ID',
'X-GM-EXT-1',
'ESEARCH',
'ESORT',
'QUOTA',
'LIST-EXTENDED',
]
|
# |
protected
|
|
$declared_extensions = ['CONDSTORE', 'QRESYNC']
|
# |