- ensure proper CURL_EXTERN macro by defining CURL_STATICLIB
authorMichael Wallner <mike@php.net>
Tue, 20 Sep 2005 08:58:02 +0000 (08:58 +0000)
committerMichael Wallner <mike@php.net>
Tue, 20 Sep 2005 08:58:02 +0000 (08:58 +0000)
- no request methods class constants for WONKY
- no zend_get_property_info() in WONKY

config.w32
http_message_object.c
http_request_method_api.c

index 0c5d6f04778894da50895b02080b6a0f024e1f04..23a2dd1ec3e78600fde5ac81d9533f2a770a5467 100644 (file)
@@ -40,6 +40,7 @@ if (PHP_HTTP != "no") {
                AC_DEFINE("HAVE_CURL_MULTI_STRERROR", 1, "");
                AC_DEFINE("HAVE_CURL_EASY_STRERROR", 1, "");
                AC_DEFINE("HAVE_CURL_EASY_RESET", 1, "");
+               AC_DEFINE("CURL_STATICLIB", 1, "");
        } else {
                WARNING("curl convenience functions not enabled; libraries and headers not found");
        }
index 88ab7d498e9c7485c52f9766d2720ddc0788d9ff..e3a1617da3de2aed8cee2712e7411701c7bdab9a 100644 (file)
@@ -231,21 +231,25 @@ static zval *_http_message_object_read_prop(zval *object, zval *member, int type
        getObjectEx(http_message_object, obj, object);
        http_message *msg = obj->message;
        zval *return_value;
+#ifdef WONKY
+       zend_hash_value h = zend_get_hash_value(Z_STRVAL_P(member), Z_STRLEN_P(member)+1);
+#else
        zend_property_info *pinfo = zend_get_property_info(obj->zo.ce, member, 1 TSRMLS_CC);
        
        if (!pinfo || ACC_PROP_PUBLIC(pinfo->flags)) {
                return zend_get_std_object_handlers()->read_property(object, member, type TSRMLS_CC);
        }
+#endif
 
        return_value = &EG(uninitialized_zval);
        return_value->refcount = 0;
        return_value->is_ref = 0;
 
-#if 0
-       fprintf(stderr, "Read HttpMessage::$%s\n", Z_STRVAL_P(member));
-#endif
-
+#ifdef WONKY
+       switch (h)
+#else
        switch (pinfo->h)
+#endif
        {
                case HTTP_MSG_PROPHASH_TYPE:
                        RETVAL_LONG(msg->type);
@@ -316,7 +320,11 @@ static zval *_http_message_object_read_prop(zval *object, zval *member, int type
                break;
                
                default:
+#ifdef WONKY
+                       return zend_get_std_object_handlers()->read_property(object, member, type TSRMLS_CC);
+#else
                        RETVAL_NULL();
+#endif
                break;
        }
 
@@ -327,18 +335,22 @@ static void _http_message_object_write_prop(zval *object, zval *member, zval *va
 {
        getObjectEx(http_message_object, obj, object);
        http_message *msg = obj->message;
+#ifdef WONKY
+       zend_hash_value h = zend_get_hash_value(Z_STRVAL_P(member), Z_STRLEN_P(member) + 1);
+#else
        zend_property_info *pinfo = zend_get_property_info(obj->zo.ce, member, 1 TSRMLS_CC);
        
        if (!pinfo || ACC_PROP_PUBLIC(pinfo->flags)) {
                zend_get_std_object_handlers()->write_property(object, member, value TSRMLS_CC);
                return;
        }
-
-#if 0
-       fprintf(stderr, "Write HttpMessage::$%s\n", Z_STRVAL_P(member));
 #endif
 
+#ifdef WONKY
+       switch (h)
+#else
        switch (pinfo->h)
+#endif
        {
                case HTTP_MSG_PROPHASH_TYPE:
                        convert_to_long_ex(&value);
@@ -398,7 +410,13 @@ static void _http_message_object_write_prop(zval *object, zval *member, zval *va
                                convert_to_string_ex(&value);
                                STR_SET(msg->http.info.response.status, estrndup(Z_STRVAL_P(value), Z_STRLEN_P(value)));
                        }
-                       
+               break;
+               
+               default:
+#ifdef WONKY
+                       zend_get_std_object_handlers()->write_property(object, member, value TSRMLS_CC);
+#endif
+               break;
        }
 }
 
index 28365f73edc080d473b32b78694dd861ab97692e..8c1812965f5851a77d8b4933a455e6a66cfd59de 100644 (file)
@@ -174,7 +174,7 @@ PHP_HTTP_API unsigned long _http_request_method_register(const char *method_name
        zend_register_long_constant(http_method, method_len + 1, meth_num, CONST_CS, http_module_number TSRMLS_CC);
        efree(http_method);
        
-#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL)
+#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) && !defined(WONKY)
        method_len = spprintf(&http_method, 0, "METH_%s", method);
        zend_declare_class_constant_long(http_request_object_ce, http_method, method_len, meth_num TSRMLS_CC);
        efree(http_method);
@@ -196,7 +196,7 @@ PHP_HTTP_API STATUS _http_request_method_unregister(unsigned long method TSRMLS_
                return FAILURE;
        }
 
-#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL)
+#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) && !defined(WONKY)
        method_len = spprintf(&http_method, 0, "METH_%s", Z_STRVAL_PP(zmethod));
        if ((SUCCESS != zend_hash_del(&http_request_object_ce->constants_table, http_method, method_len + 1))) {
                http_error_ex(HE_NOTICE, HTTP_E_REQUEST_METHOD, "Could not unregister request method: HttpRequest::%s", http_method);