pierrick Wed, 23 Nov 2011 05:45:27 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=319706
Log: Fixed bug #54995 Bug: https://bugs.php.net/54995 (Assigned) Missing CURLINFO_RESPONSE_CODE support Changed paths: U php/php-src/trunk/NEWS U php/php-src/trunk/ext/curl/interface.c A php/php-src/trunk/ext/curl/tests/bug54995.phpt Modified: php/php-src/trunk/NEWS =================================================================== --- php/php-src/trunk/NEWS 2011-11-23 01:20:49 UTC (rev 319705) +++ php/php-src/trunk/NEWS 2011-11-23 05:45:27 UTC (rev 319706) @@ -26,5 +26,6 @@ (Pierrick) . Fixed bug #55635 (CURLOPT_BINARYTRANSFER no longer used. The constant still exists for backward compatibility but is doing nothing). (Pierrick) + . Fixed bug #54995 (Missing CURLINFO_RESPONSE_CODE support). (Pierrick) <<< NOTE: Insert NEWS from last stable release here prior to actual release! >>> Modified: php/php-src/trunk/ext/curl/interface.c =================================================================== --- php/php-src/trunk/ext/curl/interface.c 2011-11-23 01:20:49 UTC (rev 319705) +++ php/php-src/trunk/ext/curl/interface.c 2011-11-23 05:45:27 UTC (rev 319706) @@ -788,6 +788,7 @@ /* Info constants */ REGISTER_CURL_CONSTANT(CURLINFO_EFFECTIVE_URL); REGISTER_CURL_CONSTANT(CURLINFO_HTTP_CODE); + REGISTER_CURL_CONSTANT(CURLINFO_RESPONSE_CODE); REGISTER_CURL_CONSTANT(CURLINFO_HEADER_SIZE); REGISTER_CURL_CONSTANT(CURLINFO_REQUEST_SIZE); REGISTER_CURL_CONSTANT(CURLINFO_TOTAL_TIME); Added: php/php-src/trunk/ext/curl/tests/bug54995.phpt =================================================================== --- php/php-src/trunk/ext/curl/tests/bug54995.phpt (rev 0) +++ php/php-src/trunk/ext/curl/tests/bug54995.phpt 2011-11-23 05:45:27 UTC (rev 319706) @@ -0,0 +1,30 @@ +--TEST-- +Bug #54995 (Missing CURLINFO_RESPONSE_CODE support) +--SKIPIF-- +<?php +if (!extension_loaded("curl")) { + exit("skip curl extension not loaded"); +} +if ($curl_version['version_number'] > 0x070a08) { + exit("skip: tests works a versions of curl >= 7.10.8"); +} +if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) { + exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined"); +} +?> +--FILE-- +<?php + +$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER'); +$ch = curl_init(); +curl_setopt($ch, CURLOPT_URL, "{$host}/get.php"); +curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + +var_dump(curl_getinfo($ch, CURLINFO_HTTP_CODE) == curl_getinfo($ch, CURLINFO_RESPONSE_CODE)); + +curl_exec($ch); +curl_close($ch); + +?> +--EXPECTF-- +bool(true)
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
