- allow to avoid deps on shared extensions on build time
[m6w6/ext-http] / http_message_object.c
index 9a62af44a171bfa18bc7f5eb1fe96fb5dc85f4f8..824745f460f041b99e162b18fcdc72b74a151efb 100644 (file)
 #include "php_http_request_api.h"
 #include "php_http_request_object.h"
 
-#ifndef WONKY
-#      ifdef HAVE_SPL
+#if defined(HAVE_SPL) && !HTTP_SHARED_EXT(SPL) && !defined(WONKY)
 /* SPL doesn't install its headers */
 extern PHPAPI zend_class_entry *spl_ce_Countable;
-#      endif
 #endif
 
 #define HTTP_BEGIN_ARGS(method, req_args)      HTTP_BEGIN_ARGS_EX(HttpMessage, method, 0, req_args)
@@ -187,7 +185,7 @@ PHP_MINIT_FUNCTION(http_message_object)
        HTTP_REGISTER_CLASS_EX(HttpMessage, http_message_object, NULL, 0);
        
 #ifndef WONKY
-#      ifdef HAVE_SPL
+#      if defined(HAVE_SPL) && !HTTP_SHARED_EXT(SPL)
        zend_class_implements(http_message_object_ce TSRMLS_CC, 3, spl_ce_Countable, zend_ce_serializable, zend_ce_iterator);
 #      else
        zend_class_implements(http_message_object_ce TSRMLS_CC, 2, zend_ce_serializable, zend_ce_iterator);
@@ -1020,8 +1018,8 @@ PHP_METHOD(HttpMessage, setRequestMethod)
                http_error(HE_WARNING, HTTP_E_INVALID_PARAM, "Cannot set HttpMessage::requestMethod to an empty string");
                RETURN_FALSE;
        }
-       if (SUCCESS != http_check_method(method)) {
-               http_error_ex(HE_WARNING, HTTP_E_REQUEST_METHOD, "Unkown request method: %s", method);
+       if (!http_request_method_exists(1, 0, method)) {
+               http_error_ex(HE_WARNING, HTTP_E_REQUEST_METHOD, "Unknown request method: %s", method);
                RETURN_FALSE;
        }