- 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 c297b6489b0dbb9c7dc454601cacf90008c9fc31..4f9f93e3dc7ca513f7f331fe79a8ba5df8d46c73 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 571933e10ae2a427e51066a3741185ab619c1261..c1920ce0d874a7f1e08b97447078267a1f9f4dc6 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 235225db5386cbd03b9e8a2e5045762dd7c4c341..57c887259111cf662d616dc29df821637557e265 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 bd4df9538c80fefbd5ba71e9aaf0540277923142..6999bff2f3855a40bc5a939bc04bfd40fa1455a6 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 2e83a9bb06701f3770b368037c4682edc0b74a0a..ffe5a0621e7b8d56496975f8ed2f5cc2bc247ee5 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 af48fde1e705c39f445b5a25b227c6e27ad69ab4..aef60595ab0108c19fccad565f094159133fd97c 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 4d36b4653059d192828394ac87b7b96fdc43aadd..ac31338ebbfb90822afa14274a6c2da9d76914c4 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 ea2cb5f8e7a28f6c742d18fc145d5d9108be6773..c4d3a1212bc9d266c96a9da0ac41744db4b02c47 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