You are here

public static function Manifest::fromContent in Drupal 7

Parameters

string $content:

Return value

self

See also

http://php.net/manual/en/phar.fileformat.phar.php

1 call to Manifest::fromContent()
Reader::resolveContainer in misc/typo3/phar-stream-wrapper/src/Phar/Reader.php

File

misc/typo3/phar-stream-wrapper/src/Phar/Manifest.php, line 23

Class

Manifest

Namespace

TYPO3\PharStreamWrapper\Phar

Code

public static function fromContent($content) {
  $target = new static();
  $target->manifestLength = Reader::resolveFourByteLittleEndian($content, 0);
  $target->amountOfFiles = Reader::resolveFourByteLittleEndian($content, 4);
  $target->flags = Reader::resolveFourByteLittleEndian($content, 10);
  $target->aliasLength = Reader::resolveFourByteLittleEndian($content, 14);
  $target->alias = substr($content, 18, $target->aliasLength);
  $target->metaDataLength = Reader::resolveFourByteLittleEndian($content, 18 + $target->aliasLength);
  $target->metaData = substr($content, 22 + $target->aliasLength, $target->metaDataLength);
  $apiVersionNibbles = Reader::resolveTwoByteBigEndian($content, 8);
  $target->apiVersion = implode('.', array(
    ($apiVersionNibbles & 0xf000) >> 12,
    ($apiVersionNibbles & 0xf00) >> 8,
    ($apiVersionNibbles & 0xf0) >> 4,
  ));
  return $target;
}