Lines Matching refs:file
20 protected $file = ''; variable in splitbrain\\PHPArchive\\Tar
53 * @param string $file
57 public function open($file) argument
59 $this->file = $file;
63 $this->setCompression($this->complevel, $this->filetype($file));
68 $this->fh = @gzopen($this->file, 'rb');
70 $this->fh = @bzopen($this->file, 'r');
72 $this->fh = @fopen($this->file, 'rb');
76 throw new ArchiveIOException('Could not open file for reading: '.$this->file);
116 if ($this->closed || !$this->file) {
187 if ($this->closed || !$this->file) {
259 * @param string $file
263 public function create($file = '') argument
265 $this->file = $file;
269 if ($this->file) {
272 $this->setCompression($this->complevel, $this->filetype($file));
276 $this->fh = @gzopen($this->file, 'wb'.$this->complevel);
278 $this->fh = @bzopen($this->file, 'w');
280 $this->fh = @fopen($this->file, 'wb');
284 throw new ArchiveIOException('Could not open file for writing: '.$this->file);
294 * @param string $file path to the original file
300 public function addFile($file, $fileinfo = '') argument
303 $fileinfo = FileInfo::fromPath($file, $fileinfo);
318 $fp = @fopen($file, 'rb');
320 throw new ArchiveIOException('Could not open file for reading: ' . $file);
349 …throw new ArchiveCorruptedException("The size of $file changed while reading, archive corrupted. r…
416 if ($this->file) {
425 $this->file = '';
462 * @param string $file
466 public function save($file) argument
469 $this->setCompression($this->complevel, $this->filetype($file));
472 if (!@file_put_contents($file, $this->getArchive())) {
473 throw new ArchiveIOException('Could not write to file: '.$file);
505 if (!$this->file) {
583 $file = basename($name);
585 if (strlen($file) > 100 || strlen($dir) > 155) {
595 $name = $file;
736 * @param string $file
739 public function filetype($file) argument
742 if(file_exists($file) && is_readable($file) && filesize($file) > 5) {
743 $fh = @fopen($file, 'rb');
753 $file = strtolower($file);
754 if (substr($file, -3) == '.gz' || substr($file, -4) == '.tgz') {
756 } elseif (substr($file, -4) == '.bz2' || substr($file, -4) == '.tbz') {