예제 #1
0
	function get_page_info($pageName, $version)
	{
		$info = parent::get_page_info($pageName);

		if (!isset($version)) {
			// No version = last version
			return $info;
		}

		if (!$info) {
			// Page does not exist
			return false;
		}

		$old_info = $this->get_version($pageName, $version);

		if ($old_info == null) {
			// History does not exist
			if ($version == $this->get_page_latest_version($pageName) + 1) {
				// Last version
				return $info;
			}

			throw new Exception();
		}

		// Override parameters with versioned data
		$info['data'] = $old_info['data'];
		$info['version'] = $old_info['version'];
		$info['last_version'] = $info['version'];
		$info["user"] = $old_info["user"];
		$info["ip"] = $old_info["ip"];
		$info["description"] = $old_info["description"];
		$info["comment"] = $old_info["comment"];
		$info["is_html"] = $old_info["is_html"];
		$info['lastModif'] = $old_info["lastModif"];
		$info['page_size'] = strlen($old_info['data']);

		return $info;
	}