mirror of
https://codeberg.org/icewind/streams.git
synced 2026-06-03 08:34:09 +02:00
Add mode parameter to wrapSource
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
93bce47220
commit
c492db92a2
1 changed files with 2 additions and 2 deletions
|
|
@ -57,7 +57,7 @@ class WrapperHandler {
|
|||
* @param string|null $class deprecated, class is now automatically generated
|
||||
* @return bool|resource
|
||||
*/
|
||||
protected static function wrapSource($source, $context = [], $protocol = null, $class = null) {
|
||||
protected static function wrapSource($source, $context = [], $protocol = null, $class = null, $mode = 'r+') {
|
||||
if ($class === null) {
|
||||
$class = static::class;
|
||||
}
|
||||
|
|
@ -72,7 +72,7 @@ class WrapperHandler {
|
|||
if (self::isDirectoryHandle($source)) {
|
||||
return opendir($protocol . '://', $context);
|
||||
} else {
|
||||
return fopen($protocol . '://', 'r+', false, $context);
|
||||
return fopen($protocol . '://', $mode, false, $context);
|
||||
}
|
||||
} finally {
|
||||
stream_wrapper_unregister($protocol);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue