blocks may be re-assembled at the item level if it * is the same for all metadata formats harvested. However, this information may be supplied * differently for different metadata formats and may thus need to be store separately for each * metadata format. */ class OAI2Client { public function __construct($server_base_url) { $this->server_base_url = $server_base_url; require_once('./curl.php'); $this->curl = new Curl(); } public function Identify() { return $this->curl->get($this->server_base_url.'?verb=Identify'); } public function ListMetadataFormats($identifier = '') { $url = $this->server_base_url.'?verb=ListMetadataFormats'; if (!empty($identifier)) { $url .= "&identifier={$identifier}"; } return $this->curl->get($url); } public function ListSets($resumptionToken = '') { $url = $this->server_base_url.'?verb=ListSets'; return $this->curl->get($url); } public function ListIdentifiers($options = array()) { $options_default = array('from' => null, 'until' => null, 'set' => null, 'resumptionToken' => null, 'metadataPrefix' => null); // required $url = $this->server_base_url.'?verb=ListIdentifiers'; if (!empty($options['metadataPrefix'])) { $url .= "&metadataPrefix={$options['metadataPrefix']}"; } return $this->curl->get($url); } public function ListRecords($options = array()) { $options_default = array('from' => null, 'until' => null, 'set' => null, 'resumptionToken' => null, 'metadataPrefix' => null); // required $url = $this->server_base_url.'?verb=ListRecords'; if (!empty($options['metadataPrefix'])) { $url .= "&metadataPrefix={$options['metadataPrefix']}"; } return $this->curl->get($url); } public function GetRecord($identifier, $metadataPrefix) { $url = $this->server_base_url.'?verb=ListRecords'; $url .= "&identifier={$identifier}&metadataPrefix={$metadataPrefix}"; return $this->curl->get($url); } }