You are here

public function Reader::resolveContainer in Drupal 7

Return value

Container

File

misc/typo3/phar-stream-wrapper/src/Phar/Reader.php, line 50

Class

Reader

Namespace

TYPO3\PharStreamWrapper\Phar

Code

public function resolveContainer() {
  $data = $this
    ->extractData($this
    ->resolveStream() . $this->fileName);
  if ($data['stubContent'] === null) {
    throw new ReaderException('Cannot resolve stub', 1547807881);
  }
  if ($data['manifestContent'] === null || $data['manifestLength'] === null) {
    throw new ReaderException('Cannot resolve manifest', 1547807882);
  }
  if (strlen($data['manifestContent']) < $data['manifestLength']) {
    throw new ReaderException(sprintf('Exected manifest length %d, got %d', strlen($data['manifestContent']), $data['manifestLength']), 1547807883);
  }
  return new Container(Stub::fromContent($data['stubContent']), Manifest::fromContent($data['manifestContent']));
}