Merge branch 'feature/#50' into devel

Conflicts:
	geoapi/api/Api.php
	geoapi/api/SpsApi.php
	geoapi/database/HelloApiSQLManager.php
This commit is contained in:
stubbfel
2013-06-20 11:27:31 +02:00
4 changed files with 36 additions and 4 deletions

View File

@@ -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\"");
}
}
?>

View File

@@ -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;
}
}

View File

@@ -0,0 +1,2 @@
RewriteEngine on
RewriteRule ^ index.php [QSA,L]

View 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();
?>