fix warning on extra argument to Countable::count(), fix zend_is_true
authorMichael Wallner <mike@php.net>
Wed, 16 Apr 2014 18:10:53 +0000 (20:10 +0200)
committerMichael Wallner <mike@php.net>
Wed, 16 Apr 2014 18:10:53 +0000 (20:10 +0200)
php_http_client.c
php_http_message.c
php_http_misc.h

index b2bd7f8c023f4e02261b01eedff1e178e74fb2c8..489177bf7a23fbcfdd347c875859ff79ba9b2afa 100644 (file)
@@ -390,7 +390,7 @@ static STATUS handle_response(void *arg, php_http_client_t *client, php_http_cli
                zval *info, *zresponse, *zrequest;
                HashTable *info_ht;
 
-               if (i_zend_is_true(zend_read_property(php_http_client_class_entry, &zclient, ZEND_STRL("recordHistory"), 0 TSRMLS_CC))) {
+               if (z_is_true(zend_read_property(php_http_client_class_entry, &zclient, ZEND_STRL("recordHistory"), 0 TSRMLS_CC))) {
                        handle_history(&zclient, *request, *response TSRMLS_CC);
                }
 
@@ -720,7 +720,9 @@ ZEND_BEGIN_ARG_INFO_EX(ai_HttpClient_count, 0, 0, 0)
 ZEND_END_ARG_INFO();
 static PHP_METHOD(HttpClient, count)
 {
-       if (SUCCESS == zend_parse_parameters_none()) {
+       long count_mode = -1;
+
+       if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &count_mode)) {
                php_http_client_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
 
                RETVAL_LONG(zend_llist_count(&obj->client->requests));
index 61a1f747d9660781a9015112467ae54662dcec2b..a6414e400dea8182bf3324c828d4d572e26e7d9b 100644 (file)
@@ -1808,7 +1808,9 @@ ZEND_BEGIN_ARG_INFO_EX(ai_HttpMessage_count, 0, 0, 0)
 ZEND_END_ARG_INFO();
 static PHP_METHOD(HttpMessage, count)
 {
-       if (SUCCESS == zend_parse_parameters_none()) {
+       long count_mode = -1;
+
+       if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &count_mode)) {
                long i = 0;
                php_http_message_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
 
index 75090bdad4cc70dccffae0130e87d8f63dc8ae9c..fe08d6d1d5efd63b3b54c1adab9362d0d493a431 100644 (file)
@@ -127,6 +127,12 @@ static inline const char *php_http_locate_bin_eol(const char *bin, size_t len, i
 #      define PHP_HTTP_ZEND_LITERAL_CCN , NULL
 #endif
 
+#if PHP_VERSION_ID < 50700
+#      define z_is_true zend_is_true
+#else
+#      define z_is_true(z) zend_is_true(z TSRMLS_CC)
+#endif
+
 #define INIT_PZVAL_ARRAY(zv, ht) \
        { \
                INIT_PZVAL((zv)); \