Manifest.php in Drupal 7
File
misc/typo3/phar-stream-wrapper/src/Phar/Manifest.php
View source
<?php
namespace TYPO3\PharStreamWrapper\Phar;
use Brumann\Polyfill\Unserialize;
class Manifest {
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;
}
private $manifestLength;
private $amountOfFiles;
private $apiVersion;
private $flags;
private $aliasLength;
private $alias;
private $metaDataLength;
private $metaData;
private function __construct() {
}
public function getManifestLength() {
return $this->manifestLength;
}
public function getAmountOfFiles() {
return $this->amountOfFiles;
}
public function getApiVersion() {
return $this->apiVersion;
}
public function getFlags() {
return $this->flags;
}
public function getAliasLength() {
return $this->aliasLength;
}
public function getAlias() {
return $this->alias;
}
public function getMetaDataLength() {
return $this->metaDataLength;
}
public function getMetaData() {
return $this->metaData;
}
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;
}
}