public function getMetadata(Resource $resource, $forceUpdate = false) {
		if ($this->metadata === null) {
			$this->initMetadata();
		}
		
		$path = $resource->getPath();
		
		if (! is_file($path)) {
			return false;
		}
		
		// Already exists for the resource
		if (! $forceUpdate && isset($this->metadata[$path])) {
			return $this->metadata[$path];
		}
		
		if ($resource->isLocal()) {
			$fileMtime = filemtime($path);
			
			if (isset($this->metadata[$path]) && $fileMtime === $this->metadata[$path]->mtime) {
				return $this->metadata[$path];
			}
		}
		
		$fileMeta = new stdClass();
		
		$fileMeta->mtime = isset($fileMtime) ? $fileMtime : false;
		$fileMeta->hash  = substr(md5_file($path), 24);
		
		$this->metadata[$path] = $fileMeta;
		$this->metadataChanged = true;
		
		return $fileMeta;
	}
public function getMetadata(Resource $resource, $forceUpdate = false) {
		if ($this->metadata === null) {
			$this->initMetadata();
		}
		
		$path = $resource->getPath();
		
		if (! is_file($path)) {
			return false;
		}
		
		// Already exists for the resource
		if (! $forceUpdate && isset($this->metadata[$path])) {
			return $this->metadata[$path];
		}
		
		if ($resource->isLocal()) {
			$fileMtime = filemtime($path);
			
			if (isset($this->metadata[$path]) && $fileMtime === $this->metadata[$path]->mtime) {
				return $this->metadata[$path];
			}
		}
		
		$fileMeta = new stdClass();
		
		$fileMeta->mtime = isset($fileMtime) ? $fileMtime : false;
		$fileMeta->hash  = substr(md5_file($path), 24);
		
		$this->metadata[$path] = $fileMeta;
		$this->metadataChanged = true;
		
		return $fileMeta;
	}
public function getMetadata ( Resource $ resource , $ forceUpdate = false ) { if ( $ this -> metadata === null ) { $ this -> initMetadata ( ) ; } $ path = $ resource -> getPath ( ) ; if ( ! is_file ( $ path ) ) { return false ; } // Already exists for the resource if ( ! $ forceUpdate && isset ( $ this -> metadata [ $ path ] ) ) { return $ this -> metadata [ $ path ] ; } if ( $ resource -> isLocal ( ) ) { $ fileMtime = filemtime ( $ path ) ; if ( isset ( $ this -> metadata [ $ path ] ) && $ fileMtime === $ this -> metadata [ $ path ] -> mtime ) { return $ this -> metadata [ $ path ] ; } } $ fileMeta = new stdClass ( ) ; $ fileMeta -> mtime = isset ( $ fileMtime ) ? $ fileMtime : false ; $ fileMeta -> hash = substr ( md5_file ( $ path ) , 24 ) ; $ this -> metadata [ $ path ] = $ fileMeta ; $ this -> metadataChanged = true ; return $ fileMeta ; }
Get metadata for the resource

@param  Resource $resource
@param  bool     $forceUpdate
@return stdObject | bool
Get metadata for the resource