DirectAdmin\LetsEncrypt\Lib\Utility\StorageTrait::clearStorage PHP Method

clearStorage() public method

Remove the storage
public clearStorage ( $path = null ) : boolean
return boolean
    public function clearStorage($path = null)
    {
        if ($path == null) {
            $path = $this->getStoragePath();
        }
        foreach (scandir($path) as $file) {
            if (in_array($file, ['.', '..'])) {
                continue;
            }
            if (is_dir($path . DIRECTORY_SEPARATOR . $file)) {
                $this->clearStorage($path . DIRECTORY_SEPARATOR . $file);
            } else {
                unlink($path . DIRECTORY_SEPARATOR . $file);
            }
        }
        rmdir($path);
    }