Commit b3d721c455303c57430ad47c1fb96afec777ec4c
1 parent
96a09fef
Exists in
master
and in
7 other branches
Correção na opção de visualização de serviços wms
Showing
4 changed files
with
15 additions
and
4 deletions
Show diff stats
admin/admin.db
No preview for this file type
classesphp/wmswfs.php
@@ -53,7 +53,7 @@ Return: | @@ -53,7 +53,7 @@ Return: | ||
53 | */ | 53 | */ |
54 | function gravaCacheWMS($servico) | 54 | function gravaCacheWMS($servico) |
55 | { | 55 | { |
56 | - global $dir_tmp; | 56 | + global $dir_tmp, $i3geo_proxy_server; |
57 | if($dir_tmp == ""){ | 57 | if($dir_tmp == ""){ |
58 | include(dirname(__FILE__)."/../ms_configura.php"); | 58 | include(dirname(__FILE__)."/../ms_configura.php"); |
59 | } | 59 | } |
@@ -75,14 +75,25 @@ function gravaCacheWMS($servico) | @@ -75,14 +75,25 @@ function gravaCacheWMS($servico) | ||
75 | $wms_service_request .= "&VERSION=1.1.1"; | 75 | $wms_service_request .= "&VERSION=1.1.1"; |
76 | } | 76 | } |
77 | $nome = $dir_tmp."/wms".md5($servico).".xml"; | 77 | $nome = $dir_tmp."/wms".md5($servico).".xml"; |
78 | + //echo ($wms_service_request);exit; | ||
78 | if(!file_exists($nome)){ | 79 | if(!file_exists($nome)){ |
79 | - $wms_capabilities = file($wms_service_request); | ||
80 | - if( !$wms_capabilities ){ | 80 | + //$wms_capabilities = file($wms_service_request); |
81 | + $curl = curl_init(); | ||
82 | + curl_setopt ($curl, CURLOPT_URL, $wms_service_request); | ||
83 | + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); | ||
84 | + curl_setopt($curl, CURLOPT_HEADER, 0); | ||
85 | + if(isset($i3geo_proxy_server) && $i3geo_proxy_server != ""){ | ||
86 | + curl_setopt($curl, CURLOPT_PROXY, $i3geo_proxy_server); | ||
87 | + } | ||
88 | + $wms_capabilities = curl_exec($curl); | ||
89 | + curl_close ($curl); | ||
90 | + if( !$wms_capabilities || $wms_capabilities == ""){ | ||
81 | return "erro"; | 91 | return "erro"; |
82 | } | 92 | } |
83 | else{ | 93 | else{ |
84 | $fp = fopen($nome, 'w'); | 94 | $fp = fopen($nome, 'w'); |
85 | - fwrite($fp, implode("",$wms_capabilities)); | 95 | + //fwrite($fp, implode("",$wms_capabilities)); |
96 | + fwrite($fp,$wms_capabilities); | ||
86 | fclose($fp); | 97 | fclose($fp); |
87 | } | 98 | } |
88 | } | 99 | } |