public function addDirectory($directory, $inArchivePath = null)
    {
        if (!is_dir($directory) || !is_readable($directory))
            throw new InvalidArgumentException($directory.' is not a valid directory to add in archive');

        return ($inArchivePath !== null
                ? $this->addFiles([$directory => $inArchivePath])
                : $this->addFiles([$inArchivePath])) > 0;
    }
public function addDirectory($directory, $inArchivePath = null)
    {
        if (!is_dir($directory) || !is_readable($directory))
            throw new InvalidArgumentException($directory.' is not a valid directory to add in archive');

        return ($inArchivePath !== null
                ? $this->addFiles([$directory => $inArchivePath])
                : $this->addFiles([$inArchivePath])) > 0;
    }
public function addDirectory ( $ directory , $ inArchivePath = null ) { if ( ! is_dir ( $ directory ) || ! is_readable ( $ directory ) ) throw new InvalidArgumentException ( $ directory . ' is not a valid directory to add in archive' ) ; return ( $ inArchivePath !== null ? $ this -> addFiles ( [ $ directory => $ inArchivePath ] ) : $ this -> addFiles ( [ $ inArchivePath ] ) ) > 0 ; }
Adds directory contents to archive.
@param string $directory
@param string|null $inArchivePath If not passed, full paths will be preserved.
@return bool
@throws Exception
Adds directory contents to archive .