<?php

/**
 * Description of Core
 *
 * @author Arkadiusz Rychlik <a.rychlik at eppe.com.pl>
 */
class Rtn_Filesystem_Core {

	/**
	 * Kasuje katalog wrac z zawartością
	 * @param string $dirPath
	 */
	static function delTree($dirPath) {
		foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dirPath, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST) as $path) {
			$path->isFile() ? unlink($path->getPathname()) : rmdir($path->getPathname());
		}
		rmdir($dirPath);
	}

}
