19 changed files with 360 additions and 58 deletions
-
24NEWS
-
4Zend/zend_API.c
-
6Zend/zend_alloc.c
-
2ext/curl/tests/bug62839.phpt
-
16ext/date/php_date.c
-
33ext/date/tests/bug62852.phpt
-
2ext/dom/domerrorhandler.c
-
32ext/openssl/openssl.c
-
5ext/sockets/multicast.h
-
22ext/sockets/tests/bug63000.phpt
-
52ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt
-
58ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt
-
13ext/standard/tests/strings/http_build_query_error.phpt
-
41sapi/cli/php_cli_server.c
-
10sapi/cli/php_http_parser.c
-
3sapi/cli/php_http_parser.h
-
43sapi/cli/tests/bug61679.phpt
-
44sapi/cli/tests/php_cli_server_018.phpt
-
8win32/build/libs_version.txt
@ -0,0 +1,22 @@ |
|||
--TEST-- |
|||
Bug #63000: Multicast on OSX |
|||
--SKIPIF-- |
|||
<?php |
|||
if (!extension_loaded('sockets')) { |
|||
die('skip sockets extension not available.'); |
|||
} |
|||
if (PHP_OS !== 'Darwin') { |
|||
die('is not OSX.'); |
|||
} |
|||
--FILE-- |
|||
<?php |
|||
$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); |
|||
socket_bind($socket, '0.0.0.0', 31057); |
|||
|
|||
$so = socket_set_option($socket, IPPROTO_IP, MCAST_JOIN_GROUP, array( |
|||
"group" => '224.0.0.251', |
|||
"interface" => 0, |
|||
)); |
|||
var_dump($so); |
|||
--EXPECTF-- |
|||
bool(true) |
|||
@ -0,0 +1,52 @@ |
|||
--TEST-- |
|||
RecursiveDirectoryIterator::getBasePath() - basic test |
|||
--CREDITS-- |
|||
Pawel Krynicki <pawel [dot] krynicki [at] xsolve [dot] pl> |
|||
#testfest AmsterdamPHP 2012-06-23 |
|||
--FILE-- |
|||
<?php |
|||
$depth0 = md5('recursiveDirectoryIterator::getSubPath'); |
|||
$depth1 = md5('depth1'); |
|||
$depth2 = md5('depth2'); |
|||
$targetDir = __DIR__ . DIRECTORY_SEPARATOR . $depth0 . DIRECTORY_SEPARATOR . $depth1 . DIRECTORY_SEPARATOR . $depth2; |
|||
mkdir($targetDir, 0777, true); |
|||
touch($targetDir . DIRECTORY_SEPARATOR . 'getSubPath_test.tmp'); |
|||
$iterator = new RecursiveDirectoryIterator(__DIR__ . DIRECTORY_SEPARATOR . $depth0); |
|||
$it = new RecursiveIteratorIterator($iterator); |
|||
|
|||
$list = []; |
|||
while($it->valid()) { |
|||
$list[] = $it->getSubPath(); |
|||
$it->next(); |
|||
} |
|||
asort($list); |
|||
foreach ($list as $item) { |
|||
echo $item . "\n"; |
|||
} |
|||
?> |
|||
==DONE== |
|||
--CLEAN-- |
|||
<?php |
|||
function rrmdir($dir) { |
|||
foreach(glob($dir . '/*') as $file) { |
|||
if(is_dir($file)) { |
|||
rrmdir($file); |
|||
} else { |
|||
unlink($file); |
|||
} |
|||
} |
|||
|
|||
rmdir($dir); |
|||
} |
|||
|
|||
$targetDir = __DIR__.DIRECTORY_SEPARATOR.md5('recursiveDirectoryIterator::getSubPath'); |
|||
rrmdir($targetDir); |
|||
?> |
|||
|
|||
--EXPECT-- |
|||
a0c967a6c2c34786e4802f59af9356f5 |
|||
a0c967a6c2c34786e4802f59af9356f5 |
|||
a0c967a6c2c34786e4802f59af9356f5/9925aabb545352472e4d77942627b507 |
|||
a0c967a6c2c34786e4802f59af9356f5/9925aabb545352472e4d77942627b507 |
|||
a0c967a6c2c34786e4802f59af9356f5/9925aabb545352472e4d77942627b507 |
|||
==DONE== |
|||
@ -0,0 +1,58 @@ |
|||
--TEST-- |
|||
RecursiveDirectoryIterator::getBasePathname() - basic test |
|||
--CREDITS-- |
|||
Pawel Krynicki <pawel [dot] krynicki [at] xsolve [dot] pl> |
|||
#testfest AmsterdamPHP 2012-06-23 |
|||
--FILE-- |
|||
<?php |
|||
$depth0 = md5('recursiveDirectoryIterator::getSubPathname'); |
|||
$depth1 = md5('depth1'); |
|||
$depth2 = md5('depth2'); |
|||
$targetDir = __DIR__ . DIRECTORY_SEPARATOR . $depth0 . DIRECTORY_SEPARATOR . $depth1 . DIRECTORY_SEPARATOR . $depth2; |
|||
mkdir($targetDir, 0777, true); |
|||
touch($targetDir . DIRECTORY_SEPARATOR . 'getSubPathname_test_2.tmp'); |
|||
touch(__DIR__ . DIRECTORY_SEPARATOR . $depth0 . DIRECTORY_SEPARATOR . $depth1 . DIRECTORY_SEPARATOR . 'getSubPathname_test_3.tmp'); |
|||
touch(__DIR__ . DIRECTORY_SEPARATOR . $depth0 . DIRECTORY_SEPARATOR . 'getSubPathname_test_1.tmp'); |
|||
$iterator = new RecursiveDirectoryIterator(__DIR__ . DIRECTORY_SEPARATOR . $depth0); |
|||
$it = new RecursiveIteratorIterator($iterator); |
|||
|
|||
$list = []; |
|||
while($it->valid()) { |
|||
$list[] = $it->getSubPathname(); |
|||
$it->next(); |
|||
} |
|||
asort($list); |
|||
foreach ($list as $item) { |
|||
echo $item . "\n"; |
|||
} |
|||
?> |
|||
==DONE== |
|||
--CLEAN-- |
|||
<?php |
|||
function rrmdir($dir) { |
|||
foreach(glob($dir . '/*') as $file) { |
|||
if(is_dir($file)) { |
|||
rrmdir($file); |
|||
} else { |
|||
unlink($file); |
|||
} |
|||
} |
|||
|
|||
rmdir($dir); |
|||
} |
|||
|
|||
$targetDir = __DIR__ . DIRECTORY_SEPARATOR . md5('recursiveDirectoryIterator::getSubPathname'); |
|||
rrmdir($targetDir); |
|||
?> |
|||
--EXPECT-- |
|||
. |
|||
. |
|||
.. |
|||
a0c967a6c2c34786e4802f59af9356f5/. |
|||
a0c967a6c2c34786e4802f59af9356f5/.. |
|||
a0c967a6c2c34786e4802f59af9356f5/9925aabb545352472e4d77942627b507/. |
|||
a0c967a6c2c34786e4802f59af9356f5/9925aabb545352472e4d77942627b507/.. |
|||
a0c967a6c2c34786e4802f59af9356f5/9925aabb545352472e4d77942627b507/getSubPathname_test_2.tmp |
|||
a0c967a6c2c34786e4802f59af9356f5/getSubPathname_test_3.tmp |
|||
getSubPathname_test_1.tmp |
|||
==DONE== |
|||
@ -0,0 +1,13 @@ |
|||
--TEST-- |
|||
Testing error on null parameter 1 of http_build_query() |
|||
--CREDITS-- |
|||
Pawel Krynicki <pawel.krynicki [at] xsolve [dot] pl> |
|||
#testfest AmsterdamPHP 2012-06-23 |
|||
--FILE-- |
|||
<?php |
|||
|
|||
$result = http_build_query(null); |
|||
|
|||
?> |
|||
--EXPECTF-- |
|||
Warning: http_build_query(): Parameter 1 expected to be Array or Object. %s value given in %s on line %d |
|||
@ -0,0 +1,43 @@ |
|||
--TEST-- |
|||
Bug #61679 (Error on non-standard HTTP methods) |
|||
--SKIPIF-- |
|||
<?php |
|||
include "skipif.inc"; |
|||
?> |
|||
--FILE-- |
|||
<?php |
|||
include "php_cli_server.inc"; |
|||
php_cli_server_start(<<<'PHP' |
|||
echo "This should never echo"; |
|||
PHP |
|||
); |
|||
|
|||
list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS); |
|||
$port = intval($port)?:80; |
|||
|
|||
$fp = fsockopen($host, $port, $errno, $errstr, 0.5); |
|||
if (!$fp) { |
|||
die("connect failed"); |
|||
} |
|||
|
|||
// Send a request with a fictitious request method, |
|||
// I like smurfs, the smurf everything. |
|||
if(fwrite($fp, <<<HEADER |
|||
SMURF / HTTP/1.1 |
|||
Host: {$host} |
|||
|
|||
|
|||
HEADER |
|||
)) { |
|||
while (!feof($fp)) { |
|||
echo fgets($fp); |
|||
// Only echo the first line from the response, |
|||
// the rest is not interesting |
|||
break; |
|||
} |
|||
} |
|||
|
|||
fclose($fp); |
|||
?> |
|||
--EXPECTF-- |
|||
HTTP/1.1 501 Not Implemented |
|||
@ -0,0 +1,44 @@ |
|||
--TEST-- |
|||
Implement Req #61679 (Support HTTP PATCH method) |
|||
--SKIPIF-- |
|||
<?php |
|||
include "skipif.inc"; |
|||
?> |
|||
--FILE-- |
|||
<?php |
|||
include "php_cli_server.inc"; |
|||
php_cli_server_start(<<<'PHP' |
|||
var_dump($_SERVER['REQUEST_METHOD']); |
|||
PHP |
|||
); |
|||
|
|||
list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS); |
|||
$port = intval($port)?:80; |
|||
|
|||
$fp = fsockopen($host, $port, $errno, $errstr, 0.5); |
|||
if (!$fp) { |
|||
die("connect failed"); |
|||
} |
|||
|
|||
if(fwrite($fp, <<<HEADER |
|||
PATCH / HTTP/1.1 |
|||
Host: {$host} |
|||
|
|||
|
|||
HEADER |
|||
)) { |
|||
while (!feof($fp)) { |
|||
echo fgets($fp); |
|||
} |
|||
} |
|||
|
|||
fclose($fp); |
|||
?> |
|||
--EXPECTF-- |
|||
HTTP/1.1 200 OK |
|||
Host: %s |
|||
Connection: close |
|||
X-Powered-By: %s |
|||
Content-type: text/html |
|||
|
|||
string(5) "PATCH" |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue