Adds file to archive.

@param string $filename

@return bool
967222
private function _addFile($filename)
		{
			if (true === $this->_enabled) {
				if (File::exists($filename)) {
					if (is_dir($filename)) {
						return $this->_zip->addEmptyDir($filename);
					} else {
						return $this->_zip->addFile($filename);
					}
				}
			}

			return false;
		}
595991
public static function archiveFile($file, $archiveName)
    {
        if (!is_file($file))
            throw new InvalidArgumentException($file.' is not a valid file to archive');

        return static::archiveFiles($file, $archiveName) === 1;
    }
1221620
public function getFileResource($fileName)
    {
        if (!in_array($fileName, $this->files, true))
            return false;

        return $this->archive->getFileResource($fileName);
    }
189295
public function add($file, $entry_name = null)
    {
        $result = $this->tar->addModify($file, '', dirname($file));
        if ($result === false) {
            throw new ArchiveException('Error adding file ' . $file);
        }

        return $this;
    }
795789
public function setFileName($filename)
  {
    $a = explode('.', $filename);

    $this->file_name      = $filename;
    $this->file_extension = count($a) >= 2 ? array_pop($a) : false;

    return $this;
  }
605837
public function open($filename)
    {
        $this->filename = $filename;
        return $this->zipArchive->open($filename, ZIPARCHIVE::CREATE);
    }
427878
public function getFileData($fileName)
    {
        if (!isset($this->filesData[$fileName]))
            return false;

        return new ArchiveEntry($fileName, $this->filesData[$fileName]['size'],
            $this->filesData[$fileName]['size'], $this->filesData[$fileName]['mtime'],false);
    }
862462
public function open($fileName)
	{
		$this->_tempDir = PHPExcel_Shared_File::sys_get_temp_dir();

		$this->_zip = new PclZip($fileName);

		return true;
	}
756198
public function getFileData($fileName)
    {
        $entry = $this->sevenZip->getEntry($fileName);
        return new ArchiveEntry($fileName, $entry->getPackedSize(), $entry->getSize(),
            strtotime($entry->getModified()));
    }
937484
public function open($filename)
    {

        if (!is_file($filename)) return false;

        $this->file       = @(string)$filename;
        $this->group      = @(int)filegroup($filename);
        $this->owner      = @(int)fileowner($filename);
        $this->size       = @(int)filesize($filename);
        $this->type       = @(string)filetype($filename);
        $this->accessed   = @(int)fileatime($filename);
        $this->changed    = @(int)filectime($filename);
        $this->modified   = @(int)filemtime($filename);
        $this->permission = @(int)fileperms($filename);
        $this->f_inode    = @ fileinode($filename);
        $this->writeable  = @(bool)is_writable($filename);
        $this->readable   = @(bool)is_readable($filename);
        $this->mime_type  = @(string)mime_content_type($filename);
        $this->_get_path();
        $this->_extract_filename();
        $this->_extract_file_extension();

        return true;
    }
247659
public function addFolder( $dirName )
	{
		if( !file_exists( $dirName ) )
			return FALSE;
		$fileInfo = stat( $dirName );													// Get folder information
		$this->numFolders++;															// Add folder to processed data
		$activeDir				= &$this->folders[];
		$activeDir['name']		= $dirName;
		$activeDir['mode']		= $fileInfo['mode'];
		$activeDir['time']		= $fileInfo['mtime'];
		$activeDir['user_id']	= $fileInfo['uid'];
		$activeDir['group_id']	= $fileInfo['gid'];
#		$activeDir['checksum']	= $checksum;
		return TRUE;
	}
123145
public function hasFile($filename)
    {
        return is_file($filename = $this->outDir.DIRECTORY_SEPARATOR.$filename) ? true : false;
    }
111054
public function add($pathToAdd, $fileName = null)
    {
        if (is_array($pathToAdd)) {
            foreach ($pathToAdd as $key=>$dir) {
                if (!is_int($key)) {
                    $this->add($dir, $key); }
                else {
                    $this->add($dir);
                }
            }
        } elseif ($this->file->isFile($pathToAdd)) {
            if ($fileName) {
                $this->addFile($pathToAdd, $fileName);
            } else {
                $this->addFile($pathToAdd);
            }
        } else {
            $this->addDir($pathToAdd);
        }

        return $this;
    }
705793
public static function loadFile($fileName)
  {
    if (!preg_match('/\.ini$/i', $fileName)) {
      $fileName .= '.ini';
    }
    if (!static::isFileLoaded($fileName)) {
      self::$files[] = $fileName;
      return static::loadFileInMemory($fileName);
    }
    return false;
  }
22857
public function removeFile( $fileName )
	{
		if( !$this->numFiles )
			return FALSE;
		foreach( $this->files as $key => $information )
		{
			if( $information['name'] !== $fileName )
				continue;
			$this->numFiles--;
			unset( $this->files[$key] );
			return TRUE;
		}
	}
237369
protected function dumpFile(string $filename)
    {

        if (strlen($filename) > 0 && file_exists($filename) && is_file($filename)) {
            echo file_get_contents($filename);
            return true;
        }

        return false;
    }
138476
private function createFileDirIfNotExists(string $filename): bool
    {
        $pathinfo = pathinfo($filename);
        if (isset($pathinfo['dirname']) && $pathinfo['dirname'] !== '.') {
            if (is_dir($pathinfo['dirname'])) {
                return true;
            } elseif (is_file($pathinfo['dirname'])) {
                return false;
            } else {
                return $this->createDirIfNotExists($pathinfo['dirname']);
            }
        }
        return false;
    }