Lines Matching refs:file
19 protected $file = ''; variable in splitbrain\\PHPArchive\\Tar
49 * @param string $file
53 public function open($file) argument
55 $this->file = $file;
59 $this->setCompression($this->complevel, $this->filetype($file));
64 $this->fh = @gzopen($this->file, 'rb');
66 $this->fh = @bzopen($this->file, 'r');
68 $this->fh = @fopen($this->file, 'rb');
72 throw new ArchiveIOException('Could not open file for reading: '.$this->file);
111 if ($this->closed || !$this->file) {
157 if ($this->closed || !$this->file) {
229 * @param string $file
233 public function create($file = '') argument
235 $this->file = $file;
239 if ($this->file) {
242 $this->setCompression($this->complevel, $this->filetype($file));
246 $this->fh = @gzopen($this->file, 'wb'.$this->complevel);
248 $this->fh = @bzopen($this->file, 'w');
250 $this->fh = @fopen($this->file, 'wb');
254 throw new ArchiveIOException('Could not open file for writing: '.$this->file);
264 * @param string $file path to the original file
270 public function addFile($file, $fileinfo = '') argument
273 $fileinfo = FileInfo::fromPath($file, $fileinfo);
288 $fp = @fopen($file, 'rb');
290 throw new ArchiveIOException('Could not open file for reading: ' . $file);
308 …throw new ArchiveCorruptedException("The size of $file changed while reading, archive corrupted. r…
372 if ($this->file) {
381 $this->file = '';
418 * @param string $file
422 public function save($file) argument
425 $this->setCompression($this->complevel, $this->filetype($file));
428 if (!@file_put_contents($file, $this->getArchive())) {
429 throw new ArchiveIOException('Could not write to file: '.$file);
459 if (!$this->file) {
536 $file = basename($name);
538 if (strlen($file) > 100 || strlen($dir) > 155) {
548 $name = $file;
689 * @param string $file
692 public function filetype($file) argument
695 if(file_exists($file) && is_readable($file) && filesize($file) > 5) {
696 $fh = @fopen($file, 'rb');
706 $file = strtolower($file);
707 if (substr($file, -3) == '.gz' || substr($file, -4) == '.tgz') {
709 } elseif (substr($file, -4) == '.bz2' || substr($file, -4) == '.tbz') {