Removes directory

@param string $path

@return bool
514683
public function rmdir($path)
    {
        $container = $this->getContainerFromContext($path);
        $path = $this->stripScheme($path);

        try {
            $directory = $container->nodeAt($path);

            if ($directory instanceof File) {
                trigger_error(
                    sprintf('Warning: rmdir(%s): Not a directory', $path),
                    E_USER_WARNING
                );

                return false;
            }

            $permissionHelper = $container->getPermissionHelper($directory);
            if (!$permissionHelper->isReadable()) {
                trigger_error(
                    sprintf('rmdir: %s: Permission denied', $path),
                    E_USER_WARNING
                );

                return false;
            }

        } catch (NotFoundException $e) {
            trigger_error(
                sprintf('Warning: rmdir(%s): No such file or directory', $path),
                E_USER_WARNING
            );

            return false;
        }

        if ($directory->size()) {
            trigger_error(
                sprintf('Warning: rmdir(%s): Directory not empty', $path),
                E_USER_WARNING
            );

            return false;
        }

        $container->remove($path, true);

        return true;
    }
372111
public function rmdir($path)
    {
        $files = array_diff(scandir($path), array('.', '..'));
        foreach ($files as $file) {
            (is_dir("$path/$file")) ? $this->rmdir("$path/$file") : unlink("$path/$file");
        }
        return rmdir($path);
    }
630684
public function cleanDirectory($path)
    {
        $time = time();
        $maxFileAge = 3600;
        $files = (array) $this->files->files($path);
        foreach ($files as $file) {
            if ($this->files->isFile($file) === true &&
                $this->files->lastModified($file) < ($time - $maxFileAge)
            ) {
                $this->files->delete($file);
            }
        }

        return $this;
    }
857573
public static function deleteFolder($path) 
	{
		if(file_exists($path)) {
			$fh = dir($path);
			//print_r($fh);
			while (false !== ($files = $fh->read())) {
				/*
				echo $fh->path.'/'.$files."\n";
				chmod($fh->path.'/'.$files, 0755);
				if(@unlink($fh->path.'/'.$files))
					echo '1'."\n";
				else
					echo '0'."\n";
				*/
				@unlink($fh->path.'/'.$files);
			}
			$fh->close();
			@rmdir($path);

			return true;

		} else 
			return false;
	}
1294852
public function delete($path)
    {
        return (bool)$this->normalizeResponse(
            Cosapi::delFile($this->getBucket(), $path)
        );
    }
911338
protected function removeDirectory($path)
    {
        if (!is_dir($path)) {
            return;
        }

        foreach (scandir($path) as $entry) {
            if ($entry === '.' || $entry === '..') {
                continue;
            }

            $entryPath = $path . '/' . $entry;

            if (is_dir($entryPath)) {
                $this->removeDirectory($entryPath);
            } else {
                unlink($entryPath);
            }
        }

        rmdir($path);
    }
948482
public static function delete($path)
    {
        if (!is_readable($path)) {
            return false;
        }

        if (!is_dir($path)) {
            unlink($path);
            return true;
        }

        foreach (scandir($path) as $file) {
            if ($file === '.' || $file === '..') {
                continue;
            }
            $file = $path . '/' . $file;
            if (is_dir($file)) {
                self::delete($file);
            } else {
                unlink($file);
            }
        }

        rmdir($path);

        return true;
    }
732389
public static function remove($path)
    {
        $path = self::resolve($path);

        return $path && is_file($path) && unlink($path);
    }
1017103
public function delete($path)
    {
        $url = self::BASE_URI.$this->getPathUnderRootDrive($path);

        $response = $this->getResponse('DELETE', $url);
        $success = ($response->getStatusCode() == '204');

        return $success;
    }
1083814
public function deleteDir($path)
    {
        if (strpos($path, $this->directoryList->getPath('var')) === false) {
            return sprintf("Failed to delete directory - '%s'", $path);
        }

        $classFunc = [__CLASS__, __FUNCTION__];
        return is_file($path)
            ?
            @unlink($path)
            :
            array_map($classFunc, glob($path . '/*')) == @rmdir($path);
    }
981173
public function delete($path): bool
    {
        $result = false;
        $parts = $this->split($path);

        $name = array_shift($parts);
        if (!count($parts)) {
            if (isset($this->ownData[$name])) {
                unset($this->ownData[$name]);
                $result = true;
            }
        } elseif (isset($this->subTrees[$name])) {
            $subtree = $this->subTrees[$name];
            $result = $subtree->delete($parts);
            if ($result && !$subtree->count()) {
                unset($this->subTrees[$name]);
            }
        }

        return $result;
    }
401018
public function delete($path)
    {
        $paths = is_array($path) ? $path : func_get_args();

        $success = true;

        foreach ($paths as $path) {
            try {
                if ($this->isDirectory($path)) {
                    if (!$this->deleteDirectoryRecursive($path)) {
                        $success = false;
                    }
                    continue;
                }
                if (!@unlink($path)) {
                    $success = false;
                }
            } catch (Throwable $e) {
                $success = false;
            }
        }

        return $success;
    }
274431
public function remove($path) {
        // using mark.
        if ('@' == $path[0]) $path = $this->as($path);
        
        // remove file.
        if (is_file($path)) return unlink($path);

        // remove directory.
        $handle = opendir($path);
        while (false !== ($name = readdir($handle))) {
            if ('.' == $name or '..' == $name) continue;
            if (!$this->remove($path.self::DS.$name)) return false;
        }
        closedir($handle);
        return rmdir($path);
    }
809395
public function remove_path($path)
	{
		foreach ($this->paths as $i => $p)
		{
			if ($p === $path)
			{
				unset($this->paths[$i]);
				break;
			}
		}

		return $this;
	}
1365154
public function removeRoute($path)
    {
        $routeName = ltrim($path, '/');
        if (!isset($this->routes[$routeName])) {
            return false;
        }
        unset($this->routes[$routeName]);
        return true;
    }
711059
public function deleteRecursive($path)
	{
		if (!$this->tryDelete($path)) {
			foreach ((array) $this->nlist($path) as $file) {
				if ($file !== '.' && $file !== '..') {
					$this->deleteRecursive(strpos($file, '/') === FALSE ? "$path/$file" : $file);
				}
			}
			$this->rmdir($path);
		}
	}
1027738
private function removeDirectory(string $path): bool
    {
        $iterator = new DirectoryIterator($path);
        foreach ($iterator as $fileInfo) {
            if ($fileInfo->isDot() || !$fileInfo->isDir()) {
                continue;
            }
            $dirName = $fileInfo->getPathname();
            $this->removeDirectory($dirName);
        }

        $files = new FilesystemIterator($path);

        /** @var SplFileInfo $file */
        foreach ($files as $file) {
            $fileName = $file->getPathname();
            unlink($fileName);
        }

        return rmdir($path);
    }