Skip to content

Commit

Permalink
Issue #2 Fix check for writeable resource
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehaertl committed Feb 16, 2017
1 parent b2a2295 commit 4671773
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# CHANGELOG

## 1.2.1

* Issue #2: Fix check for writeable resource. (ndobromirov)

## 1.2.0

* Issue #2: Improve performance by not opening a new filepointer on every call to
`export()`. Also add new feature to supply an opened resource in `$fp`. (ndobromirov)
`export()`. (ndobromirov)
* Issue #2: Add new feature to supply an opened resource in `$fp`. (ndobromirov)

## 1.1.0

Expand Down
2 changes: 1 addition & 1 deletion src/Target.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function setFp($value)
throw new InvalidConfigException("Invalid resource.");
}
$metadata = stream_get_meta_data($value);
if ($metadata['mode']!=='w') {
if (!in_array($metadata['mode'], ['w', 'wb', 'a', 'ab'])) {
throw new InvalidConfigException("Resource is not writeable.");
}
$this->fp = $value;
Expand Down

0 comments on commit 4671773

Please sign in to comment.