Property | Type | Description | |
---|---|---|---|
$useBigEndian | whether to use big-endian when reading and writing an integer. |
Method | Description | |
---|---|---|
load ( string $filePath, string $context ) : array | Loads messages from an MO file. | |
save ( string $filePath, array $messages ) | Saves messages to an MO file. |
Method | Description | |
---|---|---|
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. |
protected readInteger ( resource $fileHandle ) : integer | ||
$fileHandle | resource | to read from |
return | integer | the result |
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. |
protected writeBytes ( resource $fileHandle, string $bytes ) : integer | ||
$fileHandle | resource | to write to |
$bytes | string | to be written |
return | integer | how many bytes are written |
protected writeInteger ( resource $fileHandle, integer $integer ) : integer | ||
$fileHandle | resource | to write to |
$integer | integer | to be written |
return | integer | how many bytes are written |
protected writeString ( resource $fileHandle, string $string ) : integer | ||
$fileHandle | resource | to write to |
$string | string | to be written |
return | integer | how many bytes are written |