Merge branch 'feature/#50' into devel
Conflicts: geoapi/api/Api.php geoapi/api/SpsApi.php geoapi/database/HelloApiSQLManager.php
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
include_once "../../global.inc.php";
|
||||
include_once PATH_DATABASE . "/SQLManager.php";
|
||||
include_once PATH_DATABASE . "/SpsSqlManager.php";
|
||||
include_once PATH_DATABASE . "/SqlManager.php";
|
||||
|
||||
namespace database;
|
||||
|
||||
@@ -10,8 +11,21 @@ namespace database;
|
||||
* @author stubbfel
|
||||
* @since 20.06.2013
|
||||
*/
|
||||
class SpsSqlManager {
|
||||
//put your code here
|
||||
class SpsSqlManager extends SQLManager{
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
public function sendSpsQuery($queryArgs = array()) {
|
||||
// TODO Input validitaion
|
||||
$alias = $queryArgs["alias"];
|
||||
return $this->query("SELECT * FROM sps Where alias = \"$alias\"");
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace database;
|
||||
* @author stubbfel
|
||||
* @since 20.06.2013
|
||||
*/
|
||||
class SQLManager {
|
||||
abstract class SqlManager {
|
||||
|
||||
/**
|
||||
* Variable for address of the server
|
||||
@@ -83,6 +83,7 @@ class SQLManager {
|
||||
public function closeConnection() {
|
||||
if ($this->link) {
|
||||
mysql_close($this->link);
|
||||
$this->link =null;
|
||||
}
|
||||
}
|
||||
|
||||
2
geoapi/service/sps/.htaccess
Normal file
2
geoapi/service/sps/.htaccess
Normal file
@@ -0,0 +1,2 @@
|
||||
RewriteEngine on
|
||||
RewriteRule ^ index.php [QSA,L]
|
||||
15
geoapi/service/sps/index.php
Normal file
15
geoapi/service/sps/index.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
include_once "../../global.inc.php";
|
||||
require_once PATH_API . "/SpsApi.php";
|
||||
|
||||
|
||||
$app = new SpsApi();
|
||||
|
||||
$app->get('/alias/:alias', function ($alias) use ($app) {
|
||||
$args =array();
|
||||
$args["alias"] = $alias;
|
||||
print_r($app->sendSpsQuery($args));
|
||||
});
|
||||
|
||||
$app->run();
|
||||
?>
|
||||
Reference in New Issue
Block a user