src/OaiPmh/Communicator.php
protected function getOaiResponse($verb, $params)
    {
        // Debug:
        $this->write(
            "Sending request: verb = {$verb}, params = " . print_r($params, true)
        );

        // Set up retry loop:
        do {
            $result = $this->sendRequest($verb, $params);
            if ($result->getStatusCode() == 503) {
                $delayHeader = $result->getHeaders()->get('Retry-After');
                $delay = is_object($delayHeader)
                    ? $delayHeader->getDeltaSeconds() : 0;
                if ($delay > 0) {
                    $this->writeLine(
                        "Received 503 response; waiting {$delay} seconds..."
                    );
                    sleep($delay);
                }
            } elseif (!$result->isSuccess()) {
                throw new \Exception('HTTP Error ' . $result->getStatusCode());
            }
        } while ($result->getStatusCode() == 503);

        // If we got this far, there was no error -- send back response.
        return $result->getBody();
    }
protected function getOaiResponse($verb, $params)
    {
        // Debug:
        $this->write(
            "Sending request: verb = {$verb}, params = " . print_r($params, true)
        );

        // Set up retry loop:
        do {
            $result = $this->sendRequest($verb, $params);
            if ($result->getStatusCode() == 503) {
                $delayHeader = $result->getHeaders()->get('Retry-After');
                $delay = is_object($delayHeader)
                    ? $delayHeader->getDeltaSeconds() : 0;
                if ($delay > 0) {
                    $this->writeLine(
                        "Received 503 response; waiting {$delay} seconds..."
                    );
                    sleep($delay);
                }
            } elseif (!$result->isSuccess()) {
                throw new \Exception('HTTP Error ' . $result->getStatusCode());
            }
        } while ($result->getStatusCode() == 503);

        // If we got this far, there was no error -- send back response.
        return $result->getBody();
    }
protected function getOaiResponse ( $ verb , $ params ) { // Debug: $ this -> write ( "Sending request: verb = {$verb}, params = " . print_r ( $ params , true ) ) ; // Set up retry loop: do { $ result = $ this -> sendRequest ( $ verb , $ params ) ; if ( $ result -> getStatusCode ( ) == 503 ) { $ delayHeader = $ result -> getHeaders ( ) -> get ( 'Retry-After' ) ; $ delay = is_object ( $ delayHeader ) ? $ delayHeader -> getDeltaSeconds ( ) : 0 ; if ( $ delay > 0 ) { $ this -> writeLine ( "Received 503 response; waiting {$delay} seconds..." ) ; sleep ( $ delay ) ; } } elseif ( ! $ result -> isSuccess ( ) ) { throw new \ Exception ( 'HTTP Error ' . $ result -> getStatusCode ( ) ) ; } } while ( $ result -> getStatusCode ( ) == 503 ) ; // If we got this far, there was no error -- send back response. return $ result -> getBody ( ) ; }
Make an OAI-PMH request. Throw an exception if there is an error; return
an XML string on success.

@param string $verb   OAI-PMH verb to execute.
@param array  $params GET parameters for ListRecords method.

@return string
Make an OAI - PMH request . Throw an exception if there is an error ; return an XML string on success .