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;
    }
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;
    }
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 ; }
Add one or multiple files to the zip.

@param $pathToAdd array|string An array or string of files and folders to add
@param null|mixed $fileName

@return $this Zipper instance
Add one or multiple files to the zip .