finish #64
This commit is contained in:
@@ -23,9 +23,11 @@ abstract class Api extends \Slim\Slim {
|
||||
/**
|
||||
* Default-Constructor
|
||||
*/
|
||||
public function __construct() {
|
||||
public function __construct() {
|
||||
$this->connect();
|
||||
parent::__construct();
|
||||
|
||||
// set content type td xml
|
||||
$this->contentType("Content-type: application/xml;charset=utf-8");
|
||||
}
|
||||
|
||||
@@ -33,6 +35,8 @@ abstract class Api extends \Slim\Slim {
|
||||
* Default-DeConstructor
|
||||
*/
|
||||
public function __destruct() {
|
||||
|
||||
// destroy the sqlManager
|
||||
$this->sqlManager->closeConnection();
|
||||
unset($this->sqlManager);
|
||||
$this->sqlManager = null;
|
||||
|
||||
@@ -9,7 +9,7 @@ include_once PATH_UTILITTY . "/ArrayManager.php";
|
||||
require_once PATH_API . "/Api.php";
|
||||
|
||||
/**
|
||||
* This class provides some spezial SpsAPI methods
|
||||
* This class provides some spezial PisAPI methods
|
||||
* @author stubbfel
|
||||
* @since 20.06.2013
|
||||
*/
|
||||
|
||||
@@ -9,7 +9,7 @@ include_once PATH_UTILITTY . "/ArrayManager.php";
|
||||
require_once PATH_API . "/Api.php";
|
||||
|
||||
/**
|
||||
* This class provides some spezial SpsAPI methods
|
||||
* This class provides some spezial PssAPI methods
|
||||
* @author stubbfel
|
||||
* @since 20.06.2013
|
||||
*/
|
||||
@@ -52,7 +52,6 @@ class PssApi extends Api {
|
||||
|
||||
if (count($pidList) < $this->maxPid) {
|
||||
$result = $this->sqlManager->sendPssQuery($pidList);
|
||||
|
||||
return \utiliy\XmlManager::arrayToPssXml($result);
|
||||
}
|
||||
return NULL;
|
||||
|
||||
@@ -21,7 +21,7 @@ class SpsApi extends Api {
|
||||
public static $routeParameterAlias = "/alias/:alias";
|
||||
|
||||
/**
|
||||
* Route string for the alias paramter
|
||||
* Route string for the domain paramter
|
||||
* @var string
|
||||
*/
|
||||
public static $routeParameterDomain = "/domain/:domain";
|
||||
@@ -116,7 +116,6 @@ class SpsApi extends Api {
|
||||
public function __construct() {
|
||||
$this->sqlManager = new \database\SpsSqlManager();
|
||||
parent::__construct();
|
||||
$this->contentType("Content-type: application/xml;charset=utf-8");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -142,6 +141,8 @@ class SpsApi extends Api {
|
||||
* @return querry result as xml
|
||||
*/
|
||||
public function sendSpsCoordinateQuery($queryArgs) {
|
||||
|
||||
// check arguments of the query
|
||||
if (!array_key_exists(SpsApi::$keyLong, $queryArgs) || !array_key_exists(SpsApi::$keyLat, $queryArgs)) {
|
||||
return null;
|
||||
}
|
||||
@@ -152,7 +153,10 @@ class SpsApi extends Api {
|
||||
return null;
|
||||
}
|
||||
|
||||
// build a request polygon
|
||||
$queryArgs[SpsApi::$keyPoly] = $this->createPolygon($latitude, $longitude, $this->range);
|
||||
|
||||
// send querry
|
||||
$result = $this->sqlManager->sendSpsCoordinateQuery($queryArgs);
|
||||
return \utiliy\XmlManager::arrayToSpsXml($result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user