Added support for MKCALENDAR request method in CLI web server.
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2016, PHP 5.6.20
+- CLI Server:
+ . Fixed bug #69953 (Support MKCALENDAR request method). (Christoph)
+
- Core:
. Fixed bug #71596 (Segmentation fault on ZTS with date function
(setlocale)). (Anatol)
, "LOCK"
, "MKCOL"
, "MOVE"
+ , "MKCALENDAR"
, "PROPFIND"
, "PROPPATCH"
, "UNLOCK"
case 'G': parser->method = PHP_HTTP_GET; break;
case 'H': parser->method = PHP_HTTP_HEAD; break;
case 'L': parser->method = PHP_HTTP_LOCK; break;
- case 'M': parser->method = PHP_HTTP_MKCOL; /* or MOVE, MKACTIVITY, MERGE, M-SEARCH */ break;
+ case 'M': parser->method = PHP_HTTP_MKCOL; /* or MOVE, MKCALENDAR, MKACTIVITY, MERGE, M-SEARCH */ break;
case 'N': parser->method = PHP_HTTP_NOTIFY; break;
case 'O': parser->method = PHP_HTTP_OPTIONS; break;
case 'P': parser->method = PHP_HTTP_POST; /* or PROPFIND or PROPPATCH or PUT */ break;
} else if (parser->method == PHP_HTTP_MKCOL) {
if (index == 1 && ch == 'O') {
parser->method = PHP_HTTP_MOVE;
+ } else if (index == 3 && ch == 'A') {
+ parser->method = PHP_HTTP_MKCALENDAR;
} else if (index == 1 && ch == 'E') {
parser->method = PHP_HTTP_MERGE;
} else if (index == 1 && ch == '-') {
, PHP_HTTP_LOCK
, PHP_HTTP_MKCOL
, PHP_HTTP_MOVE
+ , PHP_HTTP_MKCALENDAR
, PHP_HTTP_PROPFIND
, PHP_HTTP_PROPPATCH
, PHP_HTTP_UNLOCK
<?php
include "php_cli_server.inc";
php_cli_server_start();
-foreach (['MKCALENDAR', 'MKCO', 'MKCOLL', 'M'] as $method) {
+foreach (['MKCO', 'MKCOLL', 'M'] as $method) {
$context = stream_context_create(['http' => ['method' => $method]]);
// the following is supposed to emit a warning for unsupported methods
file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS, false, $context);
Warning: file_get_contents(http://localhost:8964): failed to open stream: HTTP request failed! HTTP/1.0 501 Not Implemented
in %s on line %d
-
-Warning: file_get_contents(http://localhost:8964): failed to open stream: HTTP request failed! HTTP/1.0 501 Not Implemented
- in %s on line %d
--- /dev/null
+--TEST--
+FR #69953 (Support MKCALENDAR request method)
+--INI--
+allow_url_fopen=1
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+include "php_cli_server.inc";
+php_cli_server_start('echo $_SERVER["REQUEST_METHOD"];');
+$context = stream_context_create(['http' => ['method' => 'MKCALENDAR']]);
+var_dump(file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS, false, $context));
+?>
+--EXPECT--
+string(10) "MKCALENDAR"