Class MoFileParser

Parses file in PO format

Namespace: Cake\I18n\Parser
Copyright: Copyright (c) 2010, Union of RAD http://union-of-rad.org (http://lithify.me/)
Copyright: Copyright (c) 2014, Fabien Potencier https://github.com/symfony/Translation/blob/master/LICENSE
Located at I18n/Parser/MoFileParser.php

Method Detail

_readLongsource protected

_readLong( resource $stream , boolean $isBigEndian )

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
int

parsesource public

parse( resource $resource )

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.

Returns

array
List of messages extracted from the file

Throws

RuntimeException
If stream content has an invalid format.

Constants summary

float MO_BIG_ENDIAN_MAGIC

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.

0xde120495
integer MO_HEADER_SIZE

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

28
float MO_LITTLE_ENDIAN_MAGIC

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.

0x950412de

© 2005–2016 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
http://api.cakephp.org/3.1/class-Cake.I18n.Parser.MoFileParser.html