This is a convenient way to avoid spreading if (isset(... all over the code
mixed
asearch_nz
( &$var, [mixed $def = ''], mixed $var)
-
mixed
$var: any variable (reference)
-
mixed
$def: default value to return if unset (default is zls (''), pass 0 or array() when appropriate)
-
&$var
asearch_unhtmlentities (line
146)
This should give the same results as PHP 4 >= 4.3.0's html_entity_decode(),
except it doesn't handle hex constructs
string
asearch_unhtmlentities
(string $string)
-
string
$string: string to unhtmlentity()
sqimap_array_merge_unique (line
285)
Another way to do array_values(array_unique(array_merge($to, $from)));
array
sqimap_array_merge_unique
( &$to, array $from, array $to)
-
array
$to: to array (reference)
-
array
$from: from array
-
&$to
sqimap_asearch (line
408)
Create the search query strings for all given criteria and merge results for every mailbox
array
sqimap_asearch
(resource $imapConnection, &$mailbox_array, &$biop_array, &$unop_array, &$where_array, &$what_array, &$exclude_array, &$sub_array, &$mboxes_array, array $mailbox_array, array $biop_array, array $unop_array, array $where_array, array $what_array, array $exclude_array, array $sub_array, array $mboxes_array)
-
resource
$imapConnection
-
array
$mailbox_array: (reference)
-
array
$biop_array: (reference)
-
array
$unop_array: (reference)
-
array
$where_array: (reference)
-
array
$what_array: (reference)
-
array
$exclude_array: (reference)
-
array
$sub_array: (reference)
-
array
$mboxes_array: selectable unformatted mailboxes names (reference)
-
&$mailbox_array
-
&$biop_array
-
&$unop_array
-
&$where_array
-
&$what_array
-
&$exclude_array
-
&$sub_array
-
&$mboxes_array
sqimap_asearch_build_criteria (line
226)
Build one criteria sequence
string
sqimap_asearch_build_criteria
(string $opcode, string $what, string $charset)
-
string
$opcode: search opcode
-
string
$what: opcode argument
-
string
$charset: search charset
sqimap_asearch_encode_string (line
168)
Encode a string to quoted or literal as defined in rfc 3501
- 4.3 String:
A quoted string is a sequence of zero or more 7-bit characters,
excluding CR and LF, with double quote (<">) characters at each end.
- 9. Formal Syntax:
quoted-specials = DQUOTE / "\"
string
sqimap_asearch_encode_string
(string $what, string $charset)
-
string
$what: string to encode
-
string
$charset: search charset used
sqimap_asearch_error_box (line
102)
Function to display an error related to an IMAP query.
We need to do our own error management since we may receive NO responses on purpose (even BAD with SORT or THREAD) so we call sqimap_error_box() if the function exists (sm >= 1.5) or use our own embedded code
void
sqimap_asearch_error_box
(string $response, string $query, string $message, [string $link = ''])
-
string
$response: the imap server response code
-
string
$query: the failed query
-
string
$message: an optional error message
-
string
$link: an optional link to try again
sqimap_asearch_get_charset (line
344)
string
sqimap_asearch_get_charset
()
sqimap_asearch_get_sort_criteria (line
364)
Convert SquirrelMail internal sort to IMAP sort taking care of:
- user defined date sorting (ARRIVAL vs DATE)
- if the searched mailbox is the sent folder then TO is being used instead of FROM
- reverse order by using REVERSE
string
sqimap_asearch_get_sort_criteria
(string $mailbox, integer $sort_by)
-
string
$mailbox: mailbox name to sort
-
integer
$sort_by: sm sort criteria index
sqimap_asearch_get_sub_mailboxes (line
384)
array
sqimap_asearch_get_sub_mailboxes
(string $cur_mailbox, &$mboxes_array, array $boxes_unformatted)
-
string
$cur_mailbox: unformatted mailbox name
-
array
$boxes_unformatted: selectable mailbox unformatted names array (reference)
-
&$mboxes_array
sqimap_asearch_parse_date (line
188)
Parses a user date string into an rfc 3501 date string
Handles space, slash, backslash, dot and comma as separators (and dash of course ;=)
array
sqimap_asearch_parse_date
(string $what)
sqimap_run_search (line
306)
Run the IMAP SEARCH command as defined in rfc 3501
array
sqimap_run_search
(resource $imapConnection, string $search_string, string $search_charset)
-
resource
$imapConnection: the current imap stream
-
string
$search_string: the full search expression eg "ALL RECENT"
-
string
$search_charset: charset to use or zls ('')