mirror of
https://codeberg.org/icewind/streams.git
synced 2026-06-04 00:54:08 +02:00
Add directory support to wrappers
This commit is contained in:
parent
448dfc577c
commit
53cfe7f4f1
5 changed files with 121 additions and 28 deletions
|
|
@ -24,19 +24,16 @@ class NullWrapper extends Wrapper {
|
|||
'null' => array(
|
||||
'source' => $source)
|
||||
));
|
||||
stream_wrapper_register('null', '\Icewind\Streams\NullWrapper');
|
||||
try {
|
||||
$wrapped = fopen('null://', 'r+', false, $context);
|
||||
} catch (\BadMethodCallException $e) {
|
||||
stream_wrapper_unregister('null');
|
||||
throw $e;
|
||||
}
|
||||
stream_wrapper_unregister('null');
|
||||
return $wrapped;
|
||||
return Wrapper::wrapSource($source, $context, 'null', '\Icewind\Streams\NullWrapper');
|
||||
}
|
||||
|
||||
public function stream_open($path, $mode, $options, &$opened_path) {
|
||||
$this->loadContext('null');
|
||||
return true;
|
||||
}
|
||||
|
||||
public function dir_opendir($path, $options) {
|
||||
$this->loadContext('null');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue