diff options
Diffstat (limited to 'ext/imap')
-rw-r--r-- | ext/imap/php_imap.c | 380 | ||||
-rw-r--r-- | ext/imap/php_imap.h | 6 | ||||
-rw-r--r-- | ext/imap/php_imap.stub.php | 359 | ||||
-rw-r--r-- | ext/imap/php_imap_arginfo.h | 323 | ||||
-rw-r--r-- | ext/imap/tests/bug63126.phpt | 2 | ||||
-rw-r--r-- | ext/imap/tests/bug75774.phpt | 8 | ||||
-rw-r--r-- | ext/imap/tests/bug77020.phpt | 2 | ||||
-rw-r--r-- | ext/imap/tests/imap_close_variation3.phpt | 47 | ||||
-rw-r--r-- | ext/imap/tests/imap_fetch_overview_variation4.phpt | 46 | ||||
-rw-r--r-- | ext/imap/tests/imap_fetchbody_variation5.phpt | 46 | ||||
-rw-r--r-- | ext/imap/tests/imap_fetchheader_variation4.phpt | 45 | ||||
-rw-r--r-- | ext/imap/tests/imap_mutf7_to_utf8.phpt | 4 | ||||
-rw-r--r-- | ext/imap/tests/imap_utf8.phpt | 4 | ||||
-rw-r--r-- | ext/imap/tests/imap_utf8_to_mutf7_basic.phpt | 4 |
14 files changed, 698 insertions, 578 deletions
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index b5f12f6eee..f39687dbfa 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | @@ -46,6 +44,7 @@ #undef ERROR #endif #include "php_imap.h" +#include "php_imap_arginfo.h" #include <time.h> #include <stdio.h> @@ -97,373 +96,6 @@ void *fs_get(size_t size); ZEND_DECLARE_MODULE_GLOBALS(imap) static PHP_GINIT_FUNCTION(imap); -/* {{{ arginfo */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_open, 0, 0, 3) - ZEND_ARG_INFO(0, mailbox) - ZEND_ARG_INFO(0, user) - ZEND_ARG_INFO(0, password) - ZEND_ARG_INFO(0, options) - ZEND_ARG_INFO(0, n_retries) - ZEND_ARG_INFO(0, params) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_reopen, 0, 0, 2) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, mailbox) - ZEND_ARG_INFO(0, options) - ZEND_ARG_INFO(0, n_retries) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_append, 0, 0, 3) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, folder) - ZEND_ARG_INFO(0, message) - ZEND_ARG_INFO(0, options) - ZEND_ARG_INFO(0, date) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_num_msg, 0, 0, 1) - ZEND_ARG_INFO(0, stream_id) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_ping, 0, 0, 1) - ZEND_ARG_INFO(0, stream_id) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_num_recent, 0, 0, 1) - ZEND_ARG_INFO(0, stream_id) -ZEND_END_ARG_INFO() - -#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001) -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_get_quota, 0, 0, 2) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, qroot) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_get_quotaroot, 0, 0, 2) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, mbox) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_set_quota, 0, 0, 3) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, qroot) - ZEND_ARG_INFO(0, mailbox_size) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_setacl, 0, 0, 4) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, mailbox) - ZEND_ARG_INFO(0, id) - ZEND_ARG_INFO(0, rights) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_getacl, 0, 0, 2) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, mailbox) -ZEND_END_ARG_INFO() -#endif - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_expunge, 0, 0, 1) - ZEND_ARG_INFO(0, stream_id) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_gc, 0, 0, 1) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, flags) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_close, 0, 0, 1) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, options) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_headers, 0, 0, 1) - ZEND_ARG_INFO(0, stream_id) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_body, 0, 0, 2) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, msg_no) - ZEND_ARG_INFO(0, options) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_mail_copy, 0, 0, 3) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, msglist) - ZEND_ARG_INFO(0, mailbox) - ZEND_ARG_INFO(0, options) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_mail_move, 0, 0, 3) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, sequence) - ZEND_ARG_INFO(0, mailbox) - ZEND_ARG_INFO(0, options) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_createmailbox, 0, 0, 2) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, mailbox) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_renamemailbox, 0, 0, 3) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, old_name) - ZEND_ARG_INFO(0, new_name) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_deletemailbox, 0, 0, 2) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, mailbox) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_list, 0, 0, 3) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, ref) - ZEND_ARG_INFO(0, pattern) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_getmailboxes, 0, 0, 3) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, ref) - ZEND_ARG_INFO(0, pattern) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_listscan, 0, 0, 4) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, ref) - ZEND_ARG_INFO(0, pattern) - ZEND_ARG_INFO(0, content) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_check, 0, 0, 1) - ZEND_ARG_INFO(0, stream_id) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_delete, 0, 0, 2) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, msg_no) - ZEND_ARG_INFO(0, options) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_undelete, 0, 0, 2) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, msg_no) - ZEND_ARG_INFO(0, flags) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_headerinfo, 0, 0, 2) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, msg_no) - ZEND_ARG_INFO(0, from_length) - ZEND_ARG_INFO(0, subject_length) - ZEND_ARG_INFO(0, default_host) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_rfc822_parse_headers, 0, 0, 1) - ZEND_ARG_INFO(0, headers) - ZEND_ARG_INFO(0, default_host) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_lsub, 0, 0, 3) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, ref) - ZEND_ARG_INFO(0, pattern) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_getsubscribed, 0, 0, 3) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, ref) - ZEND_ARG_INFO(0, pattern) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_subscribe, 0, 0, 2) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, mailbox) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_unsubscribe, 0, 0, 2) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, mailbox) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_fetchstructure, 0, 0, 2) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, msg_no) - ZEND_ARG_INFO(0, options) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_fetchbody, 0, 0, 3) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, msg_no) - ZEND_ARG_INFO(0, section) - ZEND_ARG_INFO(0, options) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_savebody, 0, 0, 3) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, file) - ZEND_ARG_INFO(0, msg_no) - ZEND_ARG_INFO(0, section) - ZEND_ARG_INFO(0, options) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_base64, 0, 0, 1) - ZEND_ARG_INFO(0, text) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_qprint, 0, 0, 1) - ZEND_ARG_INFO(0, text) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_8bit, 0, 0, 1) - ZEND_ARG_INFO(0, text) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_binary, 0, 0, 1) - ZEND_ARG_INFO(0, text) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_mailboxmsginfo, 0, 0, 1) - ZEND_ARG_INFO(0, stream_id) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_rfc822_write_address, 0, 0, 3) - ZEND_ARG_INFO(0, mailbox) - ZEND_ARG_INFO(0, host) - ZEND_ARG_INFO(0, personal) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_rfc822_parse_adrlist, 0, 0, 2) - ZEND_ARG_INFO(0, address_string) - ZEND_ARG_INFO(0, default_host) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_utf8, 0, 0, 1) - ZEND_ARG_INFO(0, mime_encoded_text) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_utf7_decode, 0, 0, 1) - ZEND_ARG_INFO(0, buf) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_utf7_encode, 0, 0, 1) - ZEND_ARG_INFO(0, buf) -ZEND_END_ARG_INFO() - -#ifdef HAVE_IMAP_MUTF7 -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_utf8_to_mutf7, 0, 0, 1) - ZEND_ARG_INFO(0, in) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_mutf7_to_utf8, 0, 0, 1) - ZEND_ARG_INFO(0, in) -ZEND_END_ARG_INFO() -#endif - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_setflag_full, 0, 0, 3) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, sequence) - ZEND_ARG_INFO(0, flag) - ZEND_ARG_INFO(0, options) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_clearflag_full, 0, 0, 3) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, sequence) - ZEND_ARG_INFO(0, flag) - ZEND_ARG_INFO(0, options) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_sort, 0, 0, 3) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, criteria) - ZEND_ARG_INFO(0, reverse) - ZEND_ARG_INFO(0, options) - ZEND_ARG_INFO(0, search_criteria) - ZEND_ARG_INFO(0, charset) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_fetchheader, 0, 0, 2) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, msg_no) - ZEND_ARG_INFO(0, options) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_uid, 0, 0, 2) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, msg_no) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_msgno, 0, 0, 2) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, unique_msg_id) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_status, 0, 0, 3) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, mailbox) - ZEND_ARG_INFO(0, options) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_bodystruct, 0, 0, 3) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, msg_no) - ZEND_ARG_INFO(0, section) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_fetch_overview, 0, 0, 2) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, sequence) - ZEND_ARG_INFO(0, options) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_mail_compose, 0, 0, 2) - ZEND_ARG_INFO(0, envelope) - ZEND_ARG_INFO(0, body) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_mail, 0, 0, 3) - ZEND_ARG_INFO(0, to) - ZEND_ARG_INFO(0, subject) - ZEND_ARG_INFO(0, message) - ZEND_ARG_INFO(0, additional_headers) - ZEND_ARG_INFO(0, cc) - ZEND_ARG_INFO(0, bcc) - ZEND_ARG_INFO(0, rpath) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_search, 0, 0, 2) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, criteria) - ZEND_ARG_INFO(0, options) - ZEND_ARG_INFO(0, charset) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO(arginfo_imap_alerts, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO(arginfo_imap_errors, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO(arginfo_imap_last_error, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_mime_header_decode, 0, 0, 1) - ZEND_ARG_INFO(0, str) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_thread, 0, 0, 1) - ZEND_ARG_INFO(0, stream_id) - ZEND_ARG_INFO(0, options) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_timeout, 0, 0, 1) - ZEND_ARG_INFO(0, timeout_type) - ZEND_ARG_INFO(0, timeout) -ZEND_END_ARG_INFO() -/* }}} */ /* {{{ imap_functions[] */ @@ -481,7 +113,7 @@ static const zend_function_entry imap_functions[] = { PHP_FE(imap_body, arginfo_imap_body) PHP_FE(imap_bodystruct, arginfo_imap_bodystruct) PHP_FE(imap_fetchbody, arginfo_imap_fetchbody) - PHP_FE(imap_fetchmime, arginfo_imap_fetchbody) + PHP_FE(imap_fetchmime, arginfo_imap_fetchmime) PHP_FE(imap_savebody, arginfo_imap_savebody) PHP_FE(imap_fetchheader, arginfo_imap_fetchheader) PHP_FE(imap_fetchstructure, arginfo_imap_fetchstructure) @@ -539,13 +171,13 @@ static const zend_function_entry imap_functions[] = { #endif PHP_FE(imap_mail, arginfo_imap_mail) + PHP_FE(imap_getsubscribed, arginfo_imap_getsubscribed) + PHP_FE(imap_getmailboxes, arginfo_imap_getmailboxes) PHP_FALIAS(imap_header, imap_headerinfo, arginfo_imap_headerinfo) PHP_FALIAS(imap_listmailbox, imap_list, arginfo_imap_list) - PHP_FALIAS(imap_getmailboxes, imap_list_full, arginfo_imap_getmailboxes) PHP_FALIAS(imap_scanmailbox, imap_listscan, arginfo_imap_listscan) PHP_FALIAS(imap_listsubscribed, imap_lsub, arginfo_imap_lsub) - PHP_FALIAS(imap_getsubscribed, imap_lsub_full, arginfo_imap_getsubscribed) PHP_FALIAS(imap_fetchtext, imap_body, arginfo_imap_body) PHP_FALIAS(imap_scan, imap_listscan, arginfo_imap_listscan) PHP_FALIAS(imap_create, imap_createmailbox, arginfo_imap_createmailbox) @@ -1926,7 +1558,7 @@ PHP_FUNCTION(imap_list) /* {{{ proto array imap_getmailboxes(resource stream_id, string ref, string pattern) Reads the list of mailboxes and returns a full array of objects containing name, attributes, and delimiter */ /* Author: CJH */ -PHP_FUNCTION(imap_list_full) +PHP_FUNCTION(imap_getmailboxes) { zval *streamind, mboxob; zend_string *ref, *pat; @@ -2246,7 +1878,7 @@ PHP_FUNCTION(imap_lsub) /* {{{ proto array imap_getsubscribed(resource stream_id, string ref, string pattern) Return a list of subscribed mailboxes, in the same format as imap_getmailboxes() */ /* Author: CJH */ -PHP_FUNCTION(imap_lsub_full) +PHP_FUNCTION(imap_getsubscribed) { zval *streamind, mboxob; zend_string *ref, *pat; diff --git a/ext/imap/php_imap.h b/ext/imap/php_imap.h index c23799976c..2019998942 100644 --- a/ext/imap/php_imap.h +++ b/ext/imap/php_imap.h @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | @@ -163,10 +161,10 @@ PHP_FUNCTION(imap_fetchtext); PHP_FUNCTION(imap_uid); PHP_FUNCTION(imap_msgno); PHP_FUNCTION(imap_list); -PHP_FUNCTION(imap_list_full); +PHP_FUNCTION(imap_getmailboxes); PHP_FUNCTION(imap_listscan); PHP_FUNCTION(imap_lsub); -PHP_FUNCTION(imap_lsub_full); +PHP_FUNCTION(imap_getsubscribed); PHP_FUNCTION(imap_create); PHP_FUNCTION(imap_rename); PHP_FUNCTION(imap_status); diff --git a/ext/imap/php_imap.stub.php b/ext/imap/php_imap.stub.php new file mode 100644 index 0000000000..ab3a24b54d --- /dev/null +++ b/ext/imap/php_imap.stub.php @@ -0,0 +1,359 @@ +<?php + +/** + * @return resource|false + */ +function imap_open(string $mailbox, string $user, string $password, int $options = 0, int $n_retries = 0, array $params = UNKNOWN) {} + +/** + * @param resource $stream_id + */ +function imap_reopen($stream_id, string $mailbox, int $options = 0, int $n_retries = 0): bool {} + +/** + * @param resource $stream_id + */ +function imap_close($stream_id, int $options = 0): bool {} + +/** + * @param resource $stream_id + * @return int|false + */ +function imap_num_msg($stream_id) {} + +/** + * @param resource $stream_id + * @return int|false + */ +function imap_num_recent($stream_id) {} + +/** + * @param resource $stream_id + * @return array|false + */ +function imap_headers($stream_id) {} + +/** + * @param resource $stream_id + * @return \stdClass|false + */ +function imap_headerinfo($stream_id, int $msg_no, int $from_length = 0, int $subject_length = 0, string $default_host = UNKNOWN) {} + +function imap_rfc822_parse_headers(string $headers, string $default_host = 'UNKNOWN'): \stdClass {} + +/** + * @return string|false + */ +function imap_rfc822_write_address(string $mailbox, string $host, string $personal) {} + +function imap_rfc822_parse_adrlist(string $address_string, string $default_host): array {} + + +/** + * @param resource $stream_id + * @return string|false + */ +function imap_body($stream_id, int $msg_no, int $options = 0) {} + + +/** + * @param resource $stream_id + * @return \stdClass|false + */ +function imap_bodystruct($stream_id, int $msg_no, string $section) {} + +/** + * @param resource $stream_id + * @return string|false + */ +function imap_fetchbody($stream_id, int $msg_no, string $section, int $options = 0) {} + +/** + * @param resource $stream_id + * @return string|false + */ +function imap_fetchmime($stream_id, int $msg_no, string $section, int $options = 0) {} + + +/** + * @param resource $stream_id + * @todo: should $file be `resouce|string`? it looks like it tries to accept anything? + */ +function imap_savebody($stream_id, $file, int $msg_no, string $section = '', int $options = 0): bool {} + +/** + * @param resource $stream_id + * @return string|false + */ +function imap_fetchheader($stream_id, int $msg_no, int $options = 0) {} + +/** + * @param resource $stream_id + * @return \stdClass|false + */ +function imap_fetchstructure($stream_id, int $msg_no, int $options = 0) {} + +/** + * @param resource $stream_id + */ +function imap_gc($stream_id, int $flags): bool {} + +/** + * @param resource $stream_id + */ +function imap_expunge($stream_id): bool {} + +/** + * @param resource $stream_id + */ +function imap_delete($stream_id, string $msg_no, int $options = 0): bool {} + +/** + * @param resource $stream_id + */ +function imap_undelete($stream_id, string $msg_no, int $options = 0): bool {} + +/** + * @param resource $stream_id + * @return \stdClass|false + */ +function imap_check($stream_id) {} + +/** + * @param resource $stream_id + * @return array|false + */ +function imap_listscan($stream_id, string $ref, string $pattern, string $content) {} + +/** + * @param resource $stream_id + */ +function imap_mail_copy($stream_id, string $msglist, string $mailbox, int $options = 0): bool {} + +/** + * @param resource $stream_id + */ +function imap_mail_move($stream_id, string $sequence, string $mailbox, int $options = 0): bool {} + +/** + * @return string|false + */ +function imap_mail_compose(array $envelope, array $body) {} + +/** + * @param resource $stream_id + */ +function imap_createmailbox($stream_id, string $mailbox): bool {} + +/** + * @param resource $stream_id + */ +function imap_renamemailbox($stream_id, string $old_name, string $new_name): bool {} + +/** + * @param resource $stream_id + */ +function imap_deletemailbox($stream_id, string $mailbox): bool {} + +/** + * @param resource $stream_id + */ +function imap_subscribe($stream_id, string $mailbox): bool {} + +/** + * @param resource $stream_id + */ +function imap_unsubscribe($stream_id, string $mailbox): bool {} + +/** + * @param resource $stream_id + */ +function imap_append($stream_id, string $folder, string $message, string $options = UNKNOWN, string $internal_date = UNKNOWN): bool {} + +/** + * @param resource $stream_id + */ +function imap_ping($stream_id): bool {} + +/** + * @return string|false + */ +function imap_base64(string $text) {} + +/** + * @return string|false + */ +function imap_qprint(string $text) {} + +/** + * @return string|false + */ +function imap_8bit(string $text) {} + +/** + * @return string|false + */ +function imap_binary(string $text) {} + + +function imap_utf8(string $mime_encoded_text): string {} + +/** + * @param resource $stream_id + * @return \stdClass|false + */ +function imap_status($stream_id, string $mailbox, int $options) {} + +/** + * @param resource $stream_id + */ +function imap_mailboxmsginfo($stream_id): \stdClass {} + +/** + * @param resource $stream_id + */ +function imap_setflag_full($stream_id, string $sequence, string $flag, int $options = 0): bool {} + +/** + * @param resource $stream_id + */ +function imap_clearflag_full($stream_id, string $sequence, string $flag, int $options = 0): bool {} + +/** + * @param resource $stream_id + * @return array|false + */ +function imap_sort($stream_id, int $criteria, int $reverse, int $options = 0, string $search_criteria = UNKNOWN, string $charset = UNKNOWN) {} + + +/** + * @param resource $stream_id + * @return int|false + */ +function imap_uid($stream_id, int $msg_no) {} + +/** + * @param resource $stream_id + * @return int|false + */ +function imap_msgno($stream_id, int $unique_msg_id) {} + +/** + * @param resource $stream_id + * @return array|false + */ +function imap_list($stream_id, string $ref, string $pattern) {} + +/** + * @param resource $stream_id + * @return array|false + */ +function imap_lsub($stream_id, string $ref, string $pattern) {} + +/** + * @param resource $stream_id + * @return array|false + */ +function imap_getsubscribed($stream_id, string $ref, string $pattern) {} + +/** + * @param resource $stream_id + * @return array|false + */ +function imap_getmailboxes($stream_id, string $ref, string $pattern) {} + +/** + * @param resource $stream_id + * @return array|false + */ +function imap_fetch_overview($stream_id, string $sequence, int $options = 0) {} + +/** + * @return array|false + */ +function imap_alerts() {} + +/** + * @return array|false + */ +function imap_errors() {} + +/** + * @return string|false + */ +function imap_last_error() {} + + +/** + * @param resource $stream_id + * @return array|false + */ +function imap_search($stream_id, string $criteria, int $options = \SE_FREE, string $charset = '') {} + +/** + * @return string|false + */ +function imap_utf7_decode(string $buf) {} + +function imap_utf7_encode(string $buf): string {} + +#ifdef HAVE_IMAP_MUTF7 +/** + * @return string|false + */ +function imap_utf8_to_mutf7(string $in) {} + +/** + * @return string|false + */ +function imap_mutf7_to_utf8(string $in) {} +#endif + +/** + * @return array|false + */ +function imap_mime_header_decode(string $str) {} + + +/** + * @param resource $stream_id + * @return array|false + */ +function imap_thread($stream_id, int $options = \SE_FREE) {} + +/** + * @return int|bool + */ +function imap_timeout(int $timeout_type, int $timeout = -1) {} + +#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001) +/** + * @param resource $stream_id + * @return array|false + */ +function imap_get_quota($stream_id, string $qroot) {} + +/** + * @param resource $stream_id + * @return array|false + */ +function imap_get_quotaroot($stream_id, string $mbox) {} + +/** + * @param resource $stream_id + */ +function imap_set_quota($stream_id, string $qroot, int $mailbox_size): bool {} + +/** + * @param resource $stream_id + */ +function imap_setacl($stream_id, string $mailbox, string $id, string $rights): bool {} + +/** + * @param resource $stream_id + * @return array|false + */ +function imap_getacl($stream_id, string $mailbox) {} +#endif + +function imap_mail(string $to, string $subject, string $message, string $additional_headers = UNKNOWN, string $cc = UNKNOWN, string $bcc = UNKNOWN, string $rpath = UNKNOWN): bool {} diff --git a/ext/imap/php_imap_arginfo.h b/ext/imap/php_imap_arginfo.h new file mode 100644 index 0000000000..b39e445758 --- /dev/null +++ b/ext/imap/php_imap_arginfo.h @@ -0,0 +1,323 @@ +/* This is a generated file, edit the .stub.php file instead. */ + +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_open, 0, 0, 3) + ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, user, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, n_retries, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, params, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_reopen, 0, 2, _IS_BOOL, 0) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, n_retries, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_close, 0, 1, _IS_BOOL, 0) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_num_msg, 0, 0, 1) + ZEND_ARG_INFO(0, stream_id) +ZEND_END_ARG_INFO() + +#define arginfo_imap_num_recent arginfo_imap_num_msg + +#define arginfo_imap_headers arginfo_imap_num_msg + +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_headerinfo, 0, 0, 2) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, msg_no, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, from_length, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, subject_length, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, default_host, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_imap_rfc822_parse_headers, 0, 1, stdClass, 0) + ZEND_ARG_TYPE_INFO(0, headers, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, default_host, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_rfc822_write_address, 0, 0, 3) + ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, personal, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_rfc822_parse_adrlist, 0, 2, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, address_string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, default_host, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_body, 0, 0, 2) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, msg_no, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_bodystruct, 0, 0, 3) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, msg_no, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, section, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_fetchbody, 0, 0, 3) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, msg_no, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, section, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) +ZEND_END_ARG_INFO() + +#define arginfo_imap_fetchmime arginfo_imap_fetchbody + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_savebody, 0, 3, _IS_BOOL, 0) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_INFO(0, file) + ZEND_ARG_TYPE_INFO(0, msg_no, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, section, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) +ZEND_END_ARG_INFO() + +#define arginfo_imap_fetchheader arginfo_imap_body + +#define arginfo_imap_fetchstructure arginfo_imap_body + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_gc, 0, 2, _IS_BOOL, 0) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_expunge, 0, 1, _IS_BOOL, 0) + ZEND_ARG_INFO(0, stream_id) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_delete, 0, 2, _IS_BOOL, 0) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, msg_no, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) +ZEND_END_ARG_INFO() + +#define arginfo_imap_undelete arginfo_imap_delete + +#define arginfo_imap_check arginfo_imap_num_msg + +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_listscan, 0, 0, 4) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, ref, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_mail_copy, 0, 3, _IS_BOOL, 0) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, msglist, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_mail_move, 0, 3, _IS_BOOL, 0) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, sequence, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_mail_compose, 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, envelope, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, body, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_createmailbox, 0, 2, _IS_BOOL, 0) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_renamemailbox, 0, 3, _IS_BOOL, 0) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, old_name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, new_name, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_imap_deletemailbox arginfo_imap_createmailbox + +#define arginfo_imap_subscribe arginfo_imap_createmailbox + +#define arginfo_imap_unsubscribe arginfo_imap_createmailbox + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_append, 0, 3, _IS_BOOL, 0) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, folder, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, options, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, internal_date, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_imap_ping arginfo_imap_expunge + +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_base64, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_imap_qprint arginfo_imap_base64 + +#define arginfo_imap_8bit arginfo_imap_base64 + +#define arginfo_imap_binary arginfo_imap_base64 + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_utf8, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, mime_encoded_text, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_status, 0, 0, 3) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_imap_mailboxmsginfo, 0, 1, stdClass, 0) + ZEND_ARG_INFO(0, stream_id) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_setflag_full, 0, 3, _IS_BOOL, 0) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, sequence, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, flag, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) +ZEND_END_ARG_INFO() + +#define arginfo_imap_clearflag_full arginfo_imap_setflag_full + +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_sort, 0, 0, 3) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, criteria, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, reverse, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, search_criteria, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, charset, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_uid, 0, 0, 2) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, msg_no, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_msgno, 0, 0, 2) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, unique_msg_id, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_list, 0, 0, 3) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, ref, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_imap_lsub arginfo_imap_list + +#define arginfo_imap_getsubscribed arginfo_imap_list + +#define arginfo_imap_getmailboxes arginfo_imap_list + +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_fetch_overview, 0, 0, 2) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, sequence, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_alerts, 0, 0, 0) +ZEND_END_ARG_INFO() + +#define arginfo_imap_errors arginfo_imap_alerts + +#define arginfo_imap_last_error arginfo_imap_alerts + +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_search, 0, 0, 2) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, criteria, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, charset, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_utf7_decode, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, buf, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_utf7_encode, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, buf, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#if defined(HAVE_IMAP_MUTF7) +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_utf8_to_mutf7, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, in, IS_STRING, 0) +ZEND_END_ARG_INFO() +#endif + +#if defined(HAVE_IMAP_MUTF7) +#define arginfo_imap_mutf7_to_utf8 arginfo_imap_utf8_to_mutf7 +#endif + +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_mime_header_decode, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_thread, 0, 0, 1) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_timeout, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, timeout_type, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, timeout, IS_LONG, 0) +ZEND_END_ARG_INFO() + +#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001) +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_get_quota, 0, 0, 2) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, qroot, IS_STRING, 0) +ZEND_END_ARG_INFO() +#endif + +#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001) +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_get_quotaroot, 0, 0, 2) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, mbox, IS_STRING, 0) +ZEND_END_ARG_INFO() +#endif + +#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_set_quota, 0, 3, _IS_BOOL, 0) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, qroot, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, mailbox_size, IS_LONG, 0) +ZEND_END_ARG_INFO() +#endif + +#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_setacl, 0, 4, _IS_BOOL, 0) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, id, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, rights, IS_STRING, 0) +ZEND_END_ARG_INFO() +#endif + +#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001) +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_getacl, 0, 0, 2) + ZEND_ARG_INFO(0, stream_id) + ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0) +ZEND_END_ARG_INFO() +#endif + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_mail, 0, 3, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, subject, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, additional_headers, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, cc, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, bcc, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, rpath, IS_STRING, 0) +ZEND_END_ARG_INFO() diff --git a/ext/imap/tests/bug63126.phpt b/ext/imap/tests/bug63126.phpt index 94c618730c..8eea34cf1d 100644 --- a/ext/imap/tests/bug63126.phpt +++ b/ext/imap/tests/bug63126.phpt @@ -6,7 +6,7 @@ extension_loaded('imap') or die('skip imap extension not available in this build require_once(__DIR__.'/imap_include.inc'); -$in = imap_open($default_mailbox, $username, $password, OP_HALFOPEN, 1); +$in = @imap_open($default_mailbox, $username, $password, OP_HALFOPEN, 1); if (!$in) { die("skip could not connect to mailbox $default_mailbox"); } diff --git a/ext/imap/tests/bug75774.phpt b/ext/imap/tests/bug75774.phpt index ba08ab0439..0d2aeadf01 100644 --- a/ext/imap/tests/bug75774.phpt +++ b/ext/imap/tests/bug75774.phpt @@ -10,7 +10,11 @@ extension_loaded('imap') or die('skip imap extension not available in this build $fn = __DIR__ . DIRECTORY_SEPARATOR . "foo75774"; $var1=fopen($fn, "w"); -imap_append($var1, "", "", "", ""); +try { + imap_append($var1, "", "", "", ""); +} catch (Throwable $e) { + echo "\nException: " . $e->getMessage() . "\n"; +} fclose($var1); unlink($fn); @@ -20,5 +24,5 @@ unlink($fn); --EXPECTF-- Warning: imap_append(): internal date not correctly formatted in %s on line %d -Warning: imap_append(): supplied resource is not a valid imap resource in %s on line %d +Exception: imap_append(): supplied resource is not a valid imap resource ==DONE== diff --git a/ext/imap/tests/bug77020.phpt b/ext/imap/tests/bug77020.phpt index 8a65232eec..357b75333a 100644 --- a/ext/imap/tests/bug77020.phpt +++ b/ext/imap/tests/bug77020.phpt @@ -11,5 +11,5 @@ imap_mail('1', 1, NULL); ===DONE=== --EXPECTF-- Warning: imap_mail(): No message string in mail command in %s on line %d -%s +%A ===DONE=== diff --git a/ext/imap/tests/imap_close_variation3.phpt b/ext/imap/tests/imap_close_variation3.phpt deleted file mode 100644 index d282ba1dfd..0000000000 --- a/ext/imap/tests/imap_close_variation3.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Test imap_close() function : usage variations - different streams ---SKIPIF-- -<?php -extension_loaded('imap') or die('skip imap extension not available in this build'); -?> ---FILE-- -<?php -/* Prototype : bool imap_close(resource $stream_id [, int $options]) - * Description: Close an IMAP stream - * Source code: ext/imap/php_imap.c - */ - -/* - * Pass different stream types to imap_close() to test whether it can close them - */ - -echo "*** Testing imap_close() : usage variations ***\n"; - -echo "\n-- File Resource opened with fopen() --\n"; -var_dump($file_handle = fopen(__FILE__, 'r')); -var_dump(imap_close($file_handle)); -var_dump($file_handle); - -echo "\n-- Directory Resource opened with opendir() --\n"; -var_dump($dir_handle = opendir(__DIR__)); -var_dump(imap_close($dir_handle)); -var_dump($dir_handle); -?> -===DONE=== ---EXPECTF-- -*** Testing imap_close() : usage variations *** - --- File Resource opened with fopen() -- -resource(%d) of type (stream) - -Warning: imap_close(): supplied resource is not a valid imap resource in %s on line %d -bool(false) -resource(%d) of type (stream) - --- Directory Resource opened with opendir() -- -resource(%d) of type (stream) - -Warning: imap_close(): supplied resource is not a valid imap resource in %s on line %d -bool(false) -resource(%d) of type (stream) -===DONE=== diff --git a/ext/imap/tests/imap_fetch_overview_variation4.phpt b/ext/imap/tests/imap_fetch_overview_variation4.phpt deleted file mode 100644 index 2aa89b75b6..0000000000 --- a/ext/imap/tests/imap_fetch_overview_variation4.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test imap_fetch_overview() function : usage variations - different resources as $stream_id ---SKIPIF-- -<?php -extension_loaded('imap') or die('skip imap extension not available in this build'); -?> ---FILE-- -<?php -/* Prototype : array imap_fetch_overview(resource $stream_id, int $msg_no [, int $options]) - * Description: Read an overview of the information in the headers - * of the given message sequence - * Source code: ext/imap/php_imap.c - */ - -/* - * Pass different resource types to imap_fetch_overview() to test behaviour - */ - -echo "*** Testing imap_fetch_overview() : usage variations ***\n"; - -echo "\n-- File Resource opened with fopen() --\n"; -var_dump($file_pointer = fopen(__FILE__, 'r+')); -var_dump(imap_fetch_overview($file_pointer, 1)); -fclose($file_pointer); - -echo "\n-- Directory Resource opened with opendir() --\n"; -var_dump($dir_handle = opendir(__DIR__)); -var_dump(imap_fetch_overview($dir_handle, 1)); -closedir($dir_handle); -?> -===DONE=== ---EXPECTF-- -*** Testing imap_fetch_overview() : usage variations *** - --- File Resource opened with fopen() -- -resource(%d) of type (stream) - -Warning: imap_fetch_overview(): supplied resource is not a valid imap resource in %s on line %d -bool(false) - --- Directory Resource opened with opendir() -- -resource(%d) of type (stream) - -Warning: imap_fetch_overview(): supplied resource is not a valid imap resource in %s on line %d -bool(false) -===DONE=== diff --git a/ext/imap/tests/imap_fetchbody_variation5.phpt b/ext/imap/tests/imap_fetchbody_variation5.phpt deleted file mode 100644 index fa32d0e995..0000000000 --- a/ext/imap/tests/imap_fetchbody_variation5.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test imap_fetchbody() function : usage variation - different resources as $stream_id arg ---SKIPIF-- -<?php -extension_loaded('imap') or die('skip imap extension not available in this build'); -?> ---FILE-- -<?php -/* Prototype : string imap_fetchbody(resource $stream_id, int $msg_no, string $section - * [, int options]) - * Description: Get a specific body section - * Source code: ext/imap/php_imap.c - */ - -/* - * Pass different resource types to imap_fetchbody() to test behaviour - */ - -echo "*** Testing imap_fetchbody() : usage variations ***\n"; - -echo "\n-- File Resource opened with fopen() --\n"; -var_dump($file_pointer = fopen(__FILE__, 'r+')); -var_dump(imap_fetchbody($file_pointer, 1)); -fclose($file_pointer); - -echo "\n-- Directory Resource opened with opendir() --\n"; -var_dump($dir_handle = opendir(__DIR__)); -var_dump(imap_fetchbody($dir_handle, 1)); -closedir($dir_handle); -?> -===DONE=== ---EXPECTF-- -*** Testing imap_fetchbody() : usage variations *** - --- File Resource opened with fopen() -- -resource(5) of type (stream) - -Warning: imap_fetchbody() expects at least 3 parameters, 2 given in %s on line %d -NULL - --- Directory Resource opened with opendir() -- -resource(6) of type (stream) - -Warning: imap_fetchbody() expects at least 3 parameters, 2 given in %s on line %d -NULL -===DONE=== diff --git a/ext/imap/tests/imap_fetchheader_variation4.phpt b/ext/imap/tests/imap_fetchheader_variation4.phpt deleted file mode 100644 index 05322f1527..0000000000 --- a/ext/imap/tests/imap_fetchheader_variation4.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Test imap_fetchheader() function : usage variations - diff resource types as $stream_id ---SKIPIF-- -<?php -extension_loaded('imap') or die('skip imap extension not available in this build'); -?> ---FILE-- -<?php -/* Prototype : string imap_fetchheader(resource $stream_id, int $msg_no [, int $options]) - * Description: Get the full unfiltered header for a message - * Source code: ext/imap/php_imap.c - */ - -/* - * Pass different types of resources to imap_fetchheader() to test behaviour - */ - -echo "*** Testing imap_fetchheader() : usage variations ***\n"; - -echo "\n-- File Resource opened with fopen() --\n"; -var_dump($file_pointer = fopen(__FILE__, 'r+')); -var_dump(imap_fetchheader($file_pointer, 1)); -fclose($file_pointer); - -echo "\n-- Directory Resource opened with opendir() --\n"; -var_dump($dir_handle = opendir(__DIR__)); -var_dump(imap_fetchheader($dir_handle, 1)); -closedir($dir_handle); -?> -===DONE=== ---EXPECTF-- -*** Testing imap_fetchheader() : usage variations *** - --- File Resource opened with fopen() -- -resource(%d) of type (stream) - -Warning: imap_fetchheader(): supplied resource is not a valid imap resource in %s on line %d -bool(false) - --- Directory Resource opened with opendir() -- -resource(%d) of type (stream) - -Warning: imap_fetchheader(): supplied resource is not a valid imap resource in %s on line %d -bool(false) -===DONE=== diff --git a/ext/imap/tests/imap_mutf7_to_utf8.phpt b/ext/imap/tests/imap_mutf7_to_utf8.phpt index e2c745ecd0..d8bda0c6a9 100644 --- a/ext/imap/tests/imap_mutf7_to_utf8.phpt +++ b/ext/imap/tests/imap_mutf7_to_utf8.phpt @@ -8,7 +8,6 @@ imap_mutf7_to_utf8 var_dump(imap_mutf7_to_utf8("")); var_dump(imap_mutf7_to_utf8(1)); -var_dump(imap_mutf7_to_utf8(array(1,2))); var_dump(imap_mutf7_to_utf8("t&AOQ-st")); echo "Done\n"; @@ -16,8 +15,5 @@ echo "Done\n"; --EXPECTF-- string(0) "" string(1) "1" - -Warning: imap_mutf7_to_utf8() expects parameter 1 to be string, array given in %s on line %d -NULL string(5) "täst" Done diff --git a/ext/imap/tests/imap_utf8.phpt b/ext/imap/tests/imap_utf8.phpt index a8901555d5..a82c3721c3 100644 --- a/ext/imap/tests/imap_utf8.phpt +++ b/ext/imap/tests/imap_utf8.phpt @@ -7,7 +7,6 @@ imap_utf8() tests var_dump(imap_utf8("")); var_dump(imap_utf8(1)); -var_dump(imap_utf8(array(1,2))); var_dump(imap_utf8("test")); echo "Done\n"; @@ -15,8 +14,5 @@ echo "Done\n"; --EXPECTF-- string(0) "" string(1) "1" - -Warning: imap_utf8() expects parameter 1 to be string, array given in %s on line %d -NULL string(4) "%s" Done diff --git a/ext/imap/tests/imap_utf8_to_mutf7_basic.phpt b/ext/imap/tests/imap_utf8_to_mutf7_basic.phpt index bea268a457..6046dc1c5f 100644 --- a/ext/imap/tests/imap_utf8_to_mutf7_basic.phpt +++ b/ext/imap/tests/imap_utf8_to_mutf7_basic.phpt @@ -8,7 +8,6 @@ imap_utf8_to_mutf7 var_dump(imap_utf8_to_mutf7("")); var_dump(imap_utf8_to_mutf7(1)); -var_dump(imap_utf8_to_mutf7(array(1,2))); var_dump(imap_utf8_to_mutf7("täst")); echo "Done\n"; @@ -16,8 +15,5 @@ echo "Done\n"; --EXPECTF-- string(0) "" string(1) "1" - -Warning: imap_utf8_to_mutf7() expects parameter 1 to be string, array given in %s on line %d -NULL string(8) "t&AOQ-st" Done |