X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=http_message_object.c;h=3d736cdaaafa4d19d8b151bb17abe84d32fca23b;hb=fb5d0ef47f1f54dad0efa1f091324e3d7d18050b;hp=9a62af44a171bfa18bc7f5eb1fe96fb5dc85f4f8;hpb=2f39230d83bdf816dcae52c7e5a1b019347f0e7b;p=m6w6%2Fext-http diff --git a/http_message_object.c b/http_message_object.c index 9a62af4..3d736cd 100644 --- a/http_message_object.c +++ b/http_message_object.c @@ -32,11 +32,9 @@ #include "php_http_request_api.h" #include "php_http_request_object.h" -#ifndef WONKY -# ifdef HAVE_SPL +#if HTTP_HAVE_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 HTTP_HAVE_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; }