This commit is contained in:
stubbfel
2013-06-20 11:26:10 +02:00
parent 0f21ccfe25
commit 61f8cbbf4f
92 changed files with 33401 additions and 30 deletions

View File

@@ -5,11 +5,25 @@ include_once PATH_DATABASE . "/SQLManager.php";
require_once PATH_3PARTY . "/Slim/Slim.php";
\Slim\Slim::registerAutoloader();
namespace api;
/**
* This class provides some general API methods
* @author stubbfel
* @since 20.06.2013
*/
abstract class Api extends \Slim\Slim {
/**
* Variable for the sql manager of the api
* @var <T>:SqlManager
*/
protected $sqlManager;
public function __construct() {
/**
* Default-Constructor
*/
public function Api() {
if (!$this->sqlManager) {
echo "bla";
$this->sqlManager = new SQLManager();
@@ -17,11 +31,16 @@ abstract class Api extends \Slim\Slim {
parent::__construct();
}
/**
* Default-DeConstructor
*/
public function __destruct() {
$this->sqlManager = null;
//parent::__destruct();
}
/**
* Method start a connection to the database
*/
public function connect() {
$this->sqlManager->connect();
}

View File

@@ -1,27 +1,31 @@
<?php
include_once "../../global.inc.php";
require_once PATH_API."/Api.php";
include_once "../../global.inc.php";
require_once PATH_API . "/Api.php";
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
namespace api;
/**
* Description of HelloApi
*
* This class provides some spezial SpsAPI methods
* @author stubbfel
* @since 20.06.2013
*/
class SpsApi extends Api{
public function __construct() {
class SpsApi extends Api {
/**
* Default-Constructor
*/
public function SpsApi() {
parent::__construct();
}
/**
* Default-DeConstructor
*/
public function __destruct() {
parent::__destruct();
}
}
?>