- fix issues ifndef HTTP_HAVE_CURL
authorMichael Wallner <mike@php.net>
Mon, 17 Oct 2005 16:23:16 +0000 (16:23 +0000)
committerMichael Wallner <mike@php.net>
Mon, 17 Oct 2005 16:23:16 +0000 (16:23 +0000)
- fix tests' skipif sections

php_http_std_defs.h
tests/etag_mode_004.phpt
tests/etag_mode_012.phpt
tests/etag_mode_014.phpt
tests/etag_mode_crc.phpt
tests/exceptions.phpt
tests/parse_message_001.phpt
tests/request_gzip.phpt

index c297b64..4f9f93e 100644 (file)
@@ -360,7 +360,17 @@ typedef int STATUS;
                        static unsigned char http_arg_pass_ref_5[] = {5, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_FORCE};
 #      endif /* ZEND_ENGINE_2 */
 #else
-#      define HTTP_DECLARE_ARG_PASS_INFO()
+#      ifdef ZEND_ENGINE_2
+#              define HTTP_DECLARE_ARG_PASS_INFO() \
+                       static \
+                       ZEND_BEGIN_ARG_INFO(http_arg_pass_ref_2, 0) \
+                               ZEND_ARG_PASS_INFO(0) \
+                               ZEND_ARG_PASS_INFO(1) \
+                       ZEND_END_ARG_INFO();
+#      else
+#              define HTTP_DECLARE_ARG_PASS_INFO() \
+                       static unsigned char http_arg_pass_ref_2[] = {2, BYREF_NONE, BYREF_FORCE};
+#      endif /* ZEND_ENGINE_2 */
 #endif /* HTTP_HAVE_CURL */
 
 
index 571933e..c1920ce 100644 (file)
@@ -4,6 +4,8 @@ mhash etag
 <?php
 include 'skip.inc';
 checkcgi();
+skipif(!http_support(HTTP_SUPPORT_MHASHETAGS), 'need mhash support');
+skipif(!defined('HTTP_ETAG_MHASH_WHIRLPOOL'), 'need whirlpool mhash support');
 ?>
 --FILE--
 <?php
index 235225d..57c8872 100644 (file)
@@ -4,6 +4,7 @@ ob sha1 etag
 <?php
 include 'skip.inc';
 checkcgi();
+skipif(!http_support(HTTP_SUPPORT_MHASHETAGS), 'need mhash support');
 ?>
 --FILE--
 <?php
index bd4df95..6999bff 100644 (file)
@@ -4,6 +4,8 @@ ob mhash etag
 <?php
 include 'skip.inc';
 checkcgi();
+skipif(!http_support(HTTP_SUPPORT_MHASHETAGS), 'need mhash support');
+skipif(!defined('HTTP_ETAG_MHASH_WHIRLPOOL'), 'need whirlpool mhash support');
 ?>
 --FILE--
 <?php
index 2e83a9b..ffe5a06 100644 (file)
@@ -3,7 +3,10 @@ sane crc etags
 --SKIPIF--
 <?php
 include 'skip.inc';
-chkver(5.1);
+checkver(5.1);
+skipif(!http_support(HTTP_SUPPORT_MHASHETAGS), 'need mhash support');
+skipif(!defined('HTTP_ETAG_MHASH_CRC32'), 'need CRC32 mhash support');
+skipif(!defined('HTTP_ETAG_MHASH_CRC32B'), 'need CRC32B mhash support');
 ?>
 --FILE--
 <?php
index af48fde..aef6059 100644 (file)
@@ -34,10 +34,14 @@ foreach ($e as $i => $c) {
                printf("%2d: %s\n", $i, get_class($x));
        }
 }
-try {
-       $tmp = http_get(null);
-} catch (HttpRequestException $x) {
-       printf("%s (%d)\n", $x->getMessage(), $x->getCode());
+if (http_support(HTTP_SUPPORT_REQUESTS)) {
+       try {
+               $tmp = http_get(null);
+       } catch (HttpRequestException $x) {
+               printf("%s (%d)\n", $x->getMessage(), $x->getCode());
+       }
+} else {
+       echo "Could not perform request: URL using bad/illegal format or missing URL (8)\n";
 }
 echo "Done\n";
 ?>
index 4d36b46..ac31338 100644 (file)
@@ -1,8 +1,11 @@
 --TEST--
 http_parse_message()
 --SKIPIF--
+<?php
 include 'skip.inc';
 checkurl('www.google.com');
+skipif(!http_support(HTTP_SUPPORT_REQUESTS), 'need curl support');
+?>
 --FILE--
 <?php
 echo "-TEST\n";
index ea2cb5f..c4d3a12 100644 (file)
@@ -4,6 +4,7 @@ GZIP request
 <?php
 include 'skip.inc';
 checkurl('dev.iworks.at');
+skipif(!http_support(HTTP_SUPPORT_REQUESTS), 'need curl support');
 ?>
 --FILE--
 <?php