Commit a912a9b7dbd062ac4f31ee2c1999054886050a0c
1 parent
4ef273a6
Exists in
master
and in
7 other branches
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,6 +181,17 @@ function testaMapaImg($tema) { | ||
| 181 | $mapa = ms_newMapObj ( $base ); | 181 | $mapa = ms_newMapObj ( $base ); |
| 182 | //error_reporting ( E_ALL ); | 182 | //error_reporting ( E_ALL ); |
| 183 | ms_ResetErrorList (); | 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 | try { | 195 | try { |
| 185 | ms_newMapObj ( $tema ); | 196 | ms_newMapObj ( $tema ); |
| 186 | } catch ( Exception $e ) { | 197 | } catch ( Exception $e ) { |
| @@ -188,7 +199,7 @@ function testaMapaImg($tema) { | @@ -188,7 +199,7 @@ function testaMapaImg($tema) { | ||
| 188 | "imgMapa" => "", | 199 | "imgMapa" => "", |
| 189 | "imgLegenda" => "", | 200 | "imgLegenda" => "", |
| 190 | "tempo" => (microtime ( true ) - $tempo), | 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 | if (@ms_newMapObj ( $tema )) { | 205 | if (@ms_newMapObj ( $tema )) { |
| @@ -206,7 +217,7 @@ function testaMapaImg($tema) { | @@ -206,7 +217,7 @@ function testaMapaImg($tema) { | ||
| 206 | "imgMapa" => "", | 217 | "imgMapa" => "", |
| 207 | "imgLegenda" => "", | 218 | "imgLegenda" => "", |
| 208 | "tempo" => (microtime ( true ) - $tempo), | 219 | "tempo" => (microtime ( true ) - $tempo), |
| 209 | - "erro" => $erro | 220 | + "erro" => $erro." ".$erroComplemento |
| 210 | ); | 221 | ); |
| 211 | } | 222 | } |
| 212 | \admin\php\funcoesAdmin\substituiConObj ( $mapa, $postgis_mapa ); | 223 | \admin\php\funcoesAdmin\substituiConObj ( $mapa, $postgis_mapa ); |
| @@ -279,7 +290,7 @@ function testaMapaImg($tema) { | @@ -279,7 +290,7 @@ function testaMapaImg($tema) { | ||
| 279 | "imgMapa" => "", | 290 | "imgMapa" => "", |
| 280 | "imgLegenda" => "", | 291 | "imgLegenda" => "", |
| 281 | "tempo" => (microtime ( true ) - $tempo), | 292 | "tempo" => (microtime ( true ) - $tempo), |
| 282 | - "erro" => $erro | 293 | + "erro" => $erro." ".$erroComplemento |
| 283 | ); | 294 | ); |
| 284 | } | 295 | } |
| 285 | if ($objImagem->imagepath == "") { | 296 | if ($objImagem->imagepath == "") { |
| @@ -287,7 +298,7 @@ function testaMapaImg($tema) { | @@ -287,7 +298,7 @@ function testaMapaImg($tema) { | ||
| 287 | "imgMapa" => "", | 298 | "imgMapa" => "", |
| 288 | "imgLegenda" => "", | 299 | "imgLegenda" => "", |
| 289 | "tempo" => (microtime ( true ) - $tempo), | 300 | "tempo" => (microtime ( true ) - $tempo), |
| 290 | - "erro" => "Erro IMAGEPATH vazio" | 301 | + "erro" => "Erro IMAGEPATH vazio. ".$erroComplemento |
| 291 | ); | 302 | ); |
| 292 | } | 303 | } |
| 293 | $nomec = ($objImagem->imagepath) . \admin\php\funcoesAdmin\nomeRandomico () . "teste.png"; | 304 | $nomec = ($objImagem->imagepath) . \admin\php\funcoesAdmin\nomeRandomico () . "teste.png"; |
| @@ -309,7 +320,7 @@ function testaMapaImg($tema) { | @@ -309,7 +320,7 @@ function testaMapaImg($tema) { | ||
| 309 | "imgMapa" => ($objImagem->imageurl) . basename ( $nomec ), | 320 | "imgMapa" => ($objImagem->imageurl) . basename ( $nomec ), |
| 310 | "imgLegenda" => ($objImagemLegenda->imageurl) . basename ( $nomel ), | 321 | "imgLegenda" => ($objImagemLegenda->imageurl) . basename ( $nomel ), |
| 311 | "tempo" => (microtime ( true ) - $tempo), | 322 | "tempo" => (microtime ( true ) - $tempo), |
| 312 | - "erro" => $erro | 323 | + "erro" => $erro." ".$erroComplemento |
| 313 | ); | 324 | ); |
| 314 | } | 325 | } |
| 315 | function zoomTema($nomelayer, &$mapa) { | 326 | function zoomTema($nomelayer, &$mapa) { |