public static function invalidateGroup($name=null, $recursive=true) {
		//if invalidating a group, make sure it's valid
		if($name) {
			//it needs to have a trailing slash and no leading slashes
			$name = trim($name,'/').'/';

			//make sure the key isn't going up a directory
			if(strpos($name,'..') !== false) {
				throw new Exception("Invalidate path cannot go up directories.");
			}
		}

		array_map("unlink", glob(self::$cacheDir.'/'.$name.'*.cache'));
		
		//if recursively invalidating
		if($recursive) {
			$subdirs = glob(self::$cacheDir.'/'.$name.'*',GLOB_ONLYDIR);
			
			foreach($subdirs as $dir) {
				$dir = basename($dir);
				
				//skip all subdirectories that start with '.'
				if($dir[0] == '.') continue;
				
				self::invalidateGroup($name.$dir,true);
			}
		}
	}
public static function invalidateGroup($name=null, $recursive=true) {
		//if invalidating a group, make sure it's valid
		if($name) {
			//it needs to have a trailing slash and no leading slashes
			$name = trim($name,'/').'/';

			//make sure the key isn't going up a directory
			if(strpos($name,'..') !== false) {
				throw new Exception("Invalidate path cannot go up directories.");
			}
		}

		array_map("unlink", glob(self::$cacheDir.'/'.$name.'*.cache'));
		
		//if recursively invalidating
		if($recursive) {
			$subdirs = glob(self::$cacheDir.'/'.$name.'*',GLOB_ONLYDIR);
			
			foreach($subdirs as $dir) {
				$dir = basename($dir);
				
				//skip all subdirectories that start with '.'
				if($dir[0] == '.') continue;
				
				self::invalidateGroup($name.$dir,true);
			}
		}
	}
public static function invalidateGroup ( $ name = null , $ recursive = true ) { //if invalidating a group, make sure it's valid if ( $ name ) { //it needs to have a trailing slash and no leading slashes $ name = trim ( $ name , '/' ) . '/' ; //make sure the key isn't going up a directory if ( strpos ( $ name , '..' ) !== false ) { throw new Exception ( "Invalidate path cannot go up directories." ) ; } } array_map ( "unlink" , glob ( self :: $ cacheDir . '/' . $ name . '*.cache' ) ) ; //if recursively invalidating if ( $ recursive ) { $ subdirs = glob ( self :: $ cacheDir . '/' . $ name . '*' , GLOB_ONLYDIR ) ; foreach ( $ subdirs as $ dir ) { $ dir = basename ( $ dir ) ; //skip all subdirectories that start with '.' if ( $ dir [ 0 ] == '.' ) continue ; self :: invalidateGroup ( $ name . $ dir , true ) ; } } }
Invalidate a group of cache keys
@param string $name The name of the group to invalidate (e.g. 'groupname', 'groupname/subgroupname', etc.).  If null, the entire cache will be invalidated.
@param boolean $recursive If set to false, none of the subgroups will be invalidated.
@throws Exception If an invalid group name is given
Invalidate a group of cache keys