Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Returns a parent directory's path
<?php dirname(string $path, int $levels = 1): string
<?php     private function ensureParentDirectoryExists(string $path, ?string $visibility): void

    {

        $dirname = dirname($path);



        if ($dirname === '' || $dirname === '.') {

            return;
<?php         foreach ($this->files as $path => $file) {

            if (substr($path, 0, $prefixLength) === $prefix) {

                $subPath = substr($path, $prefixLength);

                $dirname = dirname($subPath);



                if ($dirname !== '.') {

                    $parts = explode('/', $dirname);
<?php     {

        $prefixedLocation = $this->prefixer->prefixPath($path);

        $this->ensureDirectoryExists(

            dirname($prefixedLocation),

            $this->resolveDirectoryVisibility($config->get(Config::OPTION_DIRECTORY_VISIBILITY))

        );

        error_clear_last();
<?php     {

        $prefixedLocation = $this->prefixer->prefixPath($path);

        $this->ensureDirectoryExists(

            dirname($prefixedLocation),

            $this->resolveDirectoryVisibility($config->get(Config::OPTION_DIRECTORY_VISIBILITY))

        );
<?php         $sourcePath = $this->prefixer->prefixPath($source);

        $destinationPath = $this->prefixer->prefixPath($destination);

        $this->ensureDirectoryExists(

            dirname($destinationPath),

            $this->resolveDirectoryVisibility($config->get(Config::OPTION_DIRECTORY_VISIBILITY))

        );
<?php         $sourcePath = $this->prefixer->prefixPath($source);

        $destinationPath = $this->prefixer->prefixPath($destination);

        $this->ensureDirectoryExists(

            dirname($destinationPath),

            $this->resolveDirectoryVisibility($config->get(Config::OPTION_DIRECTORY_VISIBILITY))

        );
<?php     private function ensureParentDirectoryExists(string $path, Config $config): void

    {

        $parentDirectory = dirname($path);



        if ($parentDirectory === '' || $parentDirectory === '.') {

            return;
<?php     private function ensureParentDirectoryExists(string $path, Config $config): void

    {

        $parentDirectory = dirname($path);



        if ($parentDirectory === '' || $parentDirectory === '.') {

            return;
<?php     private function createParentDirectoryForZipArchive(string $fullPath): void

    {

        $dirname = dirname($fullPath);



        if (is_dir($dirname) || @mkdir($dirname, $this->localDirectoryPermissions, true)) {

            return;
<?php     private function ensureParentDirectoryExists(string $path, Config $config): void

    {

        $dirname = dirname($path);



        if ($dirname === '' || $dirname === '.') {

            return;
<?php     private function isAtRootDirectory(string $directoryRoot, string $path): bool

    {

        return $directoryRoot === (rtrim(dirname($path), '/') . '/');

    }



    private function setVisibilityAttribute(string $statsName, string $visibility, ZipArchive $archive): bool