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);
        }

    }