Lines Matching refs:header
116 $header = $this->parseHeader($read);
117 if (!is_array($header)) {
121 $this->skipbytes(ceil($header['size'] / 512) * 512);
122 yield $this->header2fileinfo($header);
169 // read the file header
170 $header = $this->parseHeader($dat);
171 if (!is_array($header)) {
174 $fileinfo = $this->header2fileinfo($header);
181 $this->skipbytes(ceil($header['size'] / 512) * 512);
199 $size = floor($header['size'] / 512);
203 if (($header['size'] % 512) != 0) {
204 fwrite($fp, $this->readbytes(512), $header['size'] % 512);
211 $this->skipbytes(ceil($header['size'] / 512) * 512); // the size is usually 0 for directories
280 // create file header
500 * Write the given file meta data as header
519 * Write a file header to the stream
577 * Decode the given tar file header
579 * @param string $block a 512 byte block containing the header data
586 throw new ArchiveCorruptedException('Unexpected length of header');
600 $header = @unpack(
604 if (!$header) {
605 throw new ArchiveCorruptedException('Failed to parse header');
608 $return['checksum'] = OctDec(trim($header['checksum']));
613 $return['filename'] = trim($header['filename']);
614 $return['perm'] = OctDec(trim($header['perm']));
615 $return['uid'] = OctDec(trim($header['uid']));
616 $return['gid'] = OctDec(trim($header['gid']));
617 $return['size'] = OctDec(trim($header['size']));
618 $return['mtime'] = OctDec(trim($header['mtime']));
619 $return['typeflag'] = $header['typeflag'];
620 $return['link'] = trim($header['link']);
621 $return['uname'] = trim($header['uname']);
622 $return['gname'] = trim($header['gname']);
625 if (trim($header['prefix'])) {
626 $return['filename'] = trim($header['prefix']).'/'.$return['filename'];
633 // next block is the real header
644 * Creates a FileInfo object from the given parsed header
646 * @param $header
649 protected function header2fileinfo($header)
652 $fileinfo->setPath($header['filename']);
653 $fileinfo->setMode($header['perm']);
654 $fileinfo->setUid($header['uid']);
655 $fileinfo->setGid($header['gid']);
656 $fileinfo->setSize($header['size']);
657 $fileinfo->setMtime($header['mtime']);
658 $fileinfo->setOwner($header['uname']);
659 $fileinfo->setGroup($header['gname']);
660 $fileinfo->setIsdir((bool) $header['typeflag']);