HosipLan

Untitled

Sep 16th, 2011
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.34 KB | None | 0 0
  1. foreach (Nette\Utils\Finder::find('*')->from($directory)->childFirst() as $file) {
  2.     if ($file->isDir()) {
  3.         @rmdir($file->getPathname());
  4.     } else {
  5.         @unlink($file->getPathname());
  6.     }
  7.  
  8.     if (substr($file->getBasename(), -2) !== ';1') {
  9.         continue;
  10.     }
  11.  
  12.     rename($file->getPathname(), $file->getPath() . '/' . $file->getBasename(';1'));
  13. }
Advertisement
Add Comment
Please, Sign In to add comment