fix PHP_5_3 build
authorMichael Wallner <mike@php.net>
Mon, 4 Feb 2008 15:48:32 +0000 (15:48 +0000)
committerMichael Wallner <mike@php.net>
Mon, 4 Feb 2008 15:48:32 +0000 (15:48 +0000)
http_message_object.c
http_querystring_object.c
missing.h
package2.xml
php_http.h
php_http_api.h

index b6d8de2..3853231 100644 (file)
@@ -119,6 +119,7 @@ HTTP_END_ARGS;
 
 HTTP_EMPTY_ARGS(getParentMessage);
 HTTP_EMPTY_ARGS(send);
+HTTP_EMPTY_ARGS(__toString);
 HTTP_BEGIN_ARGS(toString, 0)
        HTTP_ARG_VAL(include_parent, 0)
 HTTP_END_ARGS;
@@ -195,7 +196,7 @@ zend_function_entry http_message_object_fe[] = {
        HTTP_MESSAGE_ME(key, ZEND_ACC_PUBLIC)
        HTTP_MESSAGE_ME(next, ZEND_ACC_PUBLIC)
 
-       ZEND_MALIAS(HttpMessage, __toString, toString, HTTP_ARGS(HttpMessage, toString), ZEND_ACC_PUBLIC)
+       ZEND_MALIAS(HttpMessage, __toString, toString, HTTP_ARGS(HttpMessage, __toString), ZEND_ACC_PUBLIC)
 
        HTTP_MESSAGE_ME(factory, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
        ZEND_MALIAS(HttpMessage, fromString, factory, HTTP_ARGS(HttpMessage, factory), ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
@@ -428,8 +429,13 @@ static zval *_http_message_object_read_prop(zval *object, zval *member, int type
        }
        
        ALLOC_ZVAL(return_value);
+#ifdef Z_SET_REFCOUNT
+       Z_SET_REFCOUNT_P(return_value, 0);
+       Z_UNSET_ISREF_P(return_value);
+#else
        return_value->refcount = 0;
        return_value->is_ref = 0;
+#endif
 
 #ifdef WONKY
        switch (h)
index d30cc1b..9c183f3 100644 (file)
@@ -247,8 +247,13 @@ static inline zval *_http_querystring_instantiate(zval *this_ptr, zend_bool glob
                        
                        zend_update_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, qarray TSRMLS_CC);
                        zend_update_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, qstring TSRMLS_CC);
+#ifdef Z_SET_ISREF
+                       Z_SET_ISREF_P(zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC));
+                       Z_SET_ISREF_P(zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, 0 TSRMLS_CC));
+#else
                        zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC)->is_ref = 1;
                        zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, 0 TSRMLS_CC)->is_ref = 1;
+#endif
        
                        if (params) {
                                http_querystring_modify(zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC), params);
@@ -258,7 +263,7 @@ static inline zval *_http_querystring_instantiate(zval *this_ptr, zend_bool glob
                        }
                }
        } else {
-               qarray = ecalloc(1, sizeof(zval));
+               MAKE_STD_ZVAL(qarray);
                array_init(qarray);
                
                zend_update_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, qarray TSRMLS_CC);
@@ -267,6 +272,8 @@ static inline zval *_http_querystring_instantiate(zval *this_ptr, zend_bool glob
                if (params && http_querystring_modify(qarray, params) && !defer_update) {
                        http_querystring_update(qarray, zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, 0 TSRMLS_CC));
                }
+               
+               zval_ptr_dtor(&qarray);
        }
        
        return this_ptr;
index 1ad4b2a..703f2b1 100644 (file)
--- a/missing.h
+++ b/missing.h
 #      endif
 #endif
 
+#ifndef ZVAL_ADDREF
+#      define ZVAL_ADDREF Z_ADDREF_P
+#endif
+
 #ifndef ZVAL_ZVAL
 #define ZVAL_ZVAL(z, zv, copy, dtor) {  \
                int is_ref, refcount;           \
index aebc027..c538a73 100644 (file)
@@ -28,9 +28,9 @@ support. Parallel requests are available for PHP 5 and greater.
   <email>mike@php.net</email>
   <active>yes</active>
  </lead>
- <date>2007-11-26</date>
+ <date>2008-02-04</date>
  <version>
-  <release>1.6.0</release>
+  <release>1.6.1</release>
   <api>1.6.0</api>
  </version>
  <stability>
@@ -39,20 +39,7 @@ support. Parallel requests are available for PHP 5 and greater.
  </stability>
  <license>BSD, revised</license>
  <notes><![CDATA[
-+ Added HttpRequest::flushCookies() (libcurl >= 7.17.1)
-+ Added constant HTTP_URL_FROM_ENV
-+ Added 'retrycount' and 'retrydelay' request options
-+ Added libevent support for libcurl (>= 7.16.0):
-  o added --with-http-curl-libevent configure option
-  o added HttpRequestPool::enableEvents()
-* Fixed problems with cookiestore request option introduced with persistent handles
-* Fixed crash on prematurely called HttpMessage::next()
-* Fixed possible shutdown crash with http_parse_params() and PHP4
-* Fixed a possible crash at module shutdown in the persistent handle API
-  (probably fixing bug #11509)
-* Fixed test suite for PHP4
-* Fixed missing PHP_LIBDIR definition in config.m4 for PHP4
-* Fixed non-standard shell support in config.m4
+* Fixed PHP-5.3 build
 ]]></notes>
  <contents>
   <dir name="/">
index 6c16d65..b561d1d 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef PHP_EXT_HTTP_H
 #define PHP_EXT_HTTP_H
 
-#define PHP_EXT_HTTP_VERSION "1.6.0"
+#define PHP_EXT_HTTP_VERSION "1.6.1"
 
 #ifdef HAVE_CONFIG_H
 #      include "config.h"
index 7163dc1..809f142 100644 (file)
@@ -296,8 +296,13 @@ static inline zval *_zval_copy(int type, zval *z ZEND_FILE_LINE_DC ZEND_FILE_LIN
        *copy = *z;
        zval_copy_ctor(copy);
        convert_to_type(type, copy);
+#ifdef Z_SET_REFCOUNT
+       Z_SET_REFCOUNT_P(copy, 0);
+       Z_UNSET_ISREF_P(copy);
+#else
        copy->refcount = 0;
        copy->is_ref = 0;
+#endif
        
        return copy;
 }