![]() |
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patch imap_capability.patch for IMAP related Bug #38712Patch version 2013-04-02 08:19 UTC Return to Bug #38712 | Download this patchThis patch renders other patches obsolete Obsolete patches: Patch Revisions: 2013-04-02 08:19 UTC | 2013-03-28 13:26 UTCDeveloper: michael.radzewitz@freenet-ag.dediff -urN php5-5.3.3.org/ext/imap/php_imap.c php5-5.3.3/ext/imap/php_imap.c --- php5-5.3.3.org/ext/imap/php_imap.c 2013-03-28 12:58:32.000000000 +0100 +++ php5-5.3.3/ext/imap/php_imap.c 2013-03-28 14:12:16.768737662 +0100 @@ -530,6 +530,7 @@ PHP_FE(imap_thread, arginfo_imap_thread) PHP_FE(imap_timeout, arginfo_imap_timeout) + PHP_FE(imap_capability, arginfo_imap_open) #if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001) PHP_FE(imap_get_quota, arginfo_imap_get_quota) PHP_FE(imap_get_quotaroot, arginfo_imap_get_quotaroot) @@ -4762,6 +4763,70 @@ +++ php5-5.3.3/ext/imap/php_imap.c 2013-04-02 09:58:23.192768860 +0200 @@ -464,6 +464,11 @@ ZEND_ARG_INFO(0, timeout_type) ZEND_ARG_INFO(0, timeout) ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_capability, 0, 0, 1) + ZEND_ARG_INFO(0, stream_id) +ZEND_END_ARG_INFO() + /* }}} */ /* {{{ imap_functions[] @@ -550,6 +555,9 @@ PHP_FALIAS(imap_scan, imap_listscan, arginfo_imap_listscan) PHP_FALIAS(imap_create, imap_createmailbox, arginfo_imap_createmailbox) PHP_FALIAS(imap_rename, imap_renamemailbox, arginfo_imap_renamemailbox) + + PHP_FE(imap_capability, arginfo_imap_capability) + {NULL, NULL, NULL} }; /* }}} */ @@ -3840,6 +3848,67 @@ } /* }}} */ + +/* {{{ proto mixed imap_capability(stream) + Fetch imap capability record as requested in: https://bugs.php.net/bug.php?id=38712 */ +PHP_FUNCTION(imap_capability) + { + + if ( zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &streamind) == FAILURE ) + { + return ; + } + + } + + ZEND_FETCH_RESOURCE(imap_le_struct, pils *, &streamind, -1, "imap", le_imap) ; + + IMAPCAP *m = imap_cap ( imap_le_struct->imap_stream ) ; + IMAPCAP *m = imap_cap(imap_le_struct->imap_stream) ; + + if ( !m ) + { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "c-client imap_cap failed"); + zval_dtor(return_value); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "c-client imap_cap failed") ; + zval_dtor(return_value) ; + RETURN_FALSE ; + } + else + { + object_init(return_value); + object_init(return_value) ; + + add_property_long(return_value, "rfc1176", m->rfc1176 ) ; + add_property_long(return_value, "imap2bis", m->imap2bis ) ; + add_property_long(return_value, "imap4", m->imap4 ) ; Line 74 (now 87), was 20 lines, now 19 lines + + } +/* }}} */ + + + #define GETS_FETCH_SIZE 8196LU static char *php_mail_gets(readfn_t f, void *stream, unsigned long size, GETS_DATA *md) /* {{{ */ { /* {{{ _php_imap_mail */ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *cc, char *bcc, char* rpath TSRMLS_DC) diff -urN php5-5.3.3.org/ext/imap/php_imap.h php5-5.3.3/ext/imap/php_imap.h --- php5-5.3.3.org/ext/imap/php_imap.h 2013-03-28 12:58:32.000000000 +0100 +++ php5-5.3.3/ext/imap/php_imap.h 2013-03-28 14:12:16.825250292 +0100 @@ -173,6 +173,7 @@ PHP_FUNCTION(imap_thread); PHP_FUNCTION(imap_timeout); +++ php5-5.3.3/ext/imap/php_imap.h 2013-04-02 09:58:23.244768418 +0200 @@ -181,6 +181,8 @@ PHP_FUNCTION(imap_getacl); #endif +PHP_FUNCTION(imap_capability); #if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001) PHP_FUNCTION(imap_get_quota); PHP_FUNCTION(imap_get_quotaroot); + ZEND_BEGIN_MODULE_GLOBALS(imap) char *imap_user; |
![]() All rights reserved. |
Last updated: Sat Feb 08 04:01:29 2025 UTC |