class Manifest

Hierarchy

  • class \TYPO3\PharStreamWrapper\Phar\Manifest

Expanded class hierarchy of Manifest

File

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

Namespace

TYPO3\PharStreamWrapper\Phar
View source
class Manifest {
    
    /**
     * @param string $content
     * @return self
     * @see http://php.net/manual/en/phar.fileformat.phar.php
     */
    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;
    }
    
    /**
     * @var int
     */
    private $manifestLength;
    
    /**
     * @var int
     */
    private $amountOfFiles;
    
    /**
     * @var string
     */
    private $apiVersion;
    
    /**
     * @var int
     */
    private $flags;
    
    /**
     * @var int
     */
    private $aliasLength;
    
    /**
     * @var string
     */
    private $alias;
    
    /**
     * @var int
     */
    private $metaDataLength;
    
    /**
     * @var string
     */
    private $metaData;
    
    /**
     * Avoid direct instantiation.
     */
    private function __construct() {
    }
    
    /**
     * @return int
     */
    public function getManifestLength() {
        return $this->manifestLength;
    }
    
    /**
     * @return int
     */
    public function getAmountOfFiles() {
        return $this->amountOfFiles;
    }
    
    /**
     * @return string
     */
    public function getApiVersion() {
        return $this->apiVersion;
    }
    
    /**
     * @return int
     */
    public function getFlags() {
        return $this->flags;
    }
    
    /**
     * @return int
     */
    public function getAliasLength() {
        return $this->aliasLength;
    }
    
    /**
     * @return string
     */
    public function getAlias() {
        return $this->alias;
    }
    
    /**
     * @return int
     */
    public function getMetaDataLength() {
        return $this->metaDataLength;
    }
    
    /**
     * @return string
     */
    public function getMetaData() {
        return $this->metaData;
    }
    
    /**
     * @return mixed|null
     */
    public function deserializeMetaData() {
        if (empty($this->metaData)) {
            return null;
        }
        $result = Unserialize::unserialize($this->metaData, array(
            'allowed_classes' => false,
        ));
        $serialized = json_encode($result);
        if (strpos($serialized, '__PHP_Incomplete_Class_Name') !== false) {
            throw new DeserializationException('Meta-data contains serialized object', 1539623382);
        }
        return $result;
    }

}

Members

Title Sort descending Modifiers Object type Summary
Manifest::$alias private property
Manifest::$aliasLength private property
Manifest::$amountOfFiles private property
Manifest::$apiVersion private property
Manifest::$flags private property
Manifest::$manifestLength private property
Manifest::$metaData private property
Manifest::$metaDataLength private property
Manifest::deserializeMetaData public function
Manifest::fromContent public static function
Manifest::getAlias public function
Manifest::getAliasLength public function
Manifest::getAmountOfFiles public function
Manifest::getApiVersion public function
Manifest::getFlags public function
Manifest::getManifestLength public function
Manifest::getMetaData public function
Manifest::getMetaDataLength public function
Manifest::__construct private function Avoid direct instantiation.

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