Skip to content

Instantly share code, notes, and snippets.

@hrach
Created March 19, 2011 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • 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);
@johnCourtier
Copy link

A kde jsou slavné curly brackets, které svou nepřítomností způsobily tu chybu v SSL applu? 😊
Chtělo by to upgrade 😃

@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