本文整理汇总了PHP中MySQLDatabase::disconnect方法的典型用法代码示例。如果您正苦于以下问题:PHP MySQLDatabase::disconnect方法的具体用法?PHP MySQLDatabase::disconnect怎么用?PHP MySQLDatabase::disconnect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MySQLDatabase
的用法示例。
在下文中一共展示了MySQLDatabase::disconnect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: FileCache
if (is_numeric($tllon) && -180.0 <= $tllon && $tllon < 180.0 && is_numeric($tllat) && -90.0 <= $tllat && $tllat <= 90.0 && is_numeric($brlon) && -180.0 <= $brlon && $brlon < 180.0 && is_numeric($brlat) && -90.0 <= $brlat && $brlat <= 90.0 && is_numeric($zoom) && $zoom >= 0 && $zoom < 20) {
$min_lat = $tllat < $brlat ? $tllat : $brlat;
$max_lat = $tllat > $brlat ? $tllat : $brlat;
$min_lon = $tllon < $brlon ? $tllon : $brlon;
$max_lon = $tllon > $brlon ? $tllon : $brlon;
$key = "poi_" . $min_lat . "_" . $max_lat . "_" . $min_lon . "_" . $max_lon . "_" . $zoom;
if (strcmp($cache_type, "FileCache") == 0) {
$cache = new FileCache();
} else {
$cache = new NoCache();
}
$xml = $cache->get($key);
if ($xml == FALSE) {
$db = new MySQLDatabase($hostname, $database, $username, $password);
$db->connect();
$poi = new POIManager($db);
$gpx = $poi->getWpts($min_lat, $max_lat, $min_lon, $max_lon, $zoom);
$xml = $gpx->toXml();
$db->disconnect();
$cache->put($key, $xml);
}
header("Content-type: text/xml; charset=utf-8");
print $xml;
} else {
header("Content-type: text/plain; charset=utf-8");
print "Invalid Input";
}
} else {
header("Content-type: text/plain; charset=utf-8");
print "Unsupported Action";
}