Skip to content

Instantly share code, notes, and snippets.

@VojtechBartos
Forked from hrach/delete.php
Created November 10, 2012 15:59
Show Gist options
  • Save VojtechBartos/4051476 to your computer and use it in GitHub Desktop.
Save VojtechBartos/4051476 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