Skip to content

Commit

Permalink
FileMutator: works only in reading mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Aug 11, 2019
1 parent 80dfec3 commit e81326e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Framework/FileMutator.php
Expand Up @@ -135,7 +135,7 @@ public function stream_metadata(string $path, int $option, $value): bool
public function stream_open(string $path, string $mode, int $options, ?string &$openedPath): bool
{
$usePath = (bool) ($options & STREAM_USE_PATH);
if (pathinfo($path, PATHINFO_EXTENSION) === 'php') {
if ($mode === 'rb' && pathinfo($path, PATHINFO_EXTENSION) === 'php') {
$content = $this->native('file_get_contents', $path, $usePath, $this->context);
if ($content === false) {
return false;
Expand Down

0 comments on commit e81326e

Please sign in to comment.