protected final static function wipeDir($dir, $rmdir = false) {
		if (file_exists($dir)) {
			$it = new \RecursiveDirectoryIterator($dir, \RecursiveDirectoryIterator::SKIP_DOTS);
			$files = new \RecursiveIteratorIterator($it, \RecursiveIteratorIterator::CHILD_FIRST);
			foreach ($files as $file)

				if ($file->isDir())
					self::wipeDir($file->getRealPath(), true); //rmdir($file->getRealPath());
				else
					unlink($file->getRealPath());


			if ($rmdir)
				rmdir($dir);
		}
	}