Commit 299a3fd56e597b222dfeb6eaf75886c690ac4731
1 parent
7cbf851f
Exists in
master
and in
7 other branches
Correção nos valores de timeout e eliminação de erro_reporting na função de acesso à WMS
Showing
3 changed files
with
12 additions
and
2 deletions
Show diff stats
classesphp/classe_analise.php
| @@ -135,7 +135,7 @@ Include: | @@ -135,7 +135,7 @@ Include: | ||
| 135 | */ | 135 | */ |
| 136 | function analiseDistriPt($locaplic,$dir_tmp,$R_path,$numclasses,$tipo,$cori,$corf,$tmpurl,$sigma="",$limitepontos="TRUE",$tema2="",$extendelimite=5) | 136 | function analiseDistriPt($locaplic,$dir_tmp,$R_path,$numclasses,$tipo,$cori,$corf,$tmpurl,$sigma="",$limitepontos="TRUE",$tema2="",$extendelimite=5) |
| 137 | { | 137 | { |
| 138 | - set_time_limit(180); | 138 | + set_time_limit(120); |
| 139 | // | 139 | // |
| 140 | //pega os dados do tema dois para as funções que o utilizam | 140 | //pega os dados do tema dois para as funções que o utilizam |
| 141 | // | 141 | // |
classesphp/mapa_controle.php
| @@ -119,6 +119,10 @@ if ($funcao != "criaMapa") | @@ -119,6 +119,10 @@ if ($funcao != "criaMapa") | ||
| 119 | if (isset($debug) && $debug == "sim") | 119 | if (isset($debug) && $debug == "sim") |
| 120 | {error_reporting(0);} | 120 | {error_reporting(0);} |
| 121 | // | 121 | // |
| 122 | +//teste de timeout | ||
| 123 | +// | ||
| 124 | +//for($i==0;$i<5000000000;$i++){} | ||
| 125 | +// | ||
| 122 | //ativa o php mapscript e as extensões necessárias | 126 | //ativa o php mapscript e as extensões necessárias |
| 123 | //se as extensões já estiverem carregadas no PHP, vc pode comentar essa linha para que o processamento fique mais rápido | 127 | //se as extensões já estiverem carregadas no PHP, vc pode comentar essa linha para que o processamento fique mais rápido |
| 124 | // | 128 | // |
classesphp/wmswfs.php
| @@ -47,13 +47,16 @@ Nome do arquivo criado | @@ -47,13 +47,16 @@ Nome do arquivo criado | ||
| 47 | function gravaCacheWMS($servico) | 47 | function gravaCacheWMS($servico) |
| 48 | { | 48 | { |
| 49 | global $dir_tmp; | 49 | global $dir_tmp; |
| 50 | + error_reporting(0); | ||
| 51 | + try{ | ||
| 50 | $teste = explode("=",$servico); | 52 | $teste = explode("=",$servico); |
| 51 | if ( count($teste) > 1 ){$servico = $servico."&";} | 53 | if ( count($teste) > 1 ){$servico = $servico."&";} |
| 52 | $wms_service_request = $servico . "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1"; | 54 | $wms_service_request = $servico . "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1"; |
| 53 | $nome = $dir_tmp."/wms".md5($servico).".xml"; | 55 | $nome = $dir_tmp."/wms".md5($servico).".xml"; |
| 54 | if(!file_exists($nome)) | 56 | if(!file_exists($nome)) |
| 55 | { | 57 | { |
| 56 | - if( !($wms_capabilities = file($wms_service_request)) ) | 58 | + $wms_capabilities = file($wms_service_request); |
| 59 | + if( !$wms_capabilities ) | ||
| 57 | {return "erro";} | 60 | {return "erro";} |
| 58 | else | 61 | else |
| 59 | { | 62 | { |
| @@ -63,6 +66,8 @@ function gravaCacheWMS($servico) | @@ -63,6 +66,8 @@ function gravaCacheWMS($servico) | ||
| 63 | } | 66 | } |
| 64 | } | 67 | } |
| 65 | return $nome; | 68 | return $nome; |
| 69 | + } | ||
| 70 | + catch(Exception $e){return "erro";} | ||
| 66 | } | 71 | } |
| 67 | /* | 72 | /* |
| 68 | function: existeTemaWFS | 73 | function: existeTemaWFS |
| @@ -386,6 +391,7 @@ function listaLayersWMS() | @@ -386,6 +391,7 @@ function listaLayersWMS() | ||
| 386 | $wms_service_request = gravaCacheWMS($servico); | 391 | $wms_service_request = gravaCacheWMS($servico); |
| 387 | include_once("../admin/php/admin.php"); | 392 | include_once("../admin/php/admin.php"); |
| 388 | include_once("../admin/php/webservices.php"); | 393 | include_once("../admin/php/webservices.php"); |
| 394 | + error_reporting(0); | ||
| 389 | if($nivel < 2){ | 395 | if($nivel < 2){ |
| 390 | if($wms_service_request == "erro") { | 396 | if($wms_service_request == "erro") { |
| 391 | //registra a tentativa de acesso | 397 | //registra a tentativa de acesso |