Lines Matching defs:fileinfo
93 foreach ($this->yieldContents() as $fileinfo) {
94 $result[] = $fileinfo;
174 $fileinfo = $this->header2fileinfo($header);
177 $fileinfo->strip($strip);
180 if (!strlen($fileinfo->getPath()) || !$fileinfo->matchExpression($include, $exclude)) {
186 $output = $outdir.'/'.$fileinfo->getPath();
187 $directory = ($fileinfo->getIsdir()) ? $output : dirname($output);
193 if (!$fileinfo->getIsdir()) {
208 @touch($output, $fileinfo->getMtime());
209 @chmod($output, $fileinfo->getMode());
215 call_user_func($this->callback, $fileinfo);
217 $extracted[] = $fileinfo;
265 * @param string|FileInfo $fileinfo either the name to us in archive (string) or a FileInfo oject with all meta data, empty to take from original
270 public function addFile($file, $fileinfo = '')
272 if (is_string($fileinfo)) {
273 $fileinfo = FileInfo::fromPath($file, $fileinfo);
281 $this->writeFileHeader($fileinfo);
286 if (!$fileinfo->getIsdir() && $fileinfo->getSize() > 0) {
306 if ($read != $fileinfo->getSize()) {
308 throw new ArchiveCorruptedException("The size of $file changed while reading, archive corrupted. read $read expected ".$fileinfo->getSize());
313 call_user_func($this->callback, $fileinfo);
320 * @param string|FileInfo $fileinfo either the name to us in archive (string) or a FileInfo oject with all meta data
324 public function addData($fileinfo, $data)
326 if (is_string($fileinfo)) {
327 $fileinfo = new FileInfo($fileinfo);
335 $fileinfo->setSize($len);
336 $this->writeFileHeader($fileinfo);
343 call_user_func($this->callback, $fileinfo);
502 * @param FileInfo $fileinfo
505 protected function writeFileHeader(FileInfo $fileinfo)
508 $fileinfo->getPath(),
509 $fileinfo->getUid(),
510 $fileinfo->getGid(),
511 $fileinfo->getMode(),
512 $fileinfo->getSize(),
513 $fileinfo->getMtime(),
514 $fileinfo->getIsdir() ? '5' : '0'
651 $fileinfo = new FileInfo();
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']);
662 return $fileinfo;