Skip to content

Instantly share code, notes, and snippets.

@pepakriz
Forked from hrach/delete.php
Created July 10, 2012 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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