Ejemplo n.º 1
0
 protected function c3Request($action)
 {
     $this->addC3AccessHeader(self::COVERAGE_HEADER, 'remote-access');
     $context = stream_context_create(array('http' => $this->c3Access));
     $contents = file_get_contents($this->module->_getUrl() . '/c3/report/' . $action, false, $context);
     if ($contents === false) {
         $this->getRemoteError($http_response_header);
     }
     return $contents;
 }
Ejemplo n.º 2
0
 protected function c3Request($action)
 {
     $this->addC3AccessHeader(self::COVERAGE_HEADER, 'remote-access');
     $context = stream_context_create(array('http' => $this->c3Access));
     $contents = file_get_contents($this->module->_getUrl() . '/c3/report/' . $action, false, $context);
     $okHeaders = array_filter($http_response_header, function ($h) {
         return preg_match('~^HTTP(.*?)\\s200~', $h);
     });
     if (empty($okHeaders)) {
         throw new RemoteException("Request was not successful. See response header: " . $http_response_header[0]);
     }
     if ($contents === false) {
         $this->getRemoteError($http_response_header);
     }
     return $contents;
 }