mirror of
https://codeberg.org/icewind/streams.git
synced 2026-06-03 16:44:07 +02:00
Fix recursive mkdir
This commit is contained in:
parent
b9bba79250
commit
f3b397f504
2 changed files with 8 additions and 1 deletions
|
|
@ -93,7 +93,7 @@ class UrlCallback extends Wrapper implements Url {
|
||||||
public function mkdir($path, $mode, $options) {
|
public function mkdir($path, $mode, $options) {
|
||||||
$context = $this->loadContext($path);
|
$context = $this->loadContext($path);
|
||||||
$this->callCallBack($context, 'mkdir');
|
$this->callCallBack($context, 'mkdir');
|
||||||
return mkdir($context['source'], $mode, $options);
|
return mkdir($context['source'], $mode, $options & STREAM_MKDIR_RECURSIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function rmdir($path, $options) {
|
public function rmdir($path, $options) {
|
||||||
|
|
|
||||||
|
|
@ -129,4 +129,11 @@ class UrlCallBack extends \PHPUnit_Framework_TestCase {
|
||||||
}
|
}
|
||||||
$this->assertTrue($called);
|
$this->assertTrue($called);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testMKDirRecursive() {
|
||||||
|
$dir = $this->getTempDir() . '/test/sad';
|
||||||
|
$path = \Icewind\Streams\UrlCallBack::wrap($dir);
|
||||||
|
mkdir($path, 0700, true);
|
||||||
|
$this->assertTrue(file_exists($dir));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue