src/FileCache.php
protected function _clearExpired($time = null){

		if($time === null) $time = time();

		$files = glob("{$this->_cache_path}*.cache");
		$cleared = 0;

		if(is_array($files)){

			foreach($files as $file){

				$path = $this->_cache_path . basename($file);
				$mtime = @filemtime($path);

				// Remove expired files

				if($mtime !== false && $time > $mtime){

					@unlink($path);
					++$cleared;
				}
			}
		}

		return $cleared;
	}
protected function _clearExpired($time = null){

		if($time === null) $time = time();

		$files = glob("{$this->_cache_path}*.cache");
		$cleared = 0;

		if(is_array($files)){

			foreach($files as $file){

				$path = $this->_cache_path . basename($file);
				$mtime = @filemtime($path);

				// Remove expired files

				if($mtime !== false && $time > $mtime){

					@unlink($path);
					++$cleared;
				}
			}
		}

		return $cleared;
	}
protected function _clearExpired ( $ time = null ) { if ( $ time === null ) $ time = time ( ) ; $ files = glob ( "{$this->_cache_path}*.cache" ) ; $ cleared = 0 ; if ( is_array ( $ files ) ) { foreach ( $ files as $ file ) { $ path = $ this -> _cache_path . basename ( $ file ) ; $ mtime = @ filemtime ( $ path ) ; // Remove expired files if ( $ mtime !== false && $ time > $ mtime ) { @ unlink ( $ path ) ; ++ $ cleared ; } } } return $ cleared ; }
Clear expired cache-entries from the cache-path.

<p>The optional parameter {@link $time} can be used to provide a
reference time for the expiry. When omitted, the current time is
used.</p>

<p>Returns the number of expired items cleared from the cache.</p>

@param integer $time
@return integer
Clear expired cache - entries from the cache - path .