Commit a912a9b7dbd062ac4f31ee2c1999054886050a0c

Authored by Edmar Moretti
1 parent 4ef273a6

Inclusão de teste de compatibilidade com a versão 7 do Mapserver no teste de mapfile

Showing 1 changed file with 16 additions and 5 deletions   Show diff stats
admin1/catalogo/mapfile/teste/exec.php
... ... @@ -181,6 +181,17 @@ function testaMapaImg($tema) {
181 181 $mapa = ms_newMapObj ( $base );
182 182 //error_reporting ( E_ALL );
183 183 ms_ResetErrorList ();
  184 + $erroComplemento = "";
  185 + //verificacoes de compatibilidade Mapserver
  186 + if($versao >= 7){
  187 + $teste = file_get_contents($tema);
  188 + if (stripos($teste, 'ANNOTATION') !== false) {
  189 + $erroComplemento .= " Verifique se o LAYER e do tipo ANNOTATION";
  190 + }
  191 + if (stripos($teste, 'Cluster:FeatureCount') !== false) {
  192 + $erroComplemento .= " Verifique se existe Cluster:FeatureCount e troque por Cluster_FeatureCount";
  193 + }
  194 + }
184 195 try {
185 196 ms_newMapObj ( $tema );
186 197 } catch ( Exception $e ) {
... ... @@ -188,7 +199,7 @@ function testaMapaImg($tema) {
188 199 "imgMapa" => "",
189 200 "imgLegenda" => "",
190 201 "tempo" => (microtime ( true ) - $tempo),
191   - "erro" => "Objeto map nao pode ser criado. Erro fatal."
  202 + "erro" => "Objeto map nao pode ser criado. Erro fatal. ".$erroComplemento
192 203 );
193 204 }
194 205 if (@ms_newMapObj ( $tema )) {
... ... @@ -206,7 +217,7 @@ function testaMapaImg($tema) {
206 217 "imgMapa" => "",
207 218 "imgLegenda" => "",
208 219 "tempo" => (microtime ( true ) - $tempo),
209   - "erro" => $erro
  220 + "erro" => $erro." ".$erroComplemento
210 221 );
211 222 }
212 223 \admin\php\funcoesAdmin\substituiConObj ( $mapa, $postgis_mapa );
... ... @@ -279,7 +290,7 @@ function testaMapaImg($tema) {
279 290 "imgMapa" => "",
280 291 "imgLegenda" => "",
281 292 "tempo" => (microtime ( true ) - $tempo),
282   - "erro" => $erro
  293 + "erro" => $erro." ".$erroComplemento
283 294 );
284 295 }
285 296 if ($objImagem->imagepath == "") {
... ... @@ -287,7 +298,7 @@ function testaMapaImg($tema) {
287 298 "imgMapa" => "",
288 299 "imgLegenda" => "",
289 300 "tempo" => (microtime ( true ) - $tempo),
290   - "erro" => "Erro IMAGEPATH vazio"
  301 + "erro" => "Erro IMAGEPATH vazio. ".$erroComplemento
291 302 );
292 303 }
293 304 $nomec = ($objImagem->imagepath) . \admin\php\funcoesAdmin\nomeRandomico () . "teste.png";
... ... @@ -309,7 +320,7 @@ function testaMapaImg($tema) {
309 320 "imgMapa" => ($objImagem->imageurl) . basename ( $nomec ),
310 321 "imgLegenda" => ($objImagemLegenda->imageurl) . basename ( $nomel ),
311 322 "tempo" => (microtime ( true ) - $tempo),
312   - "erro" => $erro
  323 + "erro" => $erro." ".$erroComplemento
313 324 );
314 325 }
315 326 function zoomTema($nomelayer, &$mapa) {
... ...