Skip to content

Commit db0cf6d

Browse files
committed
Fix fopen issue with context param on PHP 7.1 and 7.2
1 parent 89fcf8d commit db0cf6d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/FileEncrypter.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,9 @@ protected function openDestFile($destPath)
176176

177177
protected function openSourceFile($sourcePath)
178178
{
179-
$context = Str::startsWith($sourcePath, 's3://')
180-
? stream_context_create(['s3' => ['seekable' => true]])
181-
: null;
179+
$contextOpts = Str::startsWith($sourcePath, 's3://') ? ['s3' => ['seekable' => true]] : [];
182180

183-
if (($fpIn = fopen($sourcePath, 'r', false, $context)) === false) {
181+
if (($fpIn = fopen($sourcePath, 'r', false, stream_context_create($contextOpts))) === false) {
184182
throw new Exception('Cannot open file for reading');
185183
}
186184

0 commit comments

Comments
 (0)