cvs: presentations /slides/intro ws6.xml
| From: | Rasmus Lerdorf | Date: | Fri, 24 Nov 2006 19:27:46 +0000 |
| Subject: | cvs: presentations /slides/intro ws6.xml | ||
| Groups: | php.pres | ||
| Request: | Send a blank email to pres+get-1360@lists.php.net to get a copy of this message | ||
rasmus Fri Nov 24 19:27:46 2006 UTC
Modified files:
/presentations/slides/intro ws6.xml
Log:
Offline support for the geocoding slide
http://cvs.php.net/viewvc.cgi/presentations/slides/intro/ws6.xml?r1=1.3&r2=1.4&diff_format=u
Index: presentations/slides/intro/ws6.xml
diff -u presentations/slides/intro/ws6.xml:1.3 presentations/slides/intro/ws6.xml:1.4
--- presentations/slides/intro/ws6.xml:1.3 Tue Apr 25 08:20:47 2006
+++ presentations/slides/intro/ws6.xml Fri Nov 24 19:27:46 2006
@@ -7,8 +7,9 @@
<example hide="1" result="1" title="Returned
XML"><![CDATA[<?php
$loc = urlencode(':-:location:-:');
-$data = file_get_contents("http://api.local.yahoo.com/MapsService/V1/geocode?appid=YahooDemo&location=$loc");
-$data = preg_replace("|<(/.*?)>|","<\\1>\n",$data);
+if(!$data = file_get_contents("presentations/slides/intro/geo_{$loc}.xml"))
+ $data = file_get_contents("http://api.local.yahoo.com/MapsService/V1/geocode?appid=YahooDemo&location=$loc");
+$data = preg_replace("|<(/.*?)>|","<\\1>\n",trim($data));
$data = preg_replace("|\">|","\">\n",$data);
echo nl2br(htmlspecialchars($data));
?>]]></example>