Lines Matching defs:header

121             $header = $this->parseHeader($read);
122 if (!is_array($header)) {
126 $this->contentUntil = $this->position + $header['size'];
127 $this->skipUntil = $this->position + ceil($header['size'] / 512) * 512;
129 yield $this->header2fileinfo($header);
199 // read the file header
200 $header = $this->parseHeader($dat);
201 if (!is_array($header)) {
204 $fileinfo = $this->header2fileinfo($header);
211 $this->skipbytes(ceil($header['size'] / 512) * 512);
229 $size = floor($header['size'] / 512);
233 if (($header['size'] % 512) != 0) {
234 fwrite($fp, $this->readbytes(512), $header['size'] % 512);
241 $this->skipbytes(ceil($header['size'] / 512) * 512); // the size is usually 0 for directories
310 // create file header
547 * Write the given file meta data as header
566 * Write a file header to the stream
624 * Decode the given tar file header
626 * @param string $block a 512 byte block containing the header data
633 throw new ArchiveCorruptedException('Unexpected length of header');
647 $header = @unpack(
651 if (!$header) {
652 throw new ArchiveCorruptedException('Failed to parse header');
655 $return['checksum'] = OctDec(trim($header['checksum']));
660 $return['filename'] = trim($header['filename']);
661 $return['perm'] = OctDec(trim($header['perm']));
662 $return['uid'] = OctDec(trim($header['uid']));
663 $return['gid'] = OctDec(trim($header['gid']));
664 $return['size'] = self::numberDecode($header['size']);
665 $return['mtime'] = self::numberDecode($header['mtime']);
666 $return['typeflag'] = $header['typeflag'];
667 $return['link'] = trim($header['link']);
668 $return['uname'] = trim($header['uname']);
669 $return['gname'] = trim($header['gname']);
672 if (trim($header['prefix'])) {
673 $return['filename'] = trim($header['prefix']).'/'.$return['filename'];
680 // next block is the real header
691 * Creates a FileInfo object from the given parsed header
693 * @param $header
696 protected function header2fileinfo($header)
699 $fileinfo->setPath($header['filename']);
700 $fileinfo->setMode($header['perm']);
701 $fileinfo->setUid($header['uid']);
702 $fileinfo->setGid($header['gid']);
703 $fileinfo->setSize($header['size']);
704 $fileinfo->setMtime($header['mtime']);
705 $fileinfo->setOwner($header['uname']);
706 $fileinfo->setGroup($header['gname']);
707 $fileinfo->setIsdir((bool) $header['typeflag']);