Ftp::deleteRecursive PHP Method

deleteRecursive() public method

Recursive deletes path.
public deleteRecursive ( $path ) : void
return void
    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);
        }
    }