43 lines
1.5 KiB
PHP
43 lines
1.5 KiB
PHP
<?php
|
|
|
|
include_once "../../global.inc.php";
|
|
require_once PATH_API . "/SpsApi.php";
|
|
|
|
// get reguest header
|
|
$headers = apache_request_headers();
|
|
|
|
// instance a new api
|
|
$app = new \api\SpsApi($headers);
|
|
|
|
// HTTP-Get-Methods
|
|
$app->get(\api\SpsApi::$routeParameterAlias, function ($alias) use ($app) {
|
|
$args = array();
|
|
$args[\api\SpsApi::$keyAlias] = $alias;
|
|
echo $app->sendSpsAliasQuery($args);
|
|
});
|
|
|
|
$app->get(\api\SpsApi::$routeParameterAlias . \api\SpsApi::$routeParameterDomain, function ($alias, $domain) use ($app) {
|
|
$args = array();
|
|
$args[\api\SpsApi::$keyAlias] = $alias;
|
|
$args[\api\SpsApi::$keyDomain] = $domain;
|
|
echo $app->sendSpsAliasQuery($args);
|
|
});
|
|
|
|
$app->get(\api\SpsApi::$routeParameterLatitude . \api\SpsApi::$routeParameterLongitude, function ($latitude, $longitude) use ($app) {
|
|
$args = array();
|
|
$args[\api\SpsApi::$keyLong] = $longitude;
|
|
$args[\api\SpsApi::$keyLat] = $latitude;
|
|
echo ($app->sendSpsCoordinateQuery($args));
|
|
});
|
|
|
|
$app->get(\api\SpsApi::$routeParameterLatitude . \api\SpsApi::$routeParameterLongitude . \api\SpsApi::$routeParameterDomain, function ($latitude, $longitude, $domain) use ($app) {
|
|
$args = array();
|
|
$args[\api\SpsApi::$keyLong] = $longitude;
|
|
$args[\api\SpsApi::$keyLat] = $latitude;
|
|
$args[\api\SpsApi::$keyDomain] = $domain;
|
|
echo ($app->sendSpsCoordinateQuery($args));
|
|
});
|
|
|
|
$app->run();
|
|
?>
|