Make WordPress Core


Ignore:
Timestamp:
10/31/2012 10:13:51 PM (12 years ago)
Author:
nbachiyski
Message:

Sync POMO with GlotPress

See http://glotpress.trac.wordpress.org/browser/trunk/pomo/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/pomo/streams.php

    r18528 r22349  
    44 * Based on the classes from Danilo Segan <danilo@kvota.net>
    55 *
    6  * @version $Id: streams.php 597 2011-01-16 20:14:36Z nbachiyski $
     6 * @version $Id: streams.php 718 2012-10-31 00:32:02Z nbachiyski $
    77 * @package pomo
    88 * @subpackage streams
     
    1111if ( !class_exists( 'POMO_Reader' ) ):
    1212class POMO_Reader {
    13    
     13
    1414    var $endian = 'little';
    1515    var $_post = '';
    16    
     16
    1717    function POMO_Reader() {
    1818        $this->is_overloaded = ((ini_get("mbstring.func_overload") & 2) != 0) && function_exists('mb_substr');
    1919        $this->_pos = 0;
    2020    }
    21    
     21
    2222    /**
    2323     * Sets the endianness of the file.
     
    5858        return unpack($endian_letter.$count, $bytes);
    5959    }
    60    
    61    
     60
     61
    6262    function substr($string, $start, $length) {
    6363        if ($this->is_overloaded) {
     
    6767        }
    6868    }
    69    
     69
    7070    function strlen($string) {
    7171        if ($this->is_overloaded) {
     
    7575        }
    7676    }
    77    
     77
    7878    function str_split($string, $chunk_size) {
    7979        if (!function_exists('str_split')) {
     
    8787        }
    8888    }
    89    
    90        
     89
     90
    9191    function pos() {
    9292        return $this->_pos;
     
    9696        return true;
    9797    }
    98    
     98
    9999    function close() {
    100100        return true;
     
    109109        $this->_f = fopen($filename, 'rb');
    110110    }
    111    
     111
    112112    function read($bytes) {
    113113        return fread($this->_f, $bytes);
    114114    }
    115    
     115
    116116    function seekto($pos) {
    117117        if ( -1 == fseek($this->_f, $pos, SEEK_SET)) {
     
    121121        return true;
    122122    }
    123    
     123
    124124    function is_resource() {
    125125        return is_resource($this->_f);
    126126    }
    127    
     127
    128128    function feof() {
    129129        return feof($this->_f);
    130130    }
    131    
     131
    132132    function close() {
    133133        return fclose($this->_f);
    134134    }
    135    
     135
    136136    function read_all() {
    137137        $all = '';
     
    149149 */
    150150class POMO_StringReader extends POMO_Reader {
    151    
     151
    152152    var $_str = '';
    153    
     153
    154154    function POMO_StringReader($str = '') {
    155155        parent::POMO_Reader();
     
    179179        return $this->substr($this->_str, $this->_pos, $this->strlen($this->_str));
    180180    }
    181    
     181
    182182}
    183183endif;
Note: See TracChangeset for help on using the changeset viewer.