0) { return substr($s, $c + 1); } return $s; } /** * Get namespace from a tag name. * * Example: input is "topp:the_geom" will return "topp". * * @return String * @param $s String */ final protected function getNameSpace($s) { $c = strpos($s, ":"); if ($c !== false) { return substr($s, 0, $c); } return $s; } /** * Returns the conjunction character of an URL * * @param String $url * @return String the character "&", "?", or "" */ final public function getConjunctionCharacter ($url) { // does the URL contain "?" $pos = strpos($url, "?"); // if yes, ... if ($pos > -1) { // if the last character is "?", return "" if (substr($url, -1) == "?") { return ""; } // if the last character is "&", return "" else if (substr($url, -1) == "&") { return ""; } // "?" exists, so the conunction character must be "&" return "&"; } // "?" doesn't exist, so the conunction character must be "?" return "?"; } final protected function get ($url) { $connection = new connector($url); $e = new mb_notice("OWS REQUEST: " . $url); $data = $connection->file; if (!$data) { $e = new mb_exception("OWS request returned no result: " . $url); return null; } return $data; } final protected function post ($url, $postData) { $connection = new connector(); $connection->set("httpType", "post"); $connection->set("httpContentType", "xml"); $connection->set("httpPostData", $postData); $e = new mb_notice("OWS REQUEST: " . $url . "\n\n" . $postData); $data = $connection->load($url); if (!$data) { $e = new mb_exception("OWS request returned no result: " . $url . "\n" . $postData); return null; } return $data; } } ?>