lib/fal.php
public function load($file,$ttl = 0)
	{
		$this->reset();
		$cache = \Cache::instance();
		$this->file = $file;
		$this->changed = false;
		$this->ttl = $ttl;
		$cacheHash = $this->getCacheHash($file);
		if ($this->f3->get('CACHE') && $ttl && ($cached = $cache->exists(
			$cacheHash,$content)) && $cached[0] + $ttl > microtime(TRUE)
		) {
			// load from cache
			$this->content = $content;
			$this->meta = $this->metaHandle->load($file,$ttl);
		} elseif ($this->fs->exists($file)) {
			// load from FS
			$this->meta = $this->metaHandle->load($file,$ttl);
			// if caching is on, save content to cache backend, otherwise it gets lazy loaded
			if ($this->f3->get('CACHE') && $ttl) {
				$this->content = $this->fs->read($file);
				$cache->set($cacheHash, $this->content, $ttl);
			}
		}
	}
public function load($file,$ttl = 0)
	{
		$this->reset();
		$cache = \Cache::instance();
		$this->file = $file;
		$this->changed = false;
		$this->ttl = $ttl;
		$cacheHash = $this->getCacheHash($file);
		if ($this->f3->get('CACHE') && $ttl && ($cached = $cache->exists(
			$cacheHash,$content)) && $cached[0] + $ttl > microtime(TRUE)
		) {
			// load from cache
			$this->content = $content;
			$this->meta = $this->metaHandle->load($file,$ttl);
		} elseif ($this->fs->exists($file)) {
			// load from FS
			$this->meta = $this->metaHandle->load($file,$ttl);
			// if caching is on, save content to cache backend, otherwise it gets lazy loaded
			if ($this->f3->get('CACHE') && $ttl) {
				$this->content = $this->fs->read($file);
				$cache->set($cacheHash, $this->content, $ttl);
			}
		}
	}
public function load ( $ file , $ ttl = 0 ) { $ this -> reset ( ) ; $ cache = \ Cache :: instance ( ) ; $ this -> file = $ file ; $ this -> changed = false ; $ this -> ttl = $ ttl ; $ cacheHash = $ this -> getCacheHash ( $ file ) ; if ( $ this -> f3 -> get ( 'CACHE' ) && $ ttl && ( $ cached = $ cache -> exists ( $ cacheHash , $ content ) ) && $ cached [ 0 ] + $ ttl > microtime ( TRUE ) ) { // load from cache $ this -> content = $ content ; $ this -> meta = $ this -> metaHandle -> load ( $ file , $ ttl ) ; } elseif ( $ this -> fs -> exists ( $ file ) ) { // load from FS $ this -> meta = $ this -> metaHandle -> load ( $ file , $ ttl ) ; // if caching is on, save content to cache backend, otherwise it gets lazy loaded if ( $ this -> f3 -> get ( 'CACHE' ) && $ ttl ) { $ this -> content = $ this -> fs -> read ( $ file ) ; $ cache -> set ( $ cacheHash , $ this -> content , $ ttl ) ; } } }
loads a file and it's meta data
@param string $file
@param int $ttl
loads a file and it s meta data