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