\Cake\I18n\ParserMoFileParser

Parses file in PO format

Summary

Methods
Properties
Constants
parse()
No public properties found
MO_LITTLE_ENDIAN_MAGIC
MO_BIG_ENDIAN_MAGIC
MO_HEADER_SIZE
_readLong()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

MO_LITTLE_ENDIAN_MAGIC

MO_LITTLE_ENDIAN_MAGIC = 2500072158 : float

Magic used for validating the format of a MO file as well as detecting if the machine used to create that file was little endian.

MO_BIG_ENDIAN_MAGIC

MO_BIG_ENDIAN_MAGIC = 3725722773 : float

Magic used for validating the format of a MO file as well as detecting if the machine used to create that file was big endian.

MO_HEADER_SIZE

MO_HEADER_SIZE = 28 : integer

The size of the header of a MO file in bytes.

Methods

parse()

parse(resource  $resource) : array

Parses machine object (MO) format, independent of the machine's endian it was created on. Both 32bit and 64bit systems are supported.

Parameters

resource $resource

The file to be parsed.

Throws

\RuntimeException

If stream content has an invalid format.

Returns

array —

List of messages extracted from the file

_readLong()

_readLong(resource  $stream, boolean  $isBigEndian) : integer

Reads an unsigned long from stream respecting endianess.

Parameters

resource $stream

The File being read.

boolean $isBigEndian

Whether or not the current platform is Big Endian

Returns

integer