Commit d76d6d6533484f21041174eadc83cc83619e5219
1 parent
88b52b42
Exists in
master
and in
7 other branches
Remoção de erro no programa que carrega os dados do visualizador da INDE e que e…
…stava gerando mensagens de warning no log do Apache
Showing
1 changed file
with
16 additions
and
17 deletions
Show diff stats
ferramentas/vinde/wmsindejson.php
@@ -18,7 +18,7 @@ echo | @@ -18,7 +18,7 @@ echo | ||
18 | 18 | ||
19 | include(dirname(__FILE__)."/../../ms_configura.php"); | 19 | include(dirname(__FILE__)."/../../ms_configura.php"); |
20 | include($locaplic."/classesphp/funcoes_gerais.php"); | 20 | include($locaplic."/classesphp/funcoes_gerais.php"); |
21 | -$agora = intval(time() / 1000); | 21 | +$agora = intval(time() / 10000); |
22 | $arq = $dir_tmp."/inde$agora.html"; | 22 | $arq = $dir_tmp."/inde$agora.html"; |
23 | if(!file_exists($arq)){ | 23 | if(!file_exists($arq)){ |
24 | $ch = curl_init(); | 24 | $ch = curl_init(); |
@@ -92,13 +92,10 @@ for ($i=0;$i<$n;$i++){ | @@ -92,13 +92,10 @@ for ($i=0;$i<$n;$i++){ | ||
92 | $linhas = ($matches[2][0]); | 92 | $linhas = ($matches[2][0]); |
93 | $parametros[$b[0]] = $linhas; | 93 | $parametros[$b[0]] = $linhas; |
94 | if($b[0] == "groupOfKeeper"){ | 94 | if($b[0] == "groupOfKeeper"){ |
95 | - if($gruposUnicos[$linhas] == ""){ | 95 | + if(empty($gruposUnicos[$linhas])){ |
96 | $gruposUnicos[$linhas] = "a"; | 96 | $gruposUnicos[$linhas] = "a"; |
97 | - | ||
98 | $linhas = $linhas." #$i"; | 97 | $linhas = $linhas." #$i"; |
99 | $grupos[$linhas] = ""; | 98 | $grupos[$linhas] = ""; |
100 | - //echo "<pre>"; | ||
101 | - //var_dump($matches); | ||
102 | if($grupos[$linhas]){ | 99 | if($grupos[$linhas]){ |
103 | $grupos[$linhas] = array_merge($grupos[$linhas],array("l_".$i)); | 100 | $grupos[$linhas] = array_merge($grupos[$linhas],array("l_".$i)); |
104 | } | 101 | } |
@@ -110,11 +107,6 @@ for ($i=0;$i<$n;$i++){ | @@ -110,11 +107,6 @@ for ($i=0;$i<$n;$i++){ | ||
110 | } | 107 | } |
111 | $layer[] = $parametros; | 108 | $layer[] = $parametros; |
112 | $layers[$i] = $layer; | 109 | $layers[$i] = $layer; |
113 | - //$parametros = "{".implode($novalinha,",")."}"; | ||
114 | - //$linha = str_replace('new OpenLayers.Layer.WMS(','',$linha); | ||
115 | - //$linha = str_replace('})','}',$linha); | ||
116 | - //$linha = str_replace("'",'"',$linha); | ||
117 | - //$novalinha[] = "[".trim($linha,",")."]"; | ||
118 | } | 110 | } |
119 | } | 111 | } |
120 | 112 | ||
@@ -131,7 +123,7 @@ foreach($chaves as $chave){ | @@ -131,7 +123,7 @@ foreach($chaves as $chave){ | ||
131 | //echo count($hs); | 123 | //echo count($hs); |
132 | $d = $hs; | 124 | $d = $hs; |
133 | array_shift($d); | 125 | array_shift($d); |
134 | - if($arvore[$hs[0]]){ | 126 | + if(array_key_exists(0,$hs) && array_key_exists($hs[0],$arvore)){ |
135 | $arvore[$hs[0]] = array_merge($arvore[$hs[0]],noi($d,$arvore[$hs[0]])); | 127 | $arvore[$hs[0]] = array_merge($arvore[$hs[0]],noi($d,$arvore[$hs[0]])); |
136 | } | 128 | } |
137 | else{ | 129 | else{ |
@@ -146,12 +138,14 @@ $final = array( | @@ -146,12 +138,14 @@ $final = array( | ||
146 | ); | 138 | ); |
147 | error_reporting(0); | 139 | error_reporting(0); |
148 | ob_end_clean(); | 140 | ob_end_clean(); |
149 | -if(extension_loaded('zlib')) | ||
150 | -{ob_start('ob_gzhandler');} | 141 | +if(extension_loaded('zlib')){ |
142 | + ob_start('ob_gzhandler'); | ||
143 | +} | ||
151 | header("Content-type: text/html"); | 144 | header("Content-type: text/html"); |
152 | echo json_encode($final,true); | 145 | echo json_encode($final,true); |
153 | -if(extension_loaded('zlib')) | ||
154 | -{ob_end_flush();} | 146 | +if(extension_loaded('zlib')){ |
147 | + ob_end_flush(); | ||
148 | +} | ||
155 | 149 | ||
156 | //echo json_encode($novalinha,true); | 150 | //echo json_encode($novalinha,true); |
157 | //echo "{".implode($novalinha,",")."}"; | 151 | //echo "{".implode($novalinha,",")."}"; |
@@ -163,8 +157,13 @@ function noi($n,$l){ | @@ -163,8 +157,13 @@ function noi($n,$l){ | ||
163 | array_shift($d); | 157 | array_shift($d); |
164 | //echo count($n); | 158 | //echo count($n); |
165 | if(count($n) > 1){ | 159 | if(count($n) > 1){ |
166 | - if($l[$n[0]]){ | ||
167 | - $l[$n[0]] = array_merge($l[$n[0]],$n[1]); | 160 | + if(array_key_exists(0,$n) && array_key_exists($n[0],$l)){ |
161 | + if(is_array($n[1])){ | ||
162 | + $l[$n[0]] = array_merge($l[$n[0]],$n[1]); | ||
163 | + } | ||
164 | + else{ | ||
165 | + $l[$n[0]] = $l[$n[0]]; | ||
166 | + } | ||
168 | } | 167 | } |
169 | else{ | 168 | else{ |
170 | $l[$n[0]] = $n[1]; | 169 | $l[$n[0]] = $n[1]; |