private function addItem(
        string $file,
        bool $flatroot = false,
        int $compression = self::CM_DEFAULT,
        int $encryption = self::EM_NONE,
        ?string $base = null
    ): void {

        $file = is_null($this->getPath()) ? $file : $this->getPath()."/$file";
        $real_file = str_replace('\\', '/', realpath($file));
        $real_name = basename($real_file);

        if (
            $base !== null &&
            (
                (
                    $real_name[0] == "." &&
                    in_array($this->getSkipMode(), ["HIDDEN", "ALL"])
                ) ||
                (
                    $real_name[0] == "." &&
                    @$real_name[1] == "_" &&
                    in_array($this->getSkipMode(), ["COMODOJO", "ALL"])
                )
            )
        ) {
            return;
        }

        if ( is_dir($real_file) ) {
            $this->addDirectoryItem($real_file, $real_name, $compression, $encryption, $base, $flatroot);
        } else {
            $this->addFileItem($real_file, $real_name, $compression, $encryption, $base);
        }

    }
private function addItem(
        string $file,
        bool $flatroot = false,
        int $compression = self::CM_DEFAULT,
        int $encryption = self::EM_NONE,
        ?string $base = null
    ): void {

        $file = is_null($this->getPath()) ? $file : $this->getPath()."/$file";
        $real_file = str_replace('\\', '/', realpath($file));
        $real_name = basename($real_file);

        if (
            $base !== null &&
            (
                (
                    $real_name[0] == "." &&
                    in_array($this->getSkipMode(), ["HIDDEN", "ALL"])
                ) ||
                (
                    $real_name[0] == "." &&
                    @$real_name[1] == "_" &&
                    in_array($this->getSkipMode(), ["COMODOJO", "ALL"])
                )
            )
        ) {
            return;
        }

        if ( is_dir($real_file) ) {
            $this->addDirectoryItem($real_file, $real_name, $compression, $encryption, $base, $flatroot);
        } else {
            $this->addFileItem($real_file, $real_name, $compression, $encryption, $base);
        }

    }
private function addItem ( string $ file , bool $ flatroot = false , int $ compression = self :: CM_DEFAULT , int $ encryption = self :: EM_NONE , ? string $ base = null ) : void { $ file = is_null ( $ this -> getPath ( ) ) ? $ file : $ this -> getPath ( ) . "/$file" ; $ real_file = str_replace ( '\\' , '/' , realpath ( $ file ) ) ; $ real_name = basename ( $ real_file ) ; if ( $ base !== null && ( ( $ real_name [ 0 ] == "." && in_array ( $ this -> getSkipMode ( ) , [ "HIDDEN" , "ALL" ] ) ) || ( $ real_name [ 0 ] == "." && @ $ real_name [ 1 ] == "_" && in_array ( $ this -> getSkipMode ( ) , [ "COMODOJO" , "ALL" ] ) ) ) ) { return ; } if ( is_dir ( $ real_file ) ) { $ this -> addDirectoryItem ( $ real_file , $ real_name , $ compression , $ encryption , $ base , $ flatroot ) ; } else { $ this -> addFileItem ( $ real_file , $ real_name , $ compression , $ encryption , $ base ) ; } }
Add item to zip archive

@param string $file File to add (realpath)
@param bool $flatroot (optional) If true, source directory will be not included
@param string $base (optional) Base to record in zip file
@return void
@throws ZipException
Add item to zip archive