Skip to content

Commit c492db9

Browse files
committed
Add mode parameter to wrapSource
Signed-off-by: Julius Härtl <jus@bitgrid.net>
1 parent 93bce47 commit c492db9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/WrapperHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ private static function buildContext($protocol, $context, $source) {
5757
* @param string|null $class deprecated, class is now automatically generated
5858
* @return bool|resource
5959
*/
60-
protected static function wrapSource($source, $context = [], $protocol = null, $class = null) {
60+
protected static function wrapSource($source, $context = [], $protocol = null, $class = null, $mode = 'r+') {
6161
if ($class === null) {
6262
$class = static::class;
6363
}
@@ -72,7 +72,7 @@ protected static function wrapSource($source, $context = [], $protocol = null, $
7272
if (self::isDirectoryHandle($source)) {
7373
return opendir($protocol . '://', $context);
7474
} else {
75-
return fopen($protocol . '://', 'r+', false, $context);
75+
return fopen($protocol . '://', $mode, false, $context);
7676
}
7777
} finally {
7878
stream_wrapper_unregister($protocol);

0 commit comments

Comments
 (0)