Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • Net
  • None
  • PHP
  • system
    • base
    • caching
      • dependencies
    • collections
    • console
    • db
      • ar
      • schema
        • cubrid
        • mssql
        • mysql
        • oci
        • pgsql
        • sqlite
    • i18n
      • gettext
    • logging
    • test
    • utils
    • validators
    • web
      • actions
      • auth
      • filters
      • form
      • helpers
      • renderers
      • services
      • widgets
        • captcha
        • pagers
  • Text
    • Highlighter
  • zii
    • behaviors
    • widgets
      • grid
      • jui

Classes

  • CGettextFile
  • CGettextMoFile
  • CGettextPoFile
  • Overview
  • Package
  • Class
  • Tree

Class CGettextMoFile

CGettextMoFile represents an MO Gettext message file.

This class is written by adapting Michael's Gettext_MO class in PEAR. Please refer to the following license terms.

Copyright (c) 2004-2005, Michael Wallner <mike@iworks.at>. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

CComponent
Extended by CGettextFile
Extended by CGettextMoFile
Package: system\i18n\gettext
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/framework/i18n/gettext/CGettextMoFile.php
Methods summary
public
# __construct( boolean $useBigEndian = false )

Constructor.

Constructor.

Parameters

$useBigEndian
boolean
$useBigEndian whether to use Big Endian when reading and writing an integer.
public array
# load( string $file, string $context )

Loads messages from an MO file.

Loads messages from an MO file.

Parameters

$file
string
$file file path
$context
string
$context message context

Returns

array
message translations (source message => translated message)
public
# save( string $file, array $messages )

Saves messages to an MO file.

Saves messages to an MO file.

Parameters

$file
string
$file file path
$messages
array
$messages message translations (message id => translated message). Note if the message has a context, the message id must be prefixed with the context with chr(4) as the separator.
protected string
# readByte( resource $fr, integer $n = 1 )

Reads one or several bytes.

Reads one or several bytes.

Parameters

$fr
resource
$fr file handle
$n
integer
$n number of bytes to read

Returns

string
bytes
protected integer
# writeByte( resource $fw, string $data )

Writes bytes.

Writes bytes.

Parameters

$fw
resource
$fw file handle
$data
string
$data the data

Returns

integer
how many bytes are written
protected integer
# readInteger( resource $fr )

Reads a 4-byte integer.

Reads a 4-byte integer.

Parameters

$fr
resource
$fr file handle

Returns

integer
the result

See

CGettextMoFile::$useBigEndian
protected integer
# writeInteger( resource $fw, integer $data )

Writes a 4-byte integer.

Writes a 4-byte integer.

Parameters

$fw
resource
$fw file handle
$data
integer
$data the data

Returns

integer
how many bytes are written
protected string
# readString( resource $fr, integer $length, integer $offset = null )

Reads a string.

Reads a string.

Parameters

$fr
resource
$fr file handle
$length
integer
$length string length
$offset
integer
$offset offset of the string in the file. If null, it reads from the current position.

Returns

string
the result
protected integer
# writeString( resource $fw, string $data )

Writes a string.

Writes a string.

Parameters

$fw
resource
$fw file handle
$data
string
$data the string

Returns

integer
how many bytes are written
Methods inherited from CComponent
__call(), __get(), __isset(), __set(), __unset(), asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Properties summary
public boolean $useBigEndian false
#

whether to use Big Endian when reading and writing an integer.

whether to use Big Endian when reading and writing an integer.

API documentation generated by ApiGen 2.8.0