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 b6d8de21a0d8cbdb293229e8a965cc1b20d7430f..3853231249f5a4be047f3d4dcaafa9a63b516b4b 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 d30cc1bf256b7368d3f6bb1913bde074562b0252..9c183f3957284f237cb33a634b44ec04a017f726 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 1ad4b2a78be93b5b06733b975707a7bcfddf8477..703f2b168df4be90cae6a24df486d6285a02fd94 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 aebc027f56d3fe9ee4718105c54d199d6196ac32..c538a7308900d54113c927edd0f2cfb5e497c600 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 6c16d65f3b79a0131c2015b60da9b35a9d37fa27..b561d1d1c03b1165f9e426a7266b442beea0bcb7 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 7163dc1fd8ab48118cb16a762550b3236960604d..809f1426419871057c72e4b0ac0ee6fbcbeb6553 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;
 }