Pop\Archive\Adapter\Zip::addFiles PHP Метод

addFiles() публичный Метод

Method to create an archive file
public addFiles ( string | array $files ) : void
$files string | array
Результат void
    public function addFiles($files)
    {
        if (is_array($files)) {
            foreach ($files as $key => $value) {
                $files[$key] = realpath($value);
            }
        } else {
            $files = array(realpath($files));
        }
        $result = !file_exists($this->path) ? $this->archive->open($this->path, \ZipArchive::CREATE) : $this->archive->open($this->path);
        if ($result === true) {
            foreach ($files as $file) {
                if (!is_dir($file)) {
                    $this->archive->addFile($file, basename($file));
                } else {
                    $this->addDir($file);
                }
            }
            $this->archive->close();
        }
    }