getMTime()) { $this->_hash = md5($this->getPathname() . $mtime); } $this->_relativePath = $relativePath; return; } /** * Get the hash. * * @return string */ public function getHash() { return $this->_hash; } /** * Get the MTime. * * @return int */ public function getMTime() { try { return parent::getMTime(); } catch (\RuntimeException $e) { return -1; } } /** * Set relative path. * * @param string $relativePath Relative path. * @return string */ public function setRelativePath($relativePath) { $old = $this->_relativePath; $this->_relativePath = $relativePath; return $old; } /** * Get relative path (if given). * * @return string */ public function getRelativePath() { return $this->_relativePath; } /** * Get relative pathname (if possible). * * @return string */ public function getRelativePathname() { if (null === $relative = $this->getRelativePath()) { return $this->getPathname(); } return substr($this->getPathname(), strlen($relative)); } }