summaryrefslogtreecommitdiffstats
path: root/src/php-gettext/streams.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-04-06 19:13:19 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-04-06 19:13:19 +0200
commit7379805565815c576723b888a20af080248222da (patch)
tree498c98e8b6c43c2729349b7680c6a20efcfb98f3 /src/php-gettext/streams.php
parent1e3cd8bf6ee636a5af692b57906612d6109849cb (diff)
parent12c77161aca2c7d76fa5154fa1f4e214106d834b (diff)
downloadSemanticScuttle-origin/quickform.zip
SemanticScuttle-origin/quickform.tar.gz
SemanticScuttle-origin/quickform.tar.bz2
Merge branch 'master' into quickformorigin/quickform
Conflicts: data/templates/bookmarks.tpl.php data/templates/sidebar.block.search.php data/templates/top.inc.php doc/developers/TODO src/SemanticScuttle/header.php
Diffstat (limited to 'src/php-gettext/streams.php')
-rw-r--r--src/php-gettext/streams.php32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/php-gettext/streams.php b/src/php-gettext/streams.php
index 4237de1..3cdc158 100644
--- a/src/php-gettext/streams.php
+++ b/src/php-gettext/streams.php
@@ -1,6 +1,6 @@
<?php
/*
- Copyright (c) 2003, 2005 Danilo Segan <danilo@kvota.net>.
+ Copyright (c) 2003, 2005, 2006, 2009 Danilo Segan <danilo@kvota.net>.
This file is part of PHP-gettext.
@@ -21,29 +21,29 @@
*/
-// Simple class to wrap file streams, string streams, etc.
-// seek is essential, and it should be byte stream
+ // Simple class to wrap file streams, string streams, etc.
+ // seek is essential, and it should be byte stream
class StreamReader {
// should return a string [FIXME: perhaps return array of bytes?]
function read($bytes) {
return false;
}
-
+
// should return new position
function seekto($position) {
return false;
}
-
+
// returns current position
function currentpos() {
return false;
}
-
+
// returns length of entire stream (limit for seekto()s)
function length() {
return false;
}
-}
+};
class StringReader {
var $_pos;
@@ -78,7 +78,7 @@ class StringReader {
return strlen($this->_str);
}
-}
+};
class FileReader {
@@ -93,8 +93,8 @@ class FileReader {
$this->_pos = 0;
$this->_fd = fopen($filename,'rb');
if (!$this->_fd) {
- $this->error = 3; // Cannot read file, probably permissions
- return false;
+ $this->error = 3; // Cannot read file, probably permissions
+ return false;
}
} else {
$this->error = 2; // File doesn't exist
@@ -115,7 +115,7 @@ class FileReader {
$bytes -= strlen($chunk);
}
$this->_pos = ftell($this->_fd);
-
+
return $data;
} else return '';
}
@@ -138,9 +138,9 @@ class FileReader {
fclose($this->_fd);
}
-}
+};
-// Preloads entire file in memory first, then creates a StringReader
+// Preloads entire file in memory first, then creates a StringReader
// over it (it assumes knowledge of StringReader internals)
class CachedFileReader extends StringReader {
function CachedFileReader($filename) {
@@ -150,8 +150,8 @@ class CachedFileReader extends StringReader {
$fd = fopen($filename,'rb');
if (!$fd) {
- $this->error = 3; // Cannot read file, probably permissions
- return false;
+ $this->error = 3; // Cannot read file, probably permissions
+ return false;
}
$this->_str = fread($fd, $length);
fclose($fd);
@@ -161,7 +161,7 @@ class CachedFileReader extends StringReader {
return false;
}
}
-}
+};
?>