Skip to content

Instantly share code, notes, and snippets.

@hrach
Created March 19, 2011 16:27
Show Gist options
  • Save hrach/877585 to your computer and use it in GitHub Desktop.
Save hrach/877585 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());
}
@unlink($directory);
@pryznar
Copy link

pryznar commented Nov 7, 2014

unlink ale nesmaze adresar ne? ☺️

@hrach
Copy link
Author

hrach commented Jan 7, 2015

@johnCourtier a vis, ze komentujes zdrojak z roku 2011? :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment