src/FS/File/Cache.php
public function cleanUp( $expires = 0 )
	{
		$expires	= $expires ? $expires : $this->expires;
		if( !$expires )
			throw new InvalidArgumentException( 'No expire time given or set on construction.' );

		$number	= 0;
		$index	= new DirectoryIterator( $this->path );
		foreach( $index as $entry )
		{
			if( $entry->isDot() || $entry->isDir() )
				continue;
			$pathName	= $entry->getPathname();
			if( substr( $pathName, -7 ) !== ".serial" )
				continue;
			if( $this->isExpired( $pathName, $expires ) )
				$number	+= (int) @unlink( $pathName );
		}
		return $number;
	}
public function cleanUp( $expires = 0 )
	{
		$expires	= $expires ? $expires : $this->expires;
		if( !$expires )
			throw new InvalidArgumentException( 'No expire time given or set on construction.' );

		$number	= 0;
		$index	= new DirectoryIterator( $this->path );
		foreach( $index as $entry )
		{
			if( $entry->isDot() || $entry->isDir() )
				continue;
			$pathName	= $entry->getPathname();
			if( substr( $pathName, -7 ) !== ".serial" )
				continue;
			if( $this->isExpired( $pathName, $expires ) )
				$number	+= (int) @unlink( $pathName );
		}
		return $number;
	}
public function cleanUp ( $ expires = 0 ) { $ expires = $ expires ? $ expires : $ this -> expires ; if ( ! $ expires ) throw new InvalidArgumentException ( 'No expire time given or set on construction.' ) ; $ number = 0 ; $ index = new DirectoryIterator ( $ this -> path ) ; foreach ( $ index as $ entry ) { if ( $ entry -> isDot ( ) || $ entry -> isDir ( ) ) continue ; $ pathName = $ entry -> getPathname ( ) ; if ( substr ( $ pathName , - 7 ) !== ".serial" ) continue ; if ( $ this -> isExpired ( $ pathName , $ expires ) ) $ number += ( int ) @ unlink ( $ pathName ) ; } return $ number ; }
Removes all expired Cache Files.
@access		public
@param		int			$expires		Cache File Lifetime in Seconds
@return		bool
Removes all expired Cache Files .