src/FileCache.php
public function get($name, &$error = false){

		// If disabled, return nothing so that this cache is overwritten

		if(!$this->_enabled){

			return null;
		}

		try{

			$file = $this->_getFileName($name);
		}
		catch(CacheException $e){

			$error = true;

			return null;
		}

		if(time() > @filemtime($this->_cache_path . $file)){

			return null;
		}

		$contents = @file_get_contents($this->_cache_path . $file);

		if($contents !== false){

			error_clear_last();

			$value = @unserialize($contents);

			// Attempt to separate serialised "false" from unserialisation errors

			$last_error = error_get_last();

			if($value === false && $last_error !== null && $last_error['type'] === E_WARNING){

				$error = true;

				return null;
			}

			return $value;
		}

		return null;
	}
public function get($name, &$error = false){

		// If disabled, return nothing so that this cache is overwritten

		if(!$this->_enabled){

			return null;
		}

		try{

			$file = $this->_getFileName($name);
		}
		catch(CacheException $e){

			$error = true;

			return null;
		}

		if(time() > @filemtime($this->_cache_path . $file)){

			return null;
		}

		$contents = @file_get_contents($this->_cache_path . $file);

		if($contents !== false){

			error_clear_last();

			$value = @unserialize($contents);

			// Attempt to separate serialised "false" from unserialisation errors

			$last_error = error_get_last();

			if($value === false && $last_error !== null && $last_error['type'] === E_WARNING){

				$error = true;

				return null;
			}

			return $value;
		}

		return null;
	}
public function get ( $ name , & $ error = false ) { // If disabled, return nothing so that this cache is overwritten if ( ! $ this -> _enabled ) { return null ; } try { $ file = $ this -> _getFileName ( $ name ) ; } catch ( CacheException $ e ) { $ error = true ; return null ; } if ( time ( ) > @ filemtime ( $ this -> _cache_path . $ file ) ) { return null ; } $ contents = @ file_get_contents ( $ this -> _cache_path . $ file ) ; if ( $ contents !== false ) { error_clear_last ( ) ; $ value = @ unserialize ( $ contents ) ; // Attempt to separate serialised "false" from unserialisation errors $ last_error = error_get_last ( ) ; if ( $ value === false && $ last_error !== null && $ last_error [ 'type' ] === E_WARNING ) { $ error = true ; return null ; } return $ value ; } return null ; }
Get an entry from the FileCache.

@param string $name
@param boolean &$error
@return mixed
@see Cache::get()
Get an entry from the FileCache .