Skip to content

Instantly share code, notes, and snippets.

@pepakriz
Forked from hrach/delete.php
Created July 10, 2012 19:16
Show Gist options
  • Save pepakriz/3085603 to your computer and use it in GitHub Desktop.
Save pepakriz/3085603 to your computer and use it in GitHub Desktop.
Rekurzivní smazání adresáře v Nette
<?php
$dirContent = Finder::find('*')->from($directory)->childFirst();
foreach ($dirContent as $file) {
if ($file->isDir())
@rmdir($file->getPathname());
else
@unlink($file->getPathname());
}
@rmdir($directory);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment