var $endian = 'little';
var $_post = '';
- function POMO_Reader() {
+ /**
+ * PHP5 constructor.
+ */
+ function __construct() {
$this->is_overloaded = ((ini_get("mbstring.func_overload") & 2) != 0) && function_exists('mb_substr');
$this->_pos = 0;
}
+ /**
+ * PHP4 constructor.
+ */
+ public function POMO_Reader() {
+ self::__construct();
+ }
+
/**
* Sets the endianness of the file.
*
}
}
-
+ /**
+ * @return int
+ */
function pos() {
return $this->_pos;
}
+ /**
+ * @return true
+ */
function is_resource() {
return true;
}
+ /**
+ * @return true
+ */
function close() {
return true;
}
/**
* @param string $filename
*/
- function POMO_FileReader($filename) {
+ function __construct( $filename ) {
parent::POMO_Reader();
$this->_f = fopen($filename, 'rb');
}
+ /**
+ * PHP4 constructor.
+ */
+ public function POMO_FileReader( $filename ) {
+ self::__construct( $filename );
+ }
+
/**
* @param int $bytes
*/
return true;
}
+ /**
+ * @return bool
+ */
function is_resource() {
return is_resource($this->_f);
}
+ /**
+ * @return bool
+ */
function feof() {
return feof($this->_f);
}
+ /**
+ * @return bool
+ */
function close() {
return fclose($this->_f);
}
+ /**
+ * @return string
+ */
function read_all() {
$all = '';
while ( !$this->feof() )
var $_str = '';
- function POMO_StringReader($str = '') {
+ /**
+ * PHP5 constructor.
+ */
+ function __construct( $str = '' ) {
parent::POMO_Reader();
$this->_str = $str;
$this->_pos = 0;
}
+ /**
+ * PHP4 constructor.
+ */
+ public function POMO_StringReader( $str = '' ) {
+ self::__construct( $str );
+ }
+
/**
* @param string $bytes
* @return string
return $this->_pos;
}
+ /**
+ * @return int
+ */
function length() {
return $this->strlen($this->_str);
}
+ /**
+ * @return string
+ */
function read_all() {
return $this->substr($this->_str, $this->_pos, $this->strlen($this->_str));
}
* Reads the contents of the file in the beginning.
*/
class POMO_CachedFileReader extends POMO_StringReader {
- function POMO_CachedFileReader($filename) {
+ /**
+ * PHP5 constructor.
+ */
+ function __construct( $filename ) {
parent::POMO_StringReader();
$this->_str = file_get_contents($filename);
if (false === $this->_str)
return false;
$this->_pos = 0;
}
+
+ /**
+ * PHP4 constructor.
+ */
+ public function POMO_CachedFileReader( $filename ) {
+ self::__construct( $filename );
+ }
}
endif;
* Reads the contents of the file in the beginning.
*/
class POMO_CachedIntFileReader extends POMO_CachedFileReader {
- function POMO_CachedIntFileReader($filename) {
+ /**
+ * PHP5 constructor.
+ */
+ public function __construct( $filename ) {
parent::POMO_CachedFileReader($filename);
}
+
+ /**
+ * PHP4 constructor.
+ */
+ function POMO_CachedIntFileReader( $filename ) {
+ self::__construct( $filename );
+ }
}
-endif;
\ No newline at end of file
+endif;
+