PHP 클래스 yii\i18n\GettextMoFile

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 . 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.
부터: 2.0
저자: Qiang Xue ([email protected])
상속: extends yii\i18n\GettextFile
파일 보기 프로젝트 열기: yiisoft/yii2 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$useBigEndian whether to use big-endian when reading and writing an integer.

공개 메소드들

메소드 설명
load ( string $filePath, string $context ) : array Loads messages from an MO file.
save ( string $filePath, array $messages ) Saves messages to an MO file.

보호된 메소드들

메소드 설명
readBytes ( resource $fileHandle, integer $byteCount = 1 ) : string Reads one or several bytes.
readInteger ( resource $fileHandle ) : integer Reads a 4-byte integer.
readString ( resource $fileHandle, integer $length, integer $offset = null ) : string Reads a string.
writeBytes ( resource $fileHandle, string $bytes ) : integer Write bytes.
writeInteger ( resource $fileHandle, integer $integer ) : integer Writes a 4-byte integer.
writeString ( resource $fileHandle, string $string ) : integer Writes a string.

메소드 상세

load() 공개 메소드

Loads messages from an MO file.
public load ( string $filePath, string $context ) : array
$filePath string file path
$context string message context
리턴 array message translations. Array keys are source messages and array values are translated messages: source message => translated message.

readBytes() 보호된 메소드

Reads one or several bytes.
protected readBytes ( resource $fileHandle, integer $byteCount = 1 ) : string
$fileHandle resource to read from
$byteCount integer to be read
리턴 string bytes

readInteger() 보호된 메소드

Reads a 4-byte integer.
protected readInteger ( resource $fileHandle ) : integer
$fileHandle resource to read from
리턴 integer the result

readString() 보호된 메소드

Reads a string.
protected readString ( resource $fileHandle, integer $length, integer $offset = null ) : string
$fileHandle resource file handle
$length integer of the string
$offset integer of the string in the file. If null, it reads from the current position.
리턴 string the result

save() 공개 메소드

Saves messages to an MO file.
public save ( string $filePath, array $messages )
$filePath string file path
$messages array message translations. Array keys are source messages and array values are translated messages: source message => translated message. Note if the message has a context, the message ID must be prefixed with the context with chr(4) as the separator.

writeBytes() 보호된 메소드

Write bytes.
protected writeBytes ( resource $fileHandle, string $bytes ) : integer
$fileHandle resource to write to
$bytes string to be written
리턴 integer how many bytes are written

writeInteger() 보호된 메소드

Writes a 4-byte integer.
protected writeInteger ( resource $fileHandle, integer $integer ) : integer
$fileHandle resource to write to
$integer integer to be written
리턴 integer how many bytes are written

writeString() 보호된 메소드

Writes a string.
protected writeString ( resource $fileHandle, string $string ) : integer
$fileHandle resource to write to
$string string to be written
리턴 integer how many bytes are written

프로퍼티 상세

$useBigEndian 공개적으로 프로퍼티

whether to use big-endian when reading and writing an integer.
public $useBigEndian