php-src/ext/standard/tests/streams/bug77680.phpt
Vlad Temian ec2ecb7e12 Fix bug #77680: Correctly implement recursive mkdir on FTP stream
If the root directory was missing, an extra CWD without arguments was
made. Also, the MKD contained an empty string.

Now the CWD will use / and MKDs will be issued starting from the root
directory.
2019-03-25 17:43:46 +01:00

37 lines
663 B
PHP

--TEST--
Recursive mkdir() on ftp should create missing directories.
--SKIPIF--
<?php
if (array_search('ftp',stream_get_wrappers()) === FALSE) die("skip ftp wrapper not available.");
if (!function_exists('pcntl_fork')) die("skip pcntl_fork() not available.");
?>
--FILE--
<?php
$bug77680=1;
require __DIR__ . "/../../../ftp/tests/server.inc";
$path = "ftp://localhost:" . $port."/one/two/three/";
mkdir($path, 0755, true);
?>
==DONE==
--EXPECTF--
string(20) "CWD /one/two/three
"
string(14) "CWD /one/two
"
string(10) "CWD /one
"
string(7) "CWD /
"
string(7) "MKD /
"
string(10) "MKD /one
"
string(14) "MKD /one/two
"
string(20) "MKD /one/two/three
"
==DONE==