id = $id; $this->file = mediaFN($this->id, $revision); $this->revision = $revision ?: $mtime ?: filemtime($this->file); $this->size = $size ?? filesize($this->file); $this->permission = $perms ?? auth_quickaclcheck($this->id);; $this->isimage = (bool)($isimage ?? false); $this->hash = $hash; } /** * Calculate the hash for this page * * This is a heavy operation and should only be called when needed. */ public function calculateHash() { $this->hash = md5(io_readFile($this->file, false)); } /** @inheritdoc */ public function __toString() { return $this->id . '@' . $this->revision; } }