Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description" : "Text encoding",
"keywords": ["module", "xp"],
"require" : {
"xp-framework/core": "^11.0 | ^10.0",
"xp-framework/core": "^12.11 | ^11.11",
"php" : ">=7.0.0"
},
"require-dev" : {
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/text/encode/Base64InputStream.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Base64InputStream implements InputStream {
public function __construct(InputStream $in) {
$this->in= Streams::readableFd($in);
if (!stream_filter_append($this->in, 'convert.base64-decode', STREAM_FILTER_READ)) {
throw new \io\IOException('Could not append stream filter');
throw new \io\OperationFailed('Could not append stream filter');
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/php/text/encode/Base64OutputStream.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __construct(OutputStream $out, $lineLength= 0) {
$params= $lineLength ? ['line-length' => $lineLength, 'line-break-chars' => "\n"] : [];
$this->out= Streams::writeableFd($out);
if (!stream_filter_append($this->out, 'convert.base64-encode', STREAM_FILTER_WRITE, $params)) {
throw new \io\IOException('Could not append stream filter');
throw new \io\OperationFailed('Could not append stream filter');
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function read($limit= 8192) {
$o+= 1;
} else {
if (1 !== sscanf($h= substr($read, $o, 2), '%x', $c)) {
throw new \io\IOException('Invalid byte sequence "='.$h.'"');
throw new \io\OperationFailed('Invalid byte sequence "='.$h.'"');
}
$this->buffer.= chr($c);
$o+= 2;
Expand Down
Loading