Fr3nch13/CakePHP Utilities

MoFileParser
in package

Parses file in MO format

Tags
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

Table of Contents

Constants

MO_BIG_ENDIAN_MAGIC  = 0xde120495
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  = 28
The size of the header of a MO file in bytes.
MO_LITTLE_ENDIAN_MAGIC  = 0x950412de
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.

Methods

parse()  : array<string|int, mixed>
Parses machine object (MO) format, independent of the machine's endian it was created on. Both 32bit and 64bit systems are supported.
_readLong()  : int
Reads an unsigned long from stream respecting endianess.

Constants

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.

public int MO_BIG_ENDIAN_MAGIC = 0xde120495

MO_HEADER_SIZE

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

public int MO_HEADER_SIZE = 28

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.

public int MO_LITTLE_ENDIAN_MAGIC = 0x950412de

Methods

parse()

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

public parse(string $file) : array<string|int, mixed>
Parameters
$file : string

The file to be parsed.

Tags
throws
RuntimeException

If stream content has an invalid format.

Return values
array<string|int, mixed>

List of messages extracted from the file

_readLong()

Reads an unsigned long from stream respecting endianess.

protected _readLong(resource $stream, bool $isBigEndian) : int
Parameters
$stream : resource

The File being read.

$isBigEndian : bool

Whether the current platform is Big Endian

Return values
int

        
On this page

Search results