function Reader::resolveContainer

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']));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.