protected function extract()
	{
		$magic = $this->readInt( 'V' );

		if( ( $magic === self::MAGIC1 ) || ( $magic === self::MAGIC3 ) ) { //to make sure it works for 64-bit platforms
			$byteOrder = 'V'; //low endian
		} elseif( $magic === ( self::MAGIC2 & 0xFFFFFFFF ) ) {
			$byteOrder = 'N'; //big endian
		} else {
			throw new \Aimeos\MW\Translation\Exception( 'Invalid MO file' );
		}

		$this->readInt( $byteOrder );
		$total = $this->readInt( $byteOrder ); //total string count
		$originals = $this->readInt( $byteOrder ); //offset of original table
		$trans = $this->readInt( $byteOrder ); //offset of translation table

		$this->seekto( $originals );
		$originalTable = $this->readIntArray( $byteOrder, $total * 2 );
		$this->seekto( $trans );
		$translationTable = $this->readIntArray( $byteOrder, $total * 2 );

		return $this->extractTable( $originalTable, $translationTable, $total );
	}
protected function extract()
	{
		$magic = $this->readInt( 'V' );

		if( ( $magic === self::MAGIC1 ) || ( $magic === self::MAGIC3 ) ) { //to make sure it works for 64-bit platforms
			$byteOrder = 'V'; //low endian
		} elseif( $magic === ( self::MAGIC2 & 0xFFFFFFFF ) ) {
			$byteOrder = 'N'; //big endian
		} else {
			throw new \Aimeos\MW\Translation\Exception( 'Invalid MO file' );
		}

		$this->readInt( $byteOrder );
		$total = $this->readInt( $byteOrder ); //total string count
		$originals = $this->readInt( $byteOrder ); //offset of original table
		$trans = $this->readInt( $byteOrder ); //offset of translation table

		$this->seekto( $originals );
		$originalTable = $this->readIntArray( $byteOrder, $total * 2 );
		$this->seekto( $trans );
		$translationTable = $this->readIntArray( $byteOrder, $total * 2 );

		return $this->extractTable( $originalTable, $translationTable, $total );
	}
protected function extract ( ) { $ magic = $ this -> readInt ( 'V' ) ; if ( ( $ magic === self :: MAGIC1 ) || ( $ magic === self :: MAGIC3 ) ) { //to make sure it works for 64-bit platforms $ byteOrder = 'V' ; //low endian } elseif ( $ magic === ( self :: MAGIC2 & 0xFFFFFFFF ) ) { $ byteOrder = 'N' ; //big endian } else { throw new \ Aimeos \ MW \ Translation \ Exception ( 'Invalid MO file' ) ; } $ this -> readInt ( $ byteOrder ) ; $ total = $ this -> readInt ( $ byteOrder ) ; //total string count $ originals = $ this -> readInt ( $ byteOrder ) ; //offset of original table $ trans = $ this -> readInt ( $ byteOrder ) ; //offset of translation table $ this -> seekto ( $ originals ) ; $ originalTable = $ this -> readIntArray ( $ byteOrder , $ total * 2 ) ; $ this -> seekto ( $ trans ) ; $ translationTable = $ this -> readIntArray ( $ byteOrder , $ total * 2 ) ; return $ this -> extractTable ( $ originalTable , $ translationTable , $ total ) ; }
Extracts the messages and translations from the MO file

@throws \Aimeos\MW\Translation\Exception If file content is invalid
@return array Associative list of original singular as keys and one or more translations as values
Extracts the messages and translations from the MO file