src/core/Cache.php
function read($filename){
		$filename = md5($filename);
		$filepath = $this->getConfig('cache_path').$filename.'.tmp';
		
		if(!file_exists($filepath)){
			return FALSE;
		}
		
		if ( ! $fp = @fopen($filepath, 'r')){
			return FALSE;
		}
		flock($fp, LOCK_SH);

		$cache = '';
		if (filesize($filepath) > 0)
		{
			$cache = fread($fp, filesize($filepath));
		}

		flock($fp, LOCK_UN);
		fclose($fp);

		// Strip out the embedded timestamp
		if ( ! preg_match("/(\d+T_SKY-->)/", $cache, $match))
		{
			return FALSE;
		}
		// Has the file expired? If so we'll delete it.
		if (time() >= trim(str_replace('TS--->', '', $match['1'])))
		{
			if (is_writable($filepath))
			{
				@unlink($filepath);
				return FALSE;
			}
		}

		// Display the cache
		return str_replace($match['0'], '', $cache);
	}
function read($filename){
		$filename = md5($filename);
		$filepath = $this->getConfig('cache_path').$filename.'.tmp';
		
		if(!file_exists($filepath)){
			return FALSE;
		}
		
		if ( ! $fp = @fopen($filepath, 'r')){
			return FALSE;
		}
		flock($fp, LOCK_SH);

		$cache = '';
		if (filesize($filepath) > 0)
		{
			$cache = fread($fp, filesize($filepath));
		}

		flock($fp, LOCK_UN);
		fclose($fp);

		// Strip out the embedded timestamp
		if ( ! preg_match("/(\d+T_SKY-->)/", $cache, $match))
		{
			return FALSE;
		}
		// Has the file expired? If so we'll delete it.
		if (time() >= trim(str_replace('TS--->', '', $match['1'])))
		{
			if (is_writable($filepath))
			{
				@unlink($filepath);
				return FALSE;
			}
		}

		// Display the cache
		return str_replace($match['0'], '', $cache);
	}
function read ( $ filename ) { $ filename = md5 ( $ filename ) ; $ filepath = $ this -> getConfig ( 'cache_path' ) . $ filename . '.tmp' ; if ( ! file_exists ( $ filepath ) ) { return FALSE ; } if ( ! $ fp = @ fopen ( $ filepath , 'r' ) ) { return FALSE ; } flock ( $ fp , LOCK_SH ) ; $ cache = '' ; if ( filesize ( $ filepath ) > 0 ) { $ cache = fread ( $ fp , filesize ( $ filepath ) ) ; } flock ( $ fp , LOCK_UN ) ; fclose ( $ fp ) ; // Strip out the embedded timestamp if ( ! preg_match ( "/(\d+T_SKY-->)/" , $ cache , $ match ) ) { return FALSE ; } // Has the file expired? If so we'll delete it. if ( time ( ) >= trim ( str_replace ( 'TS--->' , '' , $ match [ '1' ] ) ) ) { if ( is_writable ( $ filepath ) ) { @ unlink ( $ filepath ) ; return FALSE ; } } // Display the cache return str_replace ( $ match [ '0' ] , '' , $ cache ) ; }
read and get cache file

@param string
@return html
read and get cache file