コード例 #1
0
 public function parseResponse(DataResponse $response)
 {
     // this parser doesn't depend on any internal state, so never re-parse
     if ($this->features) {
         return $this->features;
     }
     $this->dbfParser = new DBase3FileParser();
     $this->mapProjector = new MapProjector();
     if ($response->getContext('zipped')) {
         $content = $response->getResponse();
         foreach ($content as $filename => $fileData) {
             $this->setContents($fileData['shp']);
             $this->dbfParser->setContents($fileData['dbf']);
             $this->dbfParser->setup();
             $this->projection = isset($fileData['projection']) ? $fileData['projection'] : null;
             $this->mapProjector->setSrcProj($this->projection);
             $this->doParse();
         }
     } else {
         $this->projection = $response->getContext('projection');
         $this->mapProjector->setSrcProj($this->projection);
         $this->setFilename($response->getContext('shp'));
         $this->dbfParser->setFilename($response->getContext('dbf'));
         $this->dbfParser->setup();
         $this->doParse();
     }
     return $this->features;
 }
コード例 #2
0
 public function parseResponse(DataResponse $response)
 {
     if ($authority = $response->getContext('authority')) {
         $this->authority = $authority;
     }
     return parent::parseResponse($response);
 }
コード例 #3
0
 public function parseResponse(DataResponse $response)
 {
     $data = $response->getResponse();
     if (!is_resource($data) || get_resource_type($data) != 'ldap result') {
         return false;
     }
     $ds = $response->getContext('ldap');
     $fieldMap = $response->getContext('fieldMap');
     $parsedData = $this->parseSearch($data, $ds, $fieldMap);
     if ($this->getOption('action') == 'user') {
         $parsedData = isset($parsedData[0]) ? $parsedData[0] : false;
         $this->setTotalItems($parsedData ? 1 : 0);
     } else {
         $this->setTotalItems(count($parsedData));
     }
     return $parsedData;
 }