Branch '2.3-stable' - php/kolab.patch php/Makefile php/patches
Git Service User
git at kolabsys.com
Tue Apr 5 16:29:43 CEST 2011
php/Makefile | 40 +-
php/kolab.patch | 77 ++--
php/patches/php-5.3.4/KOLAB_php-5.3.4_Annotations.patch | 303 ++++++++++++++++
php/patches/php-5.3.4/KOLAB_php-5.3.4_myrights.patch | 94 ++++
php/patches/php-5.3.4/series | 2
5 files changed, 484 insertions(+), 32 deletions(-)
New commits:
commit f5ce48fa16c6ed606c0c28f349c03bb3899f1869
Author: Christoph Wickert <cwickert at fedoraproject.org>
Date: Tue Apr 5 16:29:36 2011 +0200
php: update to 5.3.4
diff --git a/php/Makefile b/php/Makefile
index 68088a9..8d9ea1c 100644
--- a/php/Makefile
+++ b/php/Makefile
@@ -3,11 +3,23 @@ include ../make-helper/kolab.mk
PACKAGE=php
DOWNLOAD_VERSION=5.3.1
OPENPKG_RELEASE=20091129
-VERSION=5.3.3
-RELEASE=20091129_kolab3
+VERSION=5.3.4
+VERSION_SUHOSHIN_EXTENSION=0.9.32.1
+VERSION_SUHOSHIN_PATCH=5.3.4-0.9.10
+VERSION_MEMCACHE=2.2.6
+RELEASE=20101230_kolab1
SOURCE_URL=http://www.php.net/distributions
-SOURCE_0=php-5.3.3.tar.bz2
+SOURCE_1_URL=http://download.suhosin.org
+SOURCE_2_URL=http://pecl.php.net/get
+SOURCE_3_URL=http://download.suhosin.org
+SOURCE_0=php-$(VERSION).tar.bz2
+SOURCE_1=suhosin-$(VERSION_SUHOSHIN_EXTENSION).tar.gz
+SOURCE_2=memcache-$(VERSION_MEMCACHE).tgz
+SOURCE_3=suhosin-patch-$(VERSION_SUHOSHIN_PATCH).patch.gz
+
+SOURCES=$(SOURCE_0) $(SOURCE_1) $(SOURCE_2) $(SOURCE_3)
+RPM_SOURCES = $(KOLABRPMSRC)/$(PACKAGE)/$(SOURCE_0) $(KOLABRPMSRC)/$(PACKAGE)/$(SOURCE_1) $(KOLABRPMSRC)/$(PACKAGE)/$(SOURCE_2) $(KOLABRPMSRC)/$(PACKAGE)/$(SOURCE_3)
PATCHES=patches/php-$(VERSION)/KOLAB_php-$(VERSION)_Annotations.patch \
patches/php-$(VERSION)/KOLAB_php-$(VERSION)_myrights.patch \
@@ -24,6 +36,28 @@ BUILD_OPTIONS=--define 'with_imap_annotate yes' --define 'with_imap_myrights yes
--define 'with_simplexml yes' --define 'with_sqlite yes' --define 'with_spl yes' \
--define 'with_json yes' --define 'with_tokenizer yes'
+# Target for retrieving the second source package
+$(SOURCE_1):
+ wget -c "$(SOURCE_1_URL)/$(SOURCE_1)"
+
+# Target for retrieving the third source package
+$(SOURCE_2):
+ wget -c "$(SOURCE_2_URL)/$(SOURCE_2)"
+
+# Target for retrieving the fourth source package
+$(SOURCE_3):
+ wget -c "$(SOURCE_3_URL)/$(SOURCE_3)"
+
+# Target for the source files in the src rpm directory.
+$(KOLABRPMSRC)/$(PACKAGE)/$(SOURCE_1): $(KOLABRPMSRC)/$(PACKAGE) $(SOURCE_1)
+ cp $(SOURCE_1) $(KOLABRPMSRC)/$(PACKAGE)/
+
+$(KOLABRPMSRC)/$(PACKAGE)/$(SOURCE_2): $(KOLABRPMSRC)/$(PACKAGE) $(SOURCE_2)
+ cp $(SOURCE_2) $(KOLABRPMSRC)/$(PACKAGE)/
+
+$(KOLABRPMSRC)/$(PACKAGE)/$(SOURCE_3): $(KOLABRPMSRC)/$(PACKAGE) $(SOURCE_3)
+ cp $(SOURCE_3) $(KOLABRPMSRC)/$(PACKAGE)/
+
include ../make-helper/package.mk
include ../make-helper/openpkg-patched.mk
include ../make-helper/fetch.mk
diff --git a/php/kolab.patch b/php/kolab.patch
index 1e4fc81..f83a45b 100644
--- a/php/kolab.patch
+++ b/php/kolab.patch
@@ -1,47 +1,66 @@
-Index: php.spec
-===================================================================
-RCS file: /v/openpkg/cvs/openpkg-src/php/php.spec,v
-retrieving revision 1.183
-diff -u -B -r1.183 php.spec
---- php.spec 11 May 2008 08:31:26 -0000 1.183
-+++ php.spec 13 May 2008 14:58:33 -0000
-@@ -22,7 +22,7 @@
+--- php.orig/php.spec 2009-11-29 19:41:17.000000000 +0100
++++ php/php.spec 2011-01-11 09:44:34.819576367 +0100
+@@ -22,11 +22,11 @@
##
# package versions
-%define V_php 5.3.1
-+%define V_php 5.3.3
- %define V_php_suhosin_p 5.3.1-0.9.8
- %define V_php_suhosin_e 0.9.29
- %define V_php_kolab 5.2.8
+-%define V_php_suhosin_p 5.3.1-0.9.8
+-%define V_php_suhosin_e 0.9.29
+-%define V_php_kolab 5.2.8
+-%define V_php_pecl_memcache 2.2.5
++%define V_php 5.3.4
++%define V_php_suhosin_p 5.3.4-0.9.10
++%define V_php_suhosin_e 0.9.32.1
++%define V_php_kolab 5.3.4
++%define V_php_pecl_memcache 2.2.6
+
+ # package information
+ Name: php
@@ -39,7 +39,7 @@
Group: Language
License: PHP
Version: %{V_php}
-Release: 20091129
-+Release: 20091129_kolab3
++Release: 20101230_kolab1
# package options
%option with_suhosin no
-@@ -61,6 +61,8 @@
+@@ -60,6 +60,8 @@
%option with_iconv no
%option with_imap no
%option with_imap_annotate no
+%option with_hash no
+%option with_imap_myrights no
%option with_json no
+ %option with_tokenizer no
%option with_mbregex no
- %option with_mbstring no
-@@ -138,6 +140,7 @@
+@@ -132,12 +134,13 @@
+
+ # list of sources
+ Source0: http://static.php.net/www.php.net/distributions/php-%{V_php}.tar.bz2
+-Source1: http://download.suhosin.org/suhosin-%{V_php_suhosin_e}.tgz
++Source1: http://download.suhosin.org/suhosin-%{V_php_suhosin_e}.tar.gz
+ Source2: php.ini
+ Source3: http://pecl.php.net/get/memcache-%{V_php_pecl_memcache}.tgz
Patch0: http://download.suhosin.org/suhosin-patch-%{V_php_suhosin_p}.patch.gz
-Patch1: http://kolab.org/cgi-bin/viewcvs-kolab.cgi/*checkout*/server/patches/php/php-%{V_php_kolab}/KOLAB_php-%{V_php_kolab}_Annotations.patch
-+Patch1: http://kolab.org/cgi-bin/viewcvs-kolab.cgi/*checkout*/server/patches/php/php-%{V_php_kolab}/KOLAB_php-%{V_php}_Annotations.patch
++Patch1: http://git.kolab.org/server/tree/php/patches/%{V_php_kolab}/KOLAB_php-%{V_php}_Annotations.patch
Patch2: php.patch
-+Patch3: http://kolab.org/cgi-bin/viewcvs-kolab.cgi/*checkout*/server/patches/php/php-%{V_php_kolab}/KOLAB_php-%{V_php}_myrights.patch
++Patch3: http://git.kolab.org/server/tree/php/patches/%{V_php_kolab}/KOLAB_php-%{V_php}_myrights.patch
# build information
Prefix: %{l_prefix}
-@@ -336,7 +338,10 @@
+@@ -305,7 +308,7 @@
+ }
+ prog php:kolab = {
+ version = %{V_php_kolab}
+- url = http://kolab.org/cgi-bin/viewcvs-kolab.cgi/*checkout*/server/patches/php/
++ url = http://git.kolab.org/server/tree/php/patches/
+ regex = php-(\d+(\.\d+)+)/
+ }
+ prog php:pecl_memcache = {
+@@ -338,7 +341,10 @@
configure \
ext/gd/config.m4
%if "%{with_imap_annotate}" == "yes"
@@ -51,29 +70,29 @@ diff -u -B -r1.183 php.spec
+%if "%{with_imap_myrights}" == "yes"
+ %patch -p1 -P 3
%endif
+ %patch -p0 -P 2
- %build
-@@ -396,11 +396,15 @@
+@@ -400,11 +406,15 @@
%if "%{with_calendar}" == "yes"
--enable-calendar \
%endif
+- --without-sqlite \
+-%if "%{with_sqlite}" == "yes"
+ %if "%{with_hash}" == "yes"
+ --enable-hash \
+ %endif
-- --without-sqlite \
-+ --with-pdo-sqlite=%{l_prefix} \
- %if "%{with_sqlite}" == "yes"
-- --with-pdo-sqlite=%{l_prefix} \
+ --with-pdo-sqlite=%{l_prefix} \
++%if "%{with_sqlite}" == "yes"
+ --with-sqlite=%{l_prefix} \
+ --with-sqlite3=%{l_prefix} \
%else
- --without-pdo-sqlite \
+ --without-sqlite \
%endif
- %if "%{with_mysql}" == "yes"
- --with-mysql=%{l_prefix} \
---- php.ini.orig 2010-02-16 08:53:09.000000000 +0100
-+++ php.ini 2010-02-16 08:53:23.000000000 +0100
+ %if "%{with_mysql}" == "yes" || "%{with_mysqlnd}" == "yes"
+ %if "%{with_mysqlnd}" == "yes"
+--- php.orig/php.ini 2009-09-09 13:47:43.000000000 +0200
++++ php/php.ini 2011-01-11 09:23:10.051253836 +0100
@@ -6,17 +6,14 @@
; Resource Limits
diff --git a/php/patches/php-5.3.4/KOLAB_php-5.3.4_Annotations.patch b/php/patches/php-5.3.4/KOLAB_php-5.3.4_Annotations.patch
new file mode 100644
index 0000000..ef9a2d7
--- /dev/null
+++ b/php/patches/php-5.3.4/KOLAB_php-5.3.4_Annotations.patch
@@ -0,0 +1,303 @@
+diff -dur php-5.3.4.orig/ext/imap/php_imap.c php-5.3.4/ext/imap/php_imap.c
+--- php-5.3.4.orig/ext/imap/php_imap.c 2010-11-18 16:22:22.000000000 +0100
++++ php-5.3.4/ext/imap/php_imap.c 2010-12-30 22:53:45.075238748 +0100
+@@ -164,6 +164,22 @@
+ ZEND_ARG_INFO(0, mailbox)
+ ZEND_END_ARG_INFO()
+ #endif
++#if defined(HAVE_IMAP2005)
++ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_setannotation, 0, 0, 5)
++ ZEND_ARG_INFO(0, stream_id)
++ ZEND_ARG_INFO(0, mailbox)
++ ZEND_ARG_INFO(0, entry)
++ ZEND_ARG_INFO(0, attr)
++ ZEND_ARG_INFO(0, value)
++ZEND_END_ARG_INFO()
++
++ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_getannotation, 0, 0, 4)
++ ZEND_ARG_INFO(0, stream_id)
++ ZEND_ARG_INFO(0, mailbox)
++ ZEND_ARG_INFO(0, entry)
++ ZEND_ARG_INFO(0, attr)
++ZEND_END_ARG_INFO()
++#endif
+
+ ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_expunge, 0, 0, 1)
+ ZEND_ARG_INFO(0, stream_id)
+@@ -408,6 +424,11 @@
+ ZEND_ARG_INFO(0, options)
+ ZEND_END_ARG_INFO()
+
++ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_status_current, 0, 0, 2)
++ ZEND_ARG_INFO(0, stream_id)
++ 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)
+@@ -507,6 +528,7 @@
+ PHP_FE(imap_binary, arginfo_imap_binary)
+ PHP_FE(imap_utf8, arginfo_imap_utf8)
+ PHP_FE(imap_status, arginfo_imap_status)
++ PHP_FE(imap_status_current, arginfo_imap_status_current)
+ PHP_FE(imap_mailboxmsginfo, arginfo_imap_mailboxmsginfo)
+ PHP_FE(imap_setflag_full, arginfo_imap_setflag_full)
+ PHP_FE(imap_clearflag_full, arginfo_imap_clearflag_full)
+@@ -537,6 +559,10 @@
+ PHP_FE(imap_setacl, arginfo_imap_setacl)
+ PHP_FE(imap_getacl, arginfo_imap_getacl)
+ #endif
++#if defined(HAVE_IMAP2005)
++ PHP_FE(imap_setannotation, arginfo_imap_setannotation)
++ PHP_FE(imap_getannotation, arginfo_imap_getannotation)
++#endif
+
+ PHP_FE(imap_mail, arginfo_imap_mail)
+
+@@ -798,6 +824,30 @@
+ /* }}} */
+ #endif
+
++#if defined(HAVE_IMAP2005)
++/* {{{ mail_getannotation
++ *
++ * Mail GET_ANNOTATION callback
++ * Called via the mail_parameter function in c-client:src/c-client/mail.c
++ */
++void mail_getannotation(MAILSTREAM *stream, ANNOTATION *alist)
++{
++ ANNOTATION_VALUES *cur;
++
++ TSRMLS_FETCH();
++
++ /* walk through the ANNOTATION_VALUES */
++
++ for(cur = alist->values; cur; cur = cur->next) {
++ if (cur->value)
++ add_assoc_stringl(IMAPG(imap_annotation_list), cur->attr, cur->value, strlen(cur->value), 1);
++ else
++ add_assoc_stringl(IMAPG(imap_annotation_list), cur->attr, "", 0, 1);
++ }
++}
++/* }}} */
++#endif
++
+ /* {{{ PHP_GINIT_FUNCTION
+ */
+ static PHP_GINIT_FUNCTION(imap)
+@@ -823,6 +873,7 @@
+ #if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001)
+ imap_globals->quota_return = NIL;
+ imap_globals->imap_acl_list = NIL;
++ imap_globals->imap_annotation_list = NIL;
+ #endif
+ imap_globals->gets_stream = NIL;
+ }
+@@ -1547,7 +1598,119 @@
+ }
+ /* }}} */
+ #endif /* HAVE_IMAP2000 || HAVE_IMAP2001 */
++
++#if defined(HAVE_IMAP2005)
+
++/* {{{ proto bool imap_setannotation(resource stream_id, string mailbox, string entry, string attr, string value)
++ Sets an annotation for a given mailbox */
++PHP_FUNCTION(imap_setannotation)
++{
++ zval **streamind, **mailbox, **entry, **attr, **value;
++ pils *imap_le_struct;
++ long ret;
++
++ // TODO: Use zend_parse_parameters here
++ if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &streamind, &mailbox, &entry, &attr, &value) == FAILURE) {
++ ZEND_WRONG_PARAM_COUNT();
++ }
++
++ ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap);
++
++ convert_to_string_ex(mailbox);
++ convert_to_string_ex(entry);
++ convert_to_string_ex(attr);
++ convert_to_string_ex(value);
++
++ // create annotation object
++ ANNOTATION *annotation = mail_newannotation();
++ if (!annotation)
++ RETURN_FALSE;
++ annotation->values = mail_newannotationvalue();
++ if (!annotation->values) {
++ mail_free_annotation(&annotation);
++ RETURN_FALSE;
++ }
++
++ // fill in annotation values
++ annotation->mbox = Z_STRVAL_PP(mailbox);
++ annotation->entry = Z_STRVAL_PP(entry);
++ annotation->values->attr = Z_STRVAL_PP(attr);
++ annotation->values->value = Z_STRVAL_PP(value);
++
++ ret = imap_setannotation(imap_le_struct->imap_stream, annotation);
++
++ // make sure mail_free_annotation doesn't free our variables
++ annotation->mbox = NULL;
++ annotation->entry = NULL;
++ annotation->values->attr = NULL;
++ annotation->values->value = NULL;
++ mail_free_annotation(&annotation);
++
++ RETURN_BOOL(ret);
++}
++/* }}} */
++
++/* {{{ proto array imap_getannotation(resource stream_id, string mailbox, string entry, string attr)
++ Gets the ACL for a given mailbox */
++PHP_FUNCTION(imap_getannotation)
++{
++ zval **streamind, **mailbox, **entry, **attr;
++ pils *imap_le_struct;
++ long ret;
++
++ if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &streamind, &mailbox, &entry, &attr) == FAILURE) {
++ ZEND_WRONG_PARAM_COUNT();
++ }
++
++ ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap);
++
++ convert_to_string_ex(mailbox);
++ convert_to_string_ex(entry);
++ convert_to_string_ex(attr);
++
++ /* initializing the special array for the return values */
++ if (array_init(return_value) == FAILURE) {
++ RETURN_FALSE;
++ }
++
++ // fillup calling parameters
++ STRINGLIST *entries = mail_newstringlist();
++ if (!entries)
++ RETURN_FALSE;
++
++ STRINGLIST *cur = entries;
++ cur->text.data = (unsigned char *)cpystr(Z_STRVAL_PP(entry));
++ cur->text.size = Z_STRLEN_PP(entry);
++ cur->next = NIL;
++
++ STRINGLIST *attributes = mail_newstringlist();
++ if (!attributes)
++ RETURN_FALSE;
++ cur = attributes;
++ cur->text.data = (unsigned char *)cpystr (Z_STRVAL_PP(attr));
++ cur->text.size = Z_STRLEN_PP(attr);
++ cur->next = NIL;
++
++ IMAPG(imap_annotation_list) = return_value;
++
++ /* set the callback for the GET_ANNOTATION function */
++ mail_parameters(NIL, SET_ANNOTATION, (void *) mail_getannotation);
++ ret = imap_getannotation(imap_le_struct->imap_stream, Z_STRVAL_PP(mailbox), entries, attributes);
++
++ mail_free_stringlist(&entries);
++ mail_free_stringlist(&attributes);
++
++ if (!ret) {
++ zval_dtor(return_value);
++ RETURN_FALSE;
++ }
++
++ IMAPG(imap_annotation_list) = NIL;
++}
++/* }}} */
++
++#endif /* HAVE_IMAP2005 */
++
+ /* {{{ proto bool imap_expunge(resource stream_id)
+ Permanently delete all messages marked for deletion */
+ PHP_FUNCTION(imap_expunge)
+@@ -3190,6 +3353,42 @@
+ }
+ /* }}} */
+
++/* {{{ proto object imap_status_current(resource stream_id, int options)
++ Get (cached) status info from current mailbox */
++PHP_FUNCTION(imap_status_current)
++{
++ zval **streamind, **pflags;
++ pils *imap_le_struct;
++ long flags = 0L;
++
++ if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &streamind, &pflags) == FAILURE) {
++ ZEND_WRONG_PARAM_COUNT();
++ }
++
++ ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap);
++
++ convert_to_long_ex(pflags);
++ flags = Z_LVAL_PP(pflags);
++
++ if (object_init(return_value) == FAILURE) {
++ RETURN_FALSE;
++ }
++
++ if (flags & SA_MESSAGES) {
++ add_property_long(return_value, "messages", imap_le_struct->imap_stream->nmsgs);
++ }
++ if (flags & SA_RECENT) {
++ add_property_long(return_value, "recent", imap_le_struct->imap_stream->recent);
++ }
++ if (flags & SA_UIDNEXT) {
++ add_property_long(return_value, "uidnext", imap_le_struct->imap_stream->uid_last+1);
++ }
++ if (flags & SA_UIDVALIDITY) {
++ add_property_long(return_value, "uidvalidity", imap_le_struct->imap_stream->uid_validity);
++ }
++}
++/* }}} */
++
+ /* {{{ proto object imap_status(resource stream_id, string mailbox, int options)
+ Get status info from a mailbox */
+ PHP_FUNCTION(imap_status)
+Nur in php-5.3.4/ext/imap: php_imap.c.orig.
+diff -dur php-5.3.4.orig/ext/imap/php_imap.h php-5.3.4/ext/imap/php_imap.h
+--- php-5.3.4.orig/ext/imap/php_imap.h 2010-01-03 10:23:27.000000000 +0100
++++ php-5.3.4/ext/imap/php_imap.h 2010-12-30 22:53:45.075238748 +0100
+@@ -153,6 +153,7 @@
+ PHP_FUNCTION(imap_lsub_full);
+ PHP_FUNCTION(imap_create);
+ PHP_FUNCTION(imap_rename);
++PHP_FUNCTION(imap_status_current);
+ PHP_FUNCTION(imap_status);
+ PHP_FUNCTION(imap_bodystruct);
+ PHP_FUNCTION(imap_fetch_overview);
+@@ -173,6 +174,9 @@
+ PHP_FUNCTION(imap_thread);
+ PHP_FUNCTION(imap_timeout);
+
++// TODO: Needs fixing in configure in
++#define HAVE_IMAP2005 1
++
+ #if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001)
+ PHP_FUNCTION(imap_get_quota);
+ PHP_FUNCTION(imap_get_quotaroot);
+@@ -180,7 +184,10 @@
+ PHP_FUNCTION(imap_setacl);
+ PHP_FUNCTION(imap_getacl);
+ #endif
+-
++#if defined(HAVE_IMAP2005)
++PHP_FUNCTION(imap_setannotation);
++PHP_FUNCTION(imap_getannotation);
++#endif
+
+ ZEND_BEGIN_MODULE_GLOBALS(imap)
+ char *imap_user;
+@@ -211,6 +218,9 @@
+ zval **quota_return;
+ zval *imap_acl_list;
+ #endif
++#if defined(HAVE_IMAP2005)
++ zval *imap_annotation_list;
++#endif
+ /* php_stream for php_mail_gets() */
+ php_stream *gets_stream;
+ ZEND_END_MODULE_GLOBALS(imap)
diff --git a/php/patches/php-5.3.4/KOLAB_php-5.3.4_myrights.patch b/php/patches/php-5.3.4/KOLAB_php-5.3.4_myrights.patch
new file mode 100644
index 0000000..f1f94c3
--- /dev/null
+++ b/php/patches/php-5.3.4/KOLAB_php-5.3.4_myrights.patch
@@ -0,0 +1,94 @@
+diff -dur php-5.3.4.orig/ext/imap/php_imap.c php-5.3.4/ext/imap/php_imap.c
+--- php-5.3.4.orig/ext/imap/php_imap.c 2010-11-18 16:22:22.000000000 +0100
++++ php-5.3.4/ext/imap/php_imap.c 2010-12-30 23:00:14.082687597 +0100
+@@ -163,6 +163,11 @@
+ ZEND_ARG_INFO(0, stream_id)
+ ZEND_ARG_INFO(0, mailbox)
+ ZEND_END_ARG_INFO()
++
++ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_myrights, 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)
+@@ -536,6 +541,7 @@
+ PHP_FE(imap_set_quota, arginfo_imap_set_quota)
+ PHP_FE(imap_setacl, arginfo_imap_setacl)
+ PHP_FE(imap_getacl, arginfo_imap_getacl)
++ PHP_FE(imap_myrights, arginfo_imap_myrights)
+ #endif
+
+ PHP_FE(imap_mail, arginfo_imap_mail)
+@@ -796,6 +802,20 @@
+ }
+ }
+ /* }}} */
++
++/* {{{ mail_myrights
++ *
++ * Mail MYRIGHTS callback
++ * Called via the mail_parameter function in c-client:src/c-client/mail.c
++ */
++void mail_myrights(MAILSTREAM *stream, char *mailbox, char *rights)
++{
++ TSRMLS_FETCH();
++
++ ZVAL_STRING(IMAPG(imap_acl_list), rights, 1)
++
++}
++/* }}} */
+ #endif
+
+ /* {{{ PHP_GINIT_FUNCTION
+@@ -1546,6 +1566,36 @@
+ IMAPG(imap_acl_list) = NIL;
+ }
+ /* }}} */
++
++/* {{{ proto string imap_myrights(resource stream_id, string mailbox)
++ Gets my rights (ACL) for a given mailbox */
++PHP_FUNCTION(imap_myrights)
++{
++ zval **streamind, **mailbox;
++ pils *imap_le_struct;
++
++ if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &streamind, &mailbox) == FAILURE) {
++ ZEND_WRONG_PARAM_COUNT();
++ }
++
++ ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap);
++
++ convert_to_string_ex(mailbox);
++
++ IMAPG(imap_acl_list) = return_value;
++
++ /* set the callback for the GET_ACL function */
++ mail_parameters(NIL, SET_MYRIGHTS, (void *) mail_myrights);
++ if(!imap_myrights(imap_le_struct->imap_stream, Z_STRVAL_PP(mailbox))) {
++ php_error(E_WARNING, "c-client imap_myrights failed");
++ zval_dtor(return_value);
++ RETURN_FALSE;
++ }
++
++ IMAPG(imap_acl_list) = NIL;
++}
++/* }}} */
++
+ #endif /* HAVE_IMAP2000 || HAVE_IMAP2001 */
+
+ /* {{{ proto bool imap_expunge(resource stream_id)
+Nur in php-5.3.4/ext/imap: php_imap.c.orig.
+diff -dur php-5.3.4.orig/ext/imap/php_imap.h php-5.3.4/ext/imap/php_imap.h
+--- php-5.3.4.orig/ext/imap/php_imap.h 2010-01-03 10:23:27.000000000 +0100
++++ php-5.3.4/ext/imap/php_imap.h 2010-12-30 23:00:14.083687719 +0100
+@@ -179,6 +179,7 @@
+ PHP_FUNCTION(imap_set_quota);
+ PHP_FUNCTION(imap_setacl);
+ PHP_FUNCTION(imap_getacl);
++PHP_FUNCTION(imap_myrights);
+ #endif
+
+
+Nur in php-5.3.4/ext/imap: php_imap.h.orig.
diff --git a/php/patches/php-5.3.4/series b/php/patches/php-5.3.4/series
new file mode 100644
index 0000000..cf6d8b0
--- /dev/null
+++ b/php/patches/php-5.3.4/series
@@ -0,0 +1,2 @@
+KOLAB_Annotations.patch
+KOLAB_myrights.patch
More information about the commits
mailing list