/**
* Deletes a directory
*
* <code>
*
* $remove = dir::remove('mydirectory');
*
* if($remove) echo 'the directory has been removed';
*
* </code>
*
* @param string $dir The path of the directory
* @param boolean $keep If set to true, the directory will flushed but not removed.
* @return boolean True: the directory has been removed, false: removing failed
*/
public static function remove($dir, $keep = false)
{
if (!is_dir($dir)) {
return false;
}
// It's easier to handle this with the Folder class
$object = new Folder($dir);
return $object->remove($keep);
}