Index: src/webservice/CMakeLists.txt
===================================================================
--- src/webservice/CMakeLists.txt	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ src/webservice/CMakeLists.txt	(revision 16cceaa3078254d1ce5255c09bcc1498bedbd731)
@@ -20,11 +20,5 @@
 ######################
 
-SET(WEBSERVICE_OUTPUT_APP_DIRECTORY "${WEBSERVICE_OUTPUT_DIRECTORY}/${WEBSERVICE_API_VERSION}")
-
-# switch Slim mode according to CMake debug mode
-SET(WEBSERVICE_MODE "production")
-IF(BUILD_DEBUG)
-	SET(WEBSERVICE_MODE "development")
-ENDIF(BUILD_DEBUG)
+SET(WEBSERVICE_OUTPUT_DIRECTORY ${WEB_OUTPUT_DIRECTORY}/webservice)
 
 # ADD_CUSTOM_COMMAND(
@@ -35,29 +29,9 @@
 # )
 
-CONFIGURE_FILE("config/config.php.in" "${WEBSERVICE_OUTPUT_DIRECTORY}/config/config.php")
-CONFIGURE_FILE("config/internalconfig.php.in" "${WEBSERVICE_OUTPUT_APP_DIRECTORY}/inc/internalconfig.php")
-# workaround to copy "hidden" file .htaccess. copy command ignores it
-CONFIGURE_FILE("htaccess.in" "${WEBSERVICE_OUTPUT_APP_DIRECTORY}/.htaccess")
-
 FILE(GLOB src_HTDOCS "htdocs/*.*")
-ADD_CUSTOM_TARGET(webservice-prepare ALL
-	COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/htdocs" "${WEBSERVICE_OUTPUT_APP_DIRECTORY}"
+ADD_CUSTOM_TARGET(webservice ALL
+	COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/htdocs" "${WEBSERVICE_OUTPUT_DIRECTORY}"
 # 	DEPENDS "${WEBSERVICE_OUTPUT_DIRECTORY}/${STAFF_WSDL_FILE}"
-	COMMENT "Preparing webservice"
+	COMMENT "Preparing webclient"
 	SOURCES ${src_HTDOCS}
 )
-
-#######################
-#
-# PHPUnit tests
-#
-#######################
-CONFIGURE_FILE("testconfig/testconfig.php.in" "${WEBSERVICE_TEST_OUTPUT_DIRECTORY}/testconfig/testconfig.php")
-
-FILE(GLOB src_HTDOCS_TEST "tests/*.*")
-ADD_CUSTOM_TARGET(webservice-tests-prepare ALL
-	COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/tests" "${WEBSERVICE_TEST_OUTPUT_DIRECTORY}"
-# 	DEPENDS "${WEBSERVICE_OUTPUT_DIRECTORY}/${STAFF_WSDL_FILE}"
-	COMMENT "Preparing webservice tests"
-	SOURCES ${src_HTDOCS_TEST}
-)
Index: src/webservice/config/config.php.in
===================================================================
--- src/webservice/config/config.php.in	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,30 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-$config = [
-	"mode" => "@WEBSERVICE_MODE@",
-	"webserviceBaseUrl" => "@WEBSERVICE_BASE_URL_COMPLETE@",
-	"spatialiteExtension" => "mod_spatialite.so",
-	"geonamesUsername" => "@WEBSERVICE_GEONAMES_USERNAME@",
-	"mailaddressFrom" => "webmaster@example.org",
-	"mailaddressCC" => "info@example.org",
-];
-
-?>
Index: src/webservice/config/internalconfig.php.in
===================================================================
--- src/webservice/config/internalconfig.php.in	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,30 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-/**
-  * @brief Should not be edited by the user! Holds internal values configured by the developer / build system
-  */
-$internalconfig = [
-	"version" => "@VERSION@",
-	"webserviceApiVersion" => "@WEBSERVICE_API_VERSION@",
-	"databaseVersionCore" => "@WEBSERVICE_DATABASE_SCHEMA_VERSION_CORE@"
-];
-
-?>
Index: src/webservice/htaccess.in
===================================================================
--- src/webservice/htaccess.in	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,27 +1,0 @@
-######################
-#
-#    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-#
-#    This library is free software; you can redistribute it and/or
-#    modify it under the terms of the GNU Lesser General Public
-#    License as published by the Free Software Foundation; either
-#    version 2.1 of the License, or (at your option) any later version.
-#
-#    This library is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#    Lesser General Public License for more details.
-#
-#    You should have received a copy of the GNU Lesser General Public
-#    License along with this library; if not, write to the Free Software
-#    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-#    MA 02110-1301  USA.
-#
-######################
-
-# Requires AllowOverride All directive in your apache config
-RewriteEngine On
-RewriteBase @WEBSERVICE_BASE_URL@
-RewriteCond %{REQUEST_FILENAME} !-f
-RewriteCond %{REQUEST_FILENAME} !-d
-RewriteRule ^ index.php [QSA,NC,L]
Index: src/webservice/htdocs/SiWeather/Webservice/DataDirectoryChecks.php
===================================================================
--- src/webservice/htdocs/SiWeather/Webservice/DataDirectoryChecks.php	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,34 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-
-namespace SiWeather\Webservice;
-
-abstract class DataDirectoryChecks
-{
-	const Success = 0;
-	const Error = 1;
-	const NoConfiguration = 2;
-	const NoDirectoryPath = 3;
-    const NotExist = 4;
-    const DirectoryNotWritable = 5;
-}
-
-?>
Index: src/webservice/htdocs/SiWeather/Webservice/DatabaseChecks.php
===================================================================
--- src/webservice/htdocs/SiWeather/Webservice/DatabaseChecks.php	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,35 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-
-namespace SiWeather\Webservice;
-
-abstract class DatabaseChecks
-{
-	const Success = 0;
-	const Error = 1;
-    const NoDatabaseFile = 2;
-    const NoDirectoryPath = 3;
-    const DirectoryDoesNotExist = 4;
-    const DirectoryNotWritable = 5;
-    const DatabaseFileNotWritable = 6;
-}
-
-?>
Index: src/webservice/htdocs/SiWeather/Webservice/DatabaseHandler.php
===================================================================
--- src/webservice/htdocs/SiWeather/Webservice/DatabaseHandler.php	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,238 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-namespace SiWeather\Webservice;
-
-/**
-	* @brief Manages the database connection for SiWeather webservice
-	* @note This class needs to load the SpatialLite SQLite extension.
-	*       Therefore the sqlite3.extension_dir in php.ini must be set
-  *       to a path, where this extension could be found!
-	*/
-class DatabaseHandler {
-	function __construct()
-	{
-		$this->_config = new WebserviceConfig();
-	
-		$this->_lastErrorMessage = "";
-		$this->_database = null;
-		if(!$this->_config->dataDirectory()){
-			$this->setLastErrorMessage("Could not connect to the database: No data directory set!");
-			$this->databaseFile = null;
-		}
-		else{
-			$this->_databaseFile = $this->_config->dataDirectory() ."/siweather.sqlite";
-		}
-	}
-
-	function __destruct()
-	{
-		if(!is_null($this->_database)){
-			$this->close();
-		}
-	}
-
-	public function databaseFile()
-	{
-		return $this->_databaseFile;
-	}
-
-	public function lastErrorMessage()
-	{
-		return $this->_lastErrorMessage;
-	}
-
-	public function lastDatabaseErrorMessage(){
-		if(is_null($this->_database))
-			return false;
-		return $this->_database->lastErrorMsg();
-	}
-
-	public function lastInsertRowId(){
-		if(is_null($this->_database))
-			return -1;
-		return $this->_database->lastInsertRowID();
-	}
-
-	/**
-	 * @brief Connects to the database and does some checks.
-	 *
-	 * @note This function should only called by the setup with @p ignoreVersion = true!
-	 *       Otherwise the database version is not checked! Data loss may be the consequence!
-	 */
-	public function connect($ignoreVersion = false)
-	{
-		if(!is_null($this->_database)){
-			return true;
-		}
-		if(is_null($this->_databaseFile) || empty($this->_databaseFile)){
-			$this->setLastErrorMessage("Could not connect to the database: No database file given");
-			return false;
-		}
-		try {
-			$db = new \SQLite3($this->_databaseFile, SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE);
-		}
-		catch(\Exception $exception){
-			$this->setLastErrorMessage("Could not connect to the database: "+ $exception->getMessage());
-			return false;
-		}
-		// loading SpatiaLite as an extension
-		$extension = $this->_config->getConfig("spatialiteExtension");
-		if(empty($extension)){
-			$this->setLastErrorMessage("No spatialiteExtension set!");
-			return false;
-		}
-		if(!$db->loadExtension($extension)){
-			$this->setLastErrorMessage("Could not load SpatialLite extension: ". $db->lastErrorMsg());
-			return false;
-		}
-		$this->_database = $db;
-
-		// check schema version
-		if(!$this->checkVersions() && !$ignoreVersion)
-			return false;
-		
-		return true;
-	}
-
-	public function close()
-	{
-		if(is_null($this->_database)){
-			return true;
-		}
-		if($this->_database->close()){
-			$this->_database = null;
-			return true;
-		}
-		$this->setLastErrorMessage("Failed to close the database: "+ $this->_database->lastErrorMsg());
-		return false;
-	}
-	
-	public function databaseTableExists($table){
-		if(!$this->_database || !is_object($this->_database)){
-			return false;
-		}
-		$statement = $this->prepare("SELECT COUNT(*) FROM sqlite_master WHERE type=\"table\" AND name=:name");
-		if(!$statement){
-			$this->setLastErrorMessage(\Translator::swGettext("Could not prepare query to check if table %s exists", $table));
-			return false;
-		}
-		$statement->bindValue(":name", $table);
-		$result = $statement->execute();
-		$row = $result->fetchArray();
-		if(!$row || !is_array($row) || count($row) < 1 || $row[0] != 1)
-			return false;
-		return true;
-	}
-	
-	public function checkVersions(){
-		if(is_null($this->_database)){
-			$this->setLastErrorMessage("No database available to check versions");
-			return false;
-		}
-		$table = "schema";
-		if(!$this->databaseTableExists($table)){
-			$this->setLastErrorMessage("Database table with schema versions does not exists!");
-			return false;
-		}
-
-		// check schema version
-		$neededVersion = $this->_config->getConfig("databaseVersionCore");
-		$currentVersion = $this->exec("SELECT version FROM ". $table ." WHERE name='core'");
-		if(empty($neededVersion) || !is_numeric($neededVersion) || !$currentVersion || $currentVersion != $neededVersion){
-			$this->setLastErrorMessage("Found wrong database core version. Expected ". $neededVersion ." got ". $currentVersion);
-			return false;
-		}
-		return true;
-	}
-	
-	public function exec($query)
-	{
-		if(is_null($this->_database)){
-			return false;
-		}
-		if(!$this->connect()){
-			return false;
-		}
-		$result = $this->_database->exec($query);
-		if(!$result)
-			$this->setLastErrorMessage("Could not execute databae query \"". $query ."\": ". $this->_database->lastErrorMsg());
-		return $result;
-	}
-	
-	public function prepare($query)
-	{
-		if(is_null($this->_database)){
-			return false;
-		}
-		if(!$this->connect()){
-			return false;
-		}
-		$result = $this->_database->prepare($query);
-		if(!$result){
-			error_log("logging");
-			$this->setLastErrorMessage("Could not prepare database query \"". $query ."\": ". $this->_database->lastErrorMsg());
-		}
-		return $result;
-	}
-	
-	public function versionSpatialite(){
-		if(is_null($this->_database)){
-			$this->setLastErrorMessage("No database connection");
-			return 0;
-		}
-		if(!$this->connect()){
-			return 0;
-		}
-		$result = $this->_database->query("SELECT spatialite_version()");
-		while($row = $result->fetchArray()){
-			return $row[0];
-		}
-		return 0;
-	}
-	
-	public function versionSqlite(){
-		if(is_null($this->_database)){
-			$this->setLastErrorMessage("No database connection");
-			return 0;
-		}
-		if(!$this->connect()){
-			return 0;
-		}
-		$result = $this->_database->query("SELECT sqlite_version()");
- 		while($row = $result->fetchArray()){
-			return $row[0];
-		}
-		return 0;
-	}
-
-	private function setLastErrorMessage($message){
-		if(!empty($message))
-			error_log($message);
-		$this->_lastErrorMessage = $message;
-	}
-	
-	private $_database;
-	private $_databaseFile;
-	private $_lastErrorMessage;
-	private $_config;
-}
-
-?>
Index: src/webservice/htdocs/SiWeather/Webservice/GeoLocator.php
===================================================================
--- src/webservice/htdocs/SiWeather/Webservice/GeoLocator.php	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,136 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-namespace SiWeather\Webservice;
-
-/**
-  * @brief Retrieves geo location data for different input data
-  *
-  * Returns null if someting failed.
-  *
-  * @note Requires Services_GeoNames
-  */
-class GeoLocator
-{
-	private static $_serviceBaseUrl = "http://api.geonames.org/";
-
-	public static function configured(){
-		if(empty(self::$_serviceBaseUrl))
-			return false;
-		if(!self::getUsername())
-			return false;
-		return true;
-	}
-
-	/**
-		* @brief Get locations within radius @p radius around @p latitude and @p longitude.
-		* 
-		* Returns an array of Location objects.
-		*
-		* @see Location
-		*/
-	public static function locations($latitude, $longitude, $radius, &$errorMessage){
-		if(!Location::validLatitude($latitude)){
-			$errorMessage = "GeoLocator: ". $latitude ." is no valid latitude";
-			return false;
-		}
-		if(!Location::validLatitude($longitude)){
-			$errorMessage = "GeoLocator: ".$longitude ."is no valid longitude";
-			return false;
-		}
-		if(!$radius || !is_numeric($radius) || $radius < 1){
-			$errorMessage = "GeoLocator: No or invalid radius given (". $radius .")";
-			return false;
-		}
-	
-		$user = self::getUsername();
-		if(!$user){
-			$errorMessage = "geonames webservice not configured";
-			return false;
-		}
-
-		$client = new \GuzzleHttp\Client
-		(
-			[
-				"base_uri" => self::$_serviceBaseUrl,
-				"timeout" => 2.0,								# we need a very small timeout here, because otherwise the request of our caller function may time out!
-				"http_errors" => false,
-			]
-		);
-		try{
-			$response = $client->get("findNearbyPlaceNameJSON?lat=". $latitude ."&lng=". $longitude ."&username=". $user ."&lang=local&radius=". $radius ."&style=full");
-		}
-		catch(Exception $exception){
-			$errorMessage = "GeoLocator: Fetched connect exception: ". $exception->getMessage();
-			error_log($errorMessage);
-			return false;
-		}
-		if(is_null($response)){
-			$errorMessage = "GeoLocator: Failed to fetch locations";
-			error_log($errorMessage);
-			return false;
-		}
-		if($response->getStatusCode() != 200){
-			if($response->getStatusCode() == 403){
-				$errorMessage = "GeoLocator: Probably too many ". $baseUrl ." requests (>2000/hour or >30000/day). Reason:". $response->getReasonPhrase();
-			}
-			else{
-				$errorMessage = "GeoLocator: Request failed with code ". $response->getStatusCode() ." and reason ". $response->getReasonPhrase();
-			}
-			error_log($errorMessage);
-			return false;
-		}
-
-		$body = $response->getBody();
-		if(empty($body)){
-			$errorMessage = "GeoLocator: Returned empty body";
-			error_log($errorMessage);
-			return false;
-		}
-		$json = json_decode($body, true);
-		if(is_null($json) || !$json || !is_array($json) || !array_key_exists("geonames", $json)){
-			$errorMessage = "GeoLocator: Could not convert answer into json data\n". $body;
-			error_log($errorMessage);
-			return false;
-		}
-		
-		$result = array();
-		foreach($json["geonames"] as $geoname){
-			$result[] = new Location($geoname["name"], "",
-									$geoname["adminName1"], $geoname["adminCode1"],
-									$geoname["countryName"], $geoname["countryCode"],
-									$geoname["lat"], $geoname["lng"],
-									$geoname["timezone"]["timeZoneId"]);
-		}
-		return $result;
-	}
-
-	private static function getUsername(){
-		$webserviceConfig = new WebserviceConfig();
-		$user = $webserviceConfig->getConfig("geonamesUsername");
-		if(!$user || empty($user)){
-			error_log("GeoLocator: No geonamesUsername set. Please adjust your webservice configuration");
-			return false;
-		}
-		return $user;
-	}
-}
-
-?>
Index: src/webservice/htdocs/SiWeather/Webservice/Location.php
===================================================================
--- src/webservice/htdocs/SiWeather/Webservice/Location.php	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,162 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-namespace SiWeather\Webservice;
-
-/**
-  * @brief Describes a city in a region and a country.
-  *
-  * The codes (region and country) are Alpha 2 codes from ISO 3166-1 (country) and ISO 3166-2 (subdivision).
-  *
-  */
-class Location
-{
-	public function __construct($city, $postalCode = "",
-								$regionName = "", $regionCode = "",
-								$countryName = "", $countryCode = "",
-								$latitude = "", $longitude = "", 
-								$timeZone = ""){
-
-		$this->_city = "";
-		$this->_postalCode = "";
-		$this->_regionName = "";
-		$this->_regionCode = "";
-		$this->_countryName = "";
-		$this->_countryCode = "";
-		$this->_longitude = 0;
-		$this->_latitude = 0;
-		$this->_timeZone = "";
-
-
-		$this->setCity($city);
-		$this->setPostalCode($postalCode);
-		$this->setRegion($regionName, $regionCode);
-		$this->setCountry($countryName, $countryCode);
-		$this->setLocation($latitude, $longitude);
-		$this->setTimezone($timeZone);
-	}
-
-	public function setCity($name){
-		$this->_city = $name;
-	}
-	
-	public function city(){
-		return $this->_city;
-	}
-	
-	public function setPostalCode($code){
-		$this->_postalCode = $code;
-	}
-	
-	public function postalCode(){
-		return $this->_postalCode;
-	}
-	
-	public function setRegion($name, $code){
-		$this->_regionName = $name;
-		if(strlen($code) == 2)
-			$this->_regionCode = $code;
-	}
-	
-	public function regionName(){
-		return $this->_regionName;
-	}
-	
-	public function regionCode(){
-		return $this->_regionCode;
-	}
-
-	public function setCountry($name, $code){
-		$this->_countryName = $name;
-		if(strlen($code) == 2)
-			$this->_countryCode = $code;
-	}
-	
-	public function countryName(){
-		return $this->_countryName;
-	}
-	
-	public function countryCode(){
-		return $this->_countryCode;
-	}
-	
-	/**
-	  * @brief Sets the location to @p $latitude and @p $longitude
-	  *
-	  * @note Please note that this functions arguments are in the typical order of 
-	  *       city coordinates, whereas the WKT format turned around those values
-	  *       (WKT(Longitude Latitude)).
-	  *
-	  * @see latitude()
-	  * @see longitude()
-	  * @see locationWkt()
-	  */
-	public function setLocation($latitude, $longitude){
-		if(self::validLatitude($latitude))
-			$this->_latitude = $latitude;
-		if(self::validLongitude($longitude))
-			$this->_longitude = $longitude;
-	}
-	
-	public function latitude(){
-		return $this->_latitude;
-	}
-	
-	public function longitude(){
-		return $this->_longitude;
-	}
-	
-	public function locationWkt(){
-		return $this->longitude() ." ". $this->latitude();
-	}
-
-	public static function validLatitude($latitude){
-		if(is_numeric($latitude) && (-90.0 <= $latitude && $latitude <= 90.0))
-			return true;
-		return false;
-	}
-
-	public static function validLongitude($longitude){
-		if(is_numeric($longitude) && (-180.0 <= $longitude && $longitude <= 180.0))
-			return true;
-		return false;
-	}
-
-	public function setTimeZone($zone){
-		if(preg_match("/^[\D]+\/[\D]+$/", $zone) > 0)
-			$this->_timeZone = $zone;
-	}
-	
-	public function timeZone(){
-		return $this->_timeZone;
-	}
-
-	private $_countryCode;
-	private $_countryName;
-	private $_regionCode;
-	private $_regionName;
-	private $_city;
-	private $_postalCode;
-	private $_timeZone;
-	private $_latitude;
-	private $_longitude;
-}
-
-?>
Index: src/webservice/htdocs/SiWeather/Webservice/Setup.php
===================================================================
--- src/webservice/htdocs/SiWeather/Webservice/Setup.php	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,460 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-namespace SiWeather\Webservice;
-
-require_once(__DIR__ ."/../../inc/envsetup.php");
-
-/**
-  * @brief Configures the Webservice and creates all needed files and directories (e.g. Databases)
-  *
-  * @note Requires php-posix!
-  */
-class Setup {
-
-	public function __construct(){
-		$this->_webserviceConfig = new WebserviceConfig();
-		$this->_dataDirectory = $this->_webserviceConfig->getConfig("dataDirectory");
-		$this->_databaseHandler = new DatabaseHandler();
-		$this->_databaseFile = $this->_databaseHandler->databaseFile();
-		$this->_databaseDirectory = pathinfo($this->_databaseFile, PATHINFO_DIRNAME);
-		$this->_databaseFirstConnection = !file_exists($this->_databaseFile);
-	}
-	
-	/**
-	  * @brief Checks if data directory is present and writable  and returns a value from DatabaesChecks
-	  *
-	  * If an error occurs, the error message is stored into @p $errorMessage.
-	  *
-	  * @see DataDirectoryChecks
-	  * @see dataDirectoryCreate()
-	  */
-	public function dataDirectoryCheck(&$errorMessage){
-		if(!is_object($this->_webserviceConfig)){
-			$errorMessage = _("Could not load the webservice configuration");
-			return DataDirectoryChecks::NoConfiguration;
-		}
-		if(!$this->_dataDirectory || empty($this->_dataDirectory)){
-			$errorMessage = _("Could not determine dataDirectory setting");
-			return DataDirectoryChecks::NoDirectoryPath;
-		}
-		if(!is_dir($this->_dataDirectory)){
-			$errorMessage = _("Data directory does not exists");
-			return DataDirectoryChecks::NotExist;
-		}
-		if(!is_writable($this->_dataDirectory)){
-			$errorMessage = \Translator::swGettext("Data directory is not writable for %s:%s (%s)",
-												  $this->getProcessUser(), $this->getProcessGroup(), $this->_dataDirectory);
-			return DataDirectoryChecks::NotWritable;
-		}
-		return DataDirectoryChecks::Success;
-	}
-	
-	/**
-	  * @brief Creates the data directory and returns a value from DatabaesChecks
-	  *
-	  * If an error occurs, the error message is stored into @p $errorMessage.
-	  *
-	  * @see DataDirectoryChecks
-	  * @see dataDirectoryCreate()
-	  */
-	public function dataDirectoryCreate(&$errorMessage){
-		$result = $this->dataDirectoryCheck($errorMessage);
-		if($result == DataDirectoryChecks::Success){
-			// directory already exists, therefore there is no need to create it
-			return DataDirectoryChecks::Success;
-		}
-		if($result != DataDirectoryChecks::NotExist){
-			return $result;
-		}
-		// clear $errorMessage, because it contains the "Data directory does not exist" entry
-		// from dataDirectoryCheck(), which is not an error at this point!
-		$errorMessage = "";
-		if(!mkdir($this->_dataDirectory)){
-			$errorMessage = \Translator::swGettext("Could not create data directory (%s)", $this->_dataDirectory);
-			return DataDirectoryChecks::Error;
-		}
-		return DataDirectoryChecks::Success;
-	}
-	
-	/**
-	  * @brief Checks everything related to the database path and returns a value from DatabaesChecks
-	  *
-	  * If an error occurs, the error message is stored into @p $errorMessage.
-	  *
-	  * @see DatabaseDirectoryChecks
-	  * @see databaseDirectoryCreate()
-	  */
-	public function databaseDirectoryCheck(&$errorMessage){
-		if(is_null($this->_databaseDirectory) || empty($this->_databaseDirectory)){
-			$errorMessage = \Translator::swGettext("Failed to extract directory from database file path (%s)", $this->_databaseFile);
-			return DatabaseChecks::NoDirectoryPath;
-		}
-		if(!is_dir($this->_databaseDirectory)){
-			$errorMessage = \Translator::swGettext("Database directory does not exists (%s)", $this->_databaseDirectory);
-			return DatabaseChecks::DirectoryDoesNotExist;
-		}
-		if(!is_writable($this->_databaseDirectory)){
-			$errorMessage = \Translator::swGettext("Database directory is not writable  for %s:%s (%s)",
-												  $this->getProcessUser(), $this->getProcessGroup(),
-												  $this->_databaseDirectory);
-			return DatabaseChecks::DirectoryNotWritable;
-		}
-		return DatabaseChecks::Success;
-	}
-	
-	/**
-	  * @brief Creates the database directory  and returns a value from DatabaesChecks
-	  *
-	  * If an error occurs, the error message is stored into @p $errorMessage.
-	  *
-	  * @see DatabaseDirectoryChecks
-	  * @see databaseDirectoryCheck()
-	  */
-	public function databaseDirectoryCreate(&$errorMessage){
-		$result = $this->databaseDirectoryChecks($errorMessage);
-		if($result == DatabaseChecks::Success){
-			$errorMessage = "";
-			return DatabaseChecks::Success;
-		}
-		if($result == DatabaseChecks::NoDatabaseFile || $result == DatabaseChecks::NoDirectoryPath || $result == DatabaseChecks::DirectoryNotWritable){
-			return $result;
-		}
-		if(!mkdir($this->_databaseDirectory)){
-			$errorMessage = \Translator::swGettext("Could not create database directory (%s)", $this->_databaseDirectory);
-			return DatabaseChecks::Error;
-		}
-		return DatabaseChecks::Success;
-	}
-	
-	/**
-	  * @brief Checks, if the database file is given and is in a writable path
-	  *
-	  * The database file itself is created by the DatabaseHandler. Therefore
-	  * this function only checks, if the database directory exists, and it must be
-	  * writable.
-	  *
-	  * @see DatabaseChecks
-	  * @see databaseDirectoryCheck()
-	  */
-	public function databaseFileCheck(&$errorMessage){
-		if(is_null($this->_databaseFile) || empty($this->_databaseFile)){
-			$errorMessage = \Translator::swGettext("No database file given (%s)", $this->_databaseHandler->lastErrorMessage());
-			return DatabaseChecks::NoDatabaseFile;
-		}
-		if(file_exists($this->_databaseFile)){
-			if(!is_writable($this->_databaseFile)){
-				$errorMessage = \Translator::swGettext("Database file is not writable for %s:%s (%s)",
-													  $this->getProcessUser(), $this->getProcessGroup(),
-													  $this->_databaseFile);
-				return DatabaseChecks::DatabaseFileNotWritable;
-			}
-			return DatabaseChecks::Success;
-		}
-		// if the databaseDirectoryCheck function return something other than success,
-		// we probably have a problem (like no write permission, ...)
-		if($this->databaseDirectoryCheck($errorMessage) != DatabaseChecks::Success){
-			return DatabaseChecks::Error;
-		}
-		return DatabaseChecks::Success;
-	}
-
-	public function databaseConnection(&$errorMessage){
-		if(!is_object($this->_databaseHandler)){
-			$errorMessage = _("No database handler");
-			return false;
-		}
-		if(!$this->_databaseHandler->connect(true)){
-			$errorMessage = \Translator::swGettext("Could not connect to the database (%s)", $this->_databaseHandler->lastErrorMessage());
-			return false;
-		}
-		// check version, if an schema already exists
-		if($this->_databaseHandler->databaseTableExists("schema")){
-			if(!$this->_databaseHandler->checkVersions()){
-				$errorMessage = \Translator::swGettext("Database schema versions check failed (%s)", $this->_databaseHandler->lastErrorMessage());
-				return false;
-			}
-		}
-		
-		// prepare Spatalite
-		if(!$this->_databaseHandler->databaseTableExists("spatial_ref_sys")){
-			if(!$this->_databaseHandler->exec("BEGIN")){
-				$errorMessage = _("Could not start transaction to init Spatialite");
-				return false;
-			}
-			if(!$this->_databaseHandler->exec("SELECT InitSpatialMetadata()")){
-				$errorMessage = _("Could not initiate Spatialite metadata");
-				return false;
-			}
-			if(!$this->_databaseHandler->exec("COMMIT")){
-				$errorMessage = _("Could not commit transaction to init Spatialite");
-				return false;
-			}
-		}
-
-// 		// prepare countries table
-// 		$table = "countries";
-// 		if(!$this->databaseTableExists($table)){
-// 			$sql  = "CREATE TABLE ". $table ." (";
-// 			$sql .= "  id INTEGER NOT NULL PRIMARY KEY,";
-// 			$sql .= "  name TEXT NOT NULL,";
-// 			$sql .= "  code VARCHAR(2)";
-// 			$sql .= ")";
-// 			if(!$this->databaseTableCreate($table, $sql, $errorMessage)){
-// 				return false;
-// 			}
-// 		}
-// 		
-// 		// prepare regions table
-// 		$table = "regions";
-// 		if(!$this->databaseTableExists($table)){
-// 			$sql  = "CREATE TABLE ". $table ." (";
-// 			$sql .= "  id INTEGER NOT NULL PRIMARY KEY,";
-// 			$sql .= "  name TEXT NOT NULL,";
-// 			$sql .= "  code VARCHAR(2),";
-// 			$sql .= "  country INTEGER,";
-// 			$sql .= "  FOREIGN KEY(country) REFERENCES countries(id)";
-// 			$sql .= ")";
-// 			if(!$this->databaseTableCreate($table, $sql, $errorMessage)){
-// 				return false;
-// 			}
-// 		}
-
-		// prepare schema table
-		$table = "schema";
-		if(!$this->_databaseHandler->databaseTableExists($table)){
-			$sql  = "CREATE TABLE ". $table ." (";
-			$sql .= "  id INTEGER NOT NULL PRIMARY KEY,";
-			$sql .= "  name TEXT NOT NULL,";
-			$sql .= "  version INTEGER NOT NULL";
-			$sql .= ")";
-			if(!$this->databaseTableCreate($table, $sql, $errorMessage)){
-				return false;
-			}
-			$sql  = "INSERT INTO ". $table ." (name, version) VALUES(:name, :version)";
-			$sqlStatement = $this->_databaseHandler->prepare($sql);
-			$sqlStatement->clear();
-			$sqlStatement->bindValue(":name", "core");
-			$sqlStatement->bindValue(":version", $this->_webserviceConfig->getConfig("databaseVersionCore"));
-			if(!$sqlStatement->execute()){
-				$errorMessage = Translation::swGettext("Could not add schema version %s to the database", "core");
-				error_log($errorMessage);
-				return false;
-			}
-			$sqlStatement->reset();
-		}
-
-		// prepare cities table
-		$table = "cities";
-		if(!$this->_databaseHandler->databaseTableExists($table)){
-			$sql  = "CREATE TABLE ". $table ." (";
-			$sql .= "  id INTEGER NOT NULL PRIMARY KEY,";
-			$sql .= "  name TEXT NOT NULL";
-			$sql .= ")";
-			if(!$this->databaseTableCreate($table, $sql, $errorMessage)){
-				return false;
-			}
-			// creating a POINT Geometry column named center,
-			// taking two coordinates in SRID 4326 (WGS84) format
-			$sql  = "SELECT AddGeometryColumn(\"". $table ."\", ";
-			$sql .= "\"location\", 4326, \"POINT\", \"XY\")";
-			if(!$this->_databaseHandler->exec($sql)){
-				$errorMessage = Translation::swGettext("Could not create location field for %s table", $table);
-				return false;
-			}
-		}
-
-		// prepare status table
-		$table = "status";
-		if(!$this->_databaseHandler->databaseTableExists($table)){
-			$sql  = "CREATE TABLE ". $table ." (";
-			$sql .= "  id INTEGER NOT NULL PRIMARY KEY,";
-			$sql .= "  name TEXT NOT NULL";
-			$sql .= ")";
-			if(!$this->databaseTableCreate($table, $sql, $errorMessage)){
-				return false;
-			}
-			$status = array("confirming", "active", "deletionrequested");
-			$sql  = "INSERT INTO ". $table ." (name) VALUES(:name)";
-			$sqlStatement = $this->_databaseHandler->prepare($sql);
-			foreach ($status as $name){
-				$sqlStatement->clear();
-				$sqlStatement->bindValue(":name", $name);
-				if(!$sqlStatement->execute()){
-					$errorMessage = Translation::swGettext("Could not add status %s to the database", $name);
-					error_log($errorMessage);
-					return false;
-				}
-				$sqlStatement->reset();
-			}
-		}
-
-		// prepare stations table
-		$table = "stations";
-		if(!$this->_databaseHandler->databaseTableExists($table)){
-			$sql  = "CREATE TABLE ". $table ." (";
-			$sql .= "  id INTEGER NOT NULL PRIMARY KEY,";
-			$sql .= "  name TEXT NOT NULL,";
-			$sql .= "  city INTEGER NOT NULL,";
-			$sql .= "  uuid TEXT NOT NULL,";
-			$sql .= "  ownerMail TEXT NOT NULL,";
-			$sql .= "  type TEXT NOT NULL,";
-			$sql .= "  typeUrl TEXT,";
-			$sql .= "  creationDate TIMESTAMP DEFAULT (strftime('%s', 'now')),";
-// 			$sql .= "  creationDate TIMESTAMP DEFAULT CURRENT_TIMESTAMP,";
-			$sql .= "  status INTEGER DEFAULT 1,";
-			$sql .= "  FOREIGN KEY(city) REFERENCES cities(id)";
-			$sql .= "  FOREIGN KEY(status) REFERENCES status(id)";
-			$sql .= ")";
-			if(!$this->databaseTableCreate($table, $sql, $errorMessage)){
-				return false;
-			}
-			// creating a POINT Geometry column named center,
-			// taking two coordinates in SRID 4326 (WGS84) format
-			$sql  = "SELECT AddGeometryColumn(\"". $table ."\", ";
-			$sql .= "\"location\", 4326, \"POINT\", \"XY\")";
-			if(!$this->_databaseHandler->exec($sql)){
-				$errorMessage = Translation::swGettext("Could not create location field for %s table", $table);
-				return false;
-			}
-		}
-		
-		return true;
-	}
-	
-	public function databaseVersionSqlite(&$errorMessage){
-		if(!is_object($this->_databaseHandler)){
-			return 0;
-		}
-		$result =  $this->_databaseHandler->versionSqlite();
-		if($result == 0){
-			$errorMessage = $this->_databaseHandler->lastErrorMessage();
-		}
-		return $result;
-	}
-	
-	public function databaseVersionSpatalite(&$errorMessage){
-		if(!is_object($this->_databaseHandler)){
-			return 0;
-		}
-		$result = $this->_databaseHandler->versionSpatialite();
-		if($result == 0){
-			$errorMessage = $this->_databaseHandler->lastErrorMessage();
-		}
-		return $result;
-	}
-	
-	public function apiCheckWithoutRewrite(&$errorMessage){
-		return $this->apiCheck("index.php/stations", $errorMessage);
-	}
-	
-	public function apiCheckWithRewrite(&$errorMessage){
-		return $this->apiCheck("stations", $errorMessage);
-	}
-
-	private function getProcessUser(){
-		$processUser = posix_getpwuid(posix_getuid());
-		return $processUser["name"];
-	}
-	
-	private function getProcessGroup(){
-		$processGroup = posix_getgrgid(posix_getgid());
-		return $processGroup["name"];
-	}
-	
-	private function apiCheck($url, &$errorMessage){
-		$baseUrl = $this->_webserviceConfig->webserviceBaseUrl();
-		if(!$baseUrl || empty($baseUrl)){
-			$errorMessage = _("No webservice base url given!");
-			return false;
-		}
-
-		# base_url needs to end with a /, otherwise the last element is chopped
-		try{
-			$client = new \GuzzleHttp\Client
-			(
-				[
-					"base_uri" => $baseUrl,
-					"timeout" => 2.0,
-					"http_errors" => false,
-				]
-			);
-			$response = $client->get($url);
-		}
-		catch(\GuzzleHttp\Exception\ConnectException $exception){
-			$errorMessage = \Translator::swGettext("Webservce has not answered at url %s! Error: %s", $baseUrl, $exception->getMessage());
-			return false;
-		}
-		if(is_null($response)){
-			$errorMessage = \Translator::swGettext("Webservice has not answered at url %s!", $baseUrl);
-			return false;
-		}
-		$result = $response->getStatusCode();
-		if($result != 200){
-			$errorMessage = \Translator::swGettext("Got http error %s (%s) at url %s", $result, $response->getReasonPhrase(), $baseUrl . $url);
-			return false;
-		}
-		$result = $response->getReasonPhrase();
-		if($result != "OK"){
-			$errorMessage = \Translator::swGettext("Got a http error reason with http code 200: %s", $result);
-			return false;
-		}
-
-		$body = $response->getBody();
-		if(empty($body)){
-			$errorMessage = _("Got empty return value");
-			return false;
-		}
-		
-		$json = json_decode($body);
-		if(is_null($json)){
-			$errorMessage = _("Could not decode json message body");
-			return false;
-		}
-		return true;
-	}
-	
-	private function databaseTableCreate($table, $sqlStatement, &$errorMessage){
-		if(!$this->_databaseHandler || !is_object($this->_databaseHandler)){
-			return false;
-		}
-		if(!$this->_databaseHandler->exec("BEGIN")){
-			$errorMessage = \Translator::swGettext("Could not start transaction to create table %s", $table);
-			return false;
-		}
-		if(!$this->_databaseHandler->exec($sqlStatement)){
-			$errorMessage = \Translator::swGettext("Could not execute sql statement to create table %s:\n%s", $table, $sqlStatement);
-			return false;
-		}
-		if(!$this->_databaseHandler->exec("COMMIT")){
-			$errorMessage = \Translator::swGettext("Could not commit transaction to create table %s", $table);
-			return false;
-		}
-		return true;
-	}
-
-	private $_webserviceConfig;
-	private $_dataDirectory;
-	private $_databaseHandler;
-	private $_databaseFile;
-	private $_databaseFirstConnection;
-}
-
-?>
Index: src/webservice/htdocs/SiWeather/Webservice/WebserviceApi.php
===================================================================
--- src/webservice/htdocs/SiWeather/Webservice/WebserviceApi.php	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,449 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-namespace SiWeather\Webservice;
-
-require(__DIR__ ."/../../inc/envsetup.php");
-
-/**
-  * @brief Implementation of the Webservice API
-  *
-  * @module WebserviceAPI
-  */
-class WebserviceApi {
-	/**
-		* @brief Handles the stations (list) REST requests
-		*/
-	public static function stations(){
-		$stations = Array();
-
-		$db = new DatabaseHandler();
-		if(!$db->connect()){
-			echo json_encode
-			(
-				[
-					"result" => "failed",
-					"message" => "Could not connect to the database",
-				]
-			);
-			return;
-		}
-		$db->exec("BEGIN");
-
-		$sqlStatement = $db->prepare("SELECT stations.uuid as uuid, stations.name as name, X(stations.location) as longitude, Y(stations.location) as latitude, cities.name as city FROM stations, cities WHERE stations.city=cities.id");
-		if(!$sqlStatement){
-			$db->exec("ROLLBACK");
-			echo json_encode
-			(
-				[
-					"result" => "failed",
-					"message" => "Could not fetch stations from database",
-				]
-			);
-			return;
-		}
-		$result = $sqlStatement->execute();
-		while($row = $result->fetchArray()){
-			$station = Array();
-			$station["uuid"] = $row["uuid"];
-			$station["name"] = $row["name"];
-			$station["longitude"] = $row["longitude"];
-			$station["latitude"] = $row["latitude"];
-			$station["city"] = $row["city"];
-	// 		$station["values"] = Array();
-	// 		$station["values"][] = "temperature";
-	// 		$station["values"][] = "humidity";
-			$station["url"] = "stations/". $station["uuid"];
-			$stations[] = $station;
-		}
-		$db->exec("COMMIT");
-
-		echo json_encode($stations);
-	}
-
-	/**
-	  * @brief Registers a new weather station
-	  *
-	  * @note Call this function with a big timeout > 2seconds, because we use another webservice
-	  *       to fetch location data. This fetch runs already max. 2 seconds.
-	  * @note Requires php-pecl-uuid
-	  * @note Requires php-pecl-rrd
-	  */
-	public static function stationsRegister(){
-		$geoLocationRadius = 5;
-
-		try{
-			$app = \Slim\Slim::getInstance("siweather");
-			$body = $app->request->getBody();
-			$json = json_decode($body, true);
-
-			$app->response()->header("Content-Type", "application/json");
-
-			if(!function_exists("uuid_create")){
-				error_log("pecl uuid extension not installed!");
-				echo json_encode
-				(
-					[
-						"result" => "missinguuidcreate",
-						"message" => "The function uuid_create() from pecl package http://pecl.php.net/package/uuid is not installed, but needed!",
-					]
-				);
-				return;
-			}
-
-			if(!function_exists("rrd_create") || !function_exists("rrd_update")){
-				error_log("pecl rrd extension not installed!");
-				echo json_encode
-				(
-					[
-						"result" => "missingrrd",
-						"message" => "The function rrd_create() or rrd_update() from pecl package http://pecl.php.net/package/rrd is not installed, but needed!",
-					]
-				);
-				return;
-			}
-
-			$expectedKeys = array("name", "city", "longitude", "latitude", "email", "type");
-			$missingKeys = array();
-			foreach($expectedKeys as $key){
-				if(!array_key_exists($key, $json))
-					$missingKeys[] = $key;
-			}
-			if(count($missingKeys) > 0){
-				echo json_encode
-				(
-					[
-						"result" => "missingkeys",
-						"message" => "Your request misses the following keys: ". implode(", ", $missingKeys),
-					]
-				);
-				return;
-			}
-
-			if(!Location::ValidLatitude($json["latitude"])){
-				echo json_encode
-				(
-					[
-						"result" => "invalid latitude",
-						"message" => "Your specified an invalid latitude: ". $json["latitude"],
-					]
-				);
-				return;
-			}
-			if(!Location::ValidLongitude($json["longitude"])){
-				echo json_encode
-				(
-					[
-						"result" => "invalid longitude",
-						"message" => "Your specified an invalid longitude: ". $json["longitude"],
-					]
-				);
-				return;
-			}
-			if(empty($json["email"]) || !filter_var($json["email"], FILTER_VALIDATE_EMAIL)){
-				echo json_encode
-				(
-					[
-						"result" => "invalid email",
-						"message" => "Your specified an invalid email address: ". $json["email"],
-					]
-				);
-				return;
-			}
-			if(!array_key_exists("typeUrl", $json)){
-				$json["typeUrl"] = "";
-			}
-			elseif(!empty($json["typeUrl"]) && !filter_var($json["typeUrl"], FILTER_VALIDATE_URL)){
-				echo json_encode
-				(
-					[
-						"result" => "invalid type url",
-						"message" => "Your specified type url is invalid: ". $json["typeUrl"] ." Set it to an empty value or fix it.",
-					]
-				);
-				return;
-			}
-
-			$errorMessage = "";
-			$locations = GeoLocator::locations($json["latitude"], $json["longitude"], $geoLocationRadius, $errorMessage);
-			if(!$locations || count($locations) < 1){
-				error_log($errorMessage);
-				echo json_encode
-				(
-					[
-						"result" => "unprovenlocation",
-						"message" => "Could not check the city (". $json["city"] .") and location (". $json["latitude"] .", ". $json["longitude"] .") you send with help of your city and geo coordinates. Please make sure, your data is correct.",
-					]
-				);
-				return;
-			}
-			else{
-				$validatedLocation = false;
-				foreach($locations as $location){
-					if($location->city() == $json["city"]){
-						$validatedLocation = $location;
-					}
-				}
-				if(!$validatedLocation){
-					$message  = "The city (". $json["city"] .") and location (". $json["latitude"] .", ". $json["longitude"] .") you send, does not suite with locations we found at your given location (city, latitude, longitude):\n";
-					foreach($locations as $location){
-						$message .= "    ". $location->city() .": ". $location->latitude() .", ". $location->longitude() ."\n";
-					}
-					$message .= " Please make sure, your data is correct.";
-
-					echo json_encode
-					(
-						[
-							"result" => "unprovenlocation",
-							"message" => $message,
-						]
-					);
-					return;
-				}
-			}
-
-			$db = new DatabaseHandler();
-			if(!$db->connect()){
-				echo json_encode
-				(
-					[
-						"result" => "failed",
-						"message" => "Could not connect to the database",
-					]
-				);
-				return;
-			}
-			$db->exec("BEGIN");
-
-			// find out, if the city is already there
-			$cityId = -1;
-			$sqlStatement = $db->prepare("SELECT id FROM cities WHERE name=:name AND location=:location");
-			if(!$sqlStatement){
-				$db->exec("ROLLBACK");
-				echo json_encode
-				(
-					[
-						"result" => "failed",
-						"message" => "Could not fetch city from database",
-					]
-				);
-				return;
-			}
-			$sqlStatement->bindValue(":name", $validatedLocation->city());
-			$sqlStatement->bindValue(":location", "POINT(". $location->locationWkt() .")");
-			$result = $sqlStatement->execute();
-			$row = $result->fetchArray();
-			if($row){
-				$cityId = $row[0];
-			}
-			else{
-				$sqlStatement = $db->prepare("INSERT INTO cities (name, location) VALUES(:name, GeomFromText(:location, 4326))");
-				if(!$sqlStatement){
-					error_log("Failed to add city to the database: ". $db->lastDatabaseErrorMessage());
-					$db->exec("ROLLBACK");
-					echo json_encode
-					(
-						[
-							"result" => "failed",
-							"message" => "Could insert city into the database",
-						]
-					);
-					return;
-				}
-				$sqlStatement->bindValue(":name", $validatedLocation->city());
-				$sqlStatement->bindValue(":location", "POINT(". $location->locationWkt() .")");
-				$sqlResult = $sqlStatement->execute();
-				if(!$sqlResult){
-					error_log("Failed to add city to the database: ". $db->lastDatabaseErrorMessage());
-					$db->exec("ROLLBACK");
-					echo json_encode
-					(
-						[
-							"result" => "failed",
-							"message" => "Could not add city to the database",
-						]
-					);
-					return;
-				}
-				$cityId = $db->lastInsertRowId();
-			}
-			if(!is_numeric($cityId) || $cityId < 0){
-				error_log("Failed to select city from the database: ". $db->lastDatabaseErrorMessage());
-				$db->exec("ROLLBACK");
-				echo json_encode
-				(
-					[
-						"result" => "failed",
-						"message" => "Could not select city from the database",
-					]
-				);
-				return;
-			}
-
-			// find out initial state
-			$statusId = -1;
-			$sqlStatement = $db->prepare("SELECT id FROM status WHERE name=:name");
-			if(!$sqlStatement){
-				$db->exec("ROLLBACK");
-				error_log("Could not find initial state to register station (Prepare): ". $db->lastDatabaseErrorMessage());
-				echo json_encode
-				(
-					[
-						"result" => "failed",
-						"message" => "Could not fetch status from database",
-					]
-				);
-				return;
-			}
-			$sqlStatement->bindValue(":name", "confirming");
-			$result = $sqlStatement->execute();
-			$row = $result->fetchArray();
-			if($row){
-				$statusId = $row[0];
-			}
-			else{
-				error_log("columns ". $result->numColumns() .", columnType: ". $result->columnType(0));
-				$db->exec("ROLLBACK");
-				error_log("Could not find initial state to register station (Execute): ". $db->lastDatabaseErrorMessage());
-				echo json_encode
-				(
-					[
-						"result" => "failed",
-						"message" => "Could not fetch status from database (Status not found)",
-					]
-				);
-				return;
-			}
-
-			// insert station
-			$uuid = uuid_create(4);
-			$sqlStatement = $db->prepare("INSERT INTO stations (name, city, uuid, ownerMail, type, typeUrl, status, location) VALUES(:name, :city, :uuid, :ownerMail, :type, :typeUrl, :status, GeomFromText(:location, 4326))");
-			if(!$sqlStatement){
-				$db->exec("ROLLBACK");
-				echo json_encode
-				(
-					[
-						"result" => "failed",
-						"message" => "Could insert station into the database",
-					]
-				);
-				return;
-			}
-			$sqlStatement->bindValue(":name", $json["name"]);
-			$sqlStatement->bindValue(":city", $cityId);
-			$sqlStatement->bindValue(":uuid", $uuid);
-			$sqlStatement->bindValue(":ownerMail", $json["email"]);
-			$sqlStatement->bindValue(":type", $json["type"]);
-			$sqlStatement->bindValue(":typeUrl", $json["typeUrl"]);
-			$sqlStatement->bindValue(":status", $statusId);
-			$sqlStatement->bindValue(":location", "POINT(". $location->locationWkt() .")");
-			$sqlResult = $sqlStatement->execute();
-			if(!$sqlResult){
-				error_log("Failed to add station to the database: ". $db->lastDatabaseErrorMessage());
-				$db->query("ROLLBACK");
-				echo json_encode
-				(
-					[
-						"result" => "failed",
-						"message" => "Could not add station to the database",
-					]
-				);
-				return;
-			}
-
-			// creating rrd file
-			$webserviceConfig = new WebserviceConfig();
-			$rrdFileName = $webserviceConfig->dataDirectory() . $uuid .".rrd"; 
-			$rrdCreator = new \RRDCreator($rrdFileName, "now", 900);
-			$rrdCreator->addDataSource("Temp:GAUGE:1320:-100:100");
-			$rrdCreator->addDataSource("Humidity:GAUGE:1320:0:100");
-			$rrdCreator->addDataSource("Pressure:GAUGE:1320:800:1200");
-			$rrdCreator->addDataSource("WindSpeed:GAUGE:1320:0:999");
-			$rrdCreator->addDataSource("Winddirection:GAUGE:1320:1:360");
-			$rrdCreator->addDataSource("Rainfall:GAUGE:1320:0:999");
-			$rrdCreator->addArchive("AVERAGE:0.5:1:96");
-			$rrdCreator->addArchive("AVERAGE:0.5:4:96");
-			$rrdCreator->addArchive("AVERAGE:0.5:8:360");
-			$rrdCreator->addArchive("AVERAGE:0.5:16:2190");
-			$rrdCreator->addArchive("AVERAGE:0.5:24:146000");
-			$rrdCreator->addArchive("AVERAGE:0.5:48:146000");
-			$rrdCreator->addArchive("AVERAGE:0.5:96:146000");
-			$rrdCreator->addArchive("MIN:0.5:4:96");
-			$rrdCreator->addArchive("MIN:0.5:8:360");
-			$rrdCreator->addArchive("MIN:0.5:16:2190");
-			$rrdCreator->addArchive("MIN:0.5:24:146000");
-			$rrdCreator->addArchive("MIN:0.5:48:146000");
-			$rrdCreator->addArchive("MIN:0.5:96:146000");
-			$rrdCreator->addArchive("MAX:0.5:4:96");
-			$rrdCreator->addArchive("MAX:0.5:8:360");
-			$rrdCreator->addArchive("MAX:0.5:16:2190");
-			$rrdCreator->addArchive("MAX:0.5:24:146000");
-			$rrdCreator->addArchive("MAX:0.5:48:146000");
-			$rrdCreator->addArchive("MAX:0.5:96:146000");
-			if(!$rrdCreator->save()){
-				$db->query("ROLLBACK");
-				$errorMessage = rrd_error();
-				echo json_encode
-				(
-					[
-						"result" => "failed",
-						"message" => "Could not create rrd files for this station: ". $errorMessage,
-					]
-				);
-				return;
-			}
-
-			// finish transaction
-			$db->exec("COMMIT");
-			
-			$deletionDate = date(DATE_RFC850, time() + 14 * 24 * 60 * 60);
-			$mailRecipient = $json["email"];
-			$header = "From: ". WebserviceConfig::value("mailaddressFrom") ."\r\n" .
-					  "Reply-To: ". WebserviceConfig::value("mailaddressFrom") ."\r\n" .
-					  "CC: ". WebserviceConfig::value("mailaddressCC") ."\r\n" .
-					  "X-Mailer: PHP/". phpversion();
-			$message = "Dear user,\r\n" .
-					   "\r\n" . 
-					   "please visit the following Link to confirm your newly created weather station ". $json["name"] .".\r\n" . 
-					   "If you do not visit this link, your station will be delete in 14 days (". $deletionDate .").\r\n" .
-					   "\r\n" . 
-					   WebserviceConfig::value("webserviceBaseUrl"). "/stations/". $uuid ."/confirm" ."\r\n" . 
-					   "\r\n" . 
-					   "Kind regards,\r\n" . 
-					   "Your weather service\r\n";
-			mail($mailRecipient, \Translator::swGettext("Weather station %s - Confirmation request", $uuid), $message, $header);
-			echo json_encode
-			(
-				[
-					"result" => "success",
-					"message" => "Confirmation request is send to ". $mailRecipient .". The station is fully functional already, but might be deleted in 14 days (". $deletionDate .") without any further warnings!",
-					"uuid" => $uuid,
-				]
-			);
-		}
-		catch(Exception $exception){
-			error_log("Caught exception handling request stationsRegister: ". $exception->getMessage());
-			$app->response()->status(400);
-			$app->response()->header("X-Status-Reason", $exception->getMessage());
-		}
-	}
-}
-
-?>
Index: src/webservice/htdocs/SiWeather/Webservice/WebserviceConfig.php
===================================================================
--- src/webservice/htdocs/SiWeather/Webservice/WebserviceConfig.php	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,91 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-namespace SiWeather\Webservice;
-
-class WebserviceConfig {
-
-	function __construct(){
-		require(__DIR__ ."/../../../config/config.php");
-		$this->_config = $config;
-		$this->loadAdditionalConfiguration();
-
-		if($this->getConfig("mode") == "development"){
-			error_reporting(E_ALL);
-		}
-	}
-	
-	static public function value($key){
-		$webserviceConfig = new WebserviceConfig();
-		return $webserviceConfig->getConfig($key);
-	}
-	
-	private function loadAdditionalConfiguration(){
-		$this->_config["dataDirectory"] = "data";
-		
-		require(__DIR__ ."/../../inc/internalconfig.php");
-		foreach(array_keys($internalconfig) as $key){
-			if(array_key_exists($key, $this->_config)){
-				error_log("Internal config entry ". $key ." already exists --> Keeping existing value and discard internal config value");
-			}
-			else{
-				$this->_config[$key] = $internalconfig[$key];
-			}
-		}
-	}
-
-	public function getConfig($key){
-		if(!array_key_exists($key, $this->_config)){
-			error_log("Expected config value ". $key ." does not exists");
-			return FALSE;
-		}
-		
-		if($key == "dataDirectory"){
-// 			error_log("Use dataDirectory() function to access this value");
-			return $this->dataDirectory();
-		}
-		if($key == "webserviceBaseUrl"){
-// 			error_log("Use dataDirectory() function to access this value");
-			return $this->webserviceBaseUrl();
-		}
-		
-		return $this->_config[$key];
-	}
-
-	public function dataDirectory(){
-		$directory = __DIR__ ."/../../../". $this->_config["dataDirectory"];
-		if(substr($directory, strlen($directory) - 1, 1) != "/"){
-			$directory .= "/";
-		}
-		return $directory;
-	}
-	
-	public function webserviceBaseUrl(){
-		$baseUrl = $this->_config["webserviceBaseUrl"];
-		if(substr($baseUrl, strlen($baseUrl) - 1, 1) != "/"){
-			$baseUrl .= "/";
-		}
-		return $baseUrl;
-	}
-
-	private $_config;
-}
-
-?>
Index: src/webservice/htdocs/inc/envsetup.php
===================================================================
--- src/webservice/htdocs/inc/envsetup.php	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,30 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-// set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ ."/../../vendor/");
-$composerAutoloader = require(__DIR__ ."/../../../vendor/autoload.php");
-if(is_object($composerAutoloader)){
-	$composerAutoloader->add("SiWeather\\Webservice\\", __DIR__ ."/../");
-	$composerAutoloader->register();
-}
-
-require_once(__DIR__ ."/translate.php");
-
-?>
Index: src/webservice/htdocs/inc/footer.php
===================================================================
--- src/webservice/htdocs/inc/footer.php	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,38 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-require_once(__DIR__ ."/envsetup.php");
-
-$webserviceConfig = new SiWeather\Webservice\WebserviceConfig();
-$apiVersion = $webserviceConfig->getConfig("webserviceApiVersion");
-
-echo "		<div class=\"footer\">\n";
-echo "			". Translator::swGettext("SiWeather webservice %s with API version %s), ", $webserviceConfig->getConfig("version"), $apiVersion) ."<br/>\n";
-echo "			". Translator::swGettext("Webservice accessible at %s or", $webserviceConfig->webserviceBaseUrl()) ."<br/>\n";
-echo "			". $webserviceConfig->webserviceBaseUrl() ."index.php/\n";
-echo "			<div class=\"footnotes\">\n";
-echo "				". _("This site uses icons from Oxygen icon theme &#40;License: LGPLv3") .", <a href=\"http://www.kde.org/\">http://www.kde.org</a>&#41;<br/>\n";
-echo "				". _("This site uses GeoNames as geo data provider &#40;License: CC-by-sa-3.0") .", <a href=\"http://www.geonames.org/\">http://www.geonames.org</a>&#41;<br/>\n";
-echo "			</div>\n";
-echo "		</div>\n";
-
-?>
-	</body>
-</html>
Index: src/webservice/htdocs/inc/header.php
===================================================================
--- src/webservice/htdocs/inc/header.php	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,38 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-require_once(__DIR__ ."/envsetup.php");
-
-if(!isset($title)){
-	$title = "";
-}
-
-$webserviceConfig = new SiWeather\Webservice\WebserviceConfig();
-?>
-
-<html>
-	<head>
-		<title><?php echo Translator::swGettext("SiWeather Webservice - %s", $title); ?></title>
-		<link rel="stylesheet" type="text/css" href="<?php echo SiWeather\Webservice\WebserviceConfig::value("webserviceBaseUrl"); ?>resources/css/webservice.css"/>
-	</head>
-	<body>
-		<div class="header">
-			<h1>SiWeather Webservice</h1>
-		</div>
Index: src/webservice/htdocs/inc/translate.php
===================================================================
--- src/webservice/htdocs/inc/translate.php	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,92 +1,0 @@
-<?php
-######################
-#
-#    Copyright (C) 2015 EngSaS - Engineering Soluations and Services Langenbach. All rights reserved.
-#
-#    This library is free software; you can redistribute it and/or
-#    modify it under the terms of the GNU Lesser General Public
-#    License as published by the Free Software Foundation; either
-#    version 2.1 of the License, or (at your option) any later version.
-#
-#    This library is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#    Lesser General Public License for more details.
-#
-#    You should have received a copy of the GNU Lesser General Public
-#    License along with this library; if not, write to the Free Software
-#    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-#    MA 02110-1301  USA.
-#
-######################
-
-// Require per-http2
-// Require php5-gettext
-
-define("LOCALE_SESSION_KEY", "gyl_locale");
-define("LOCALE_DEFAULT", "en_US");
-define("LOCALE_REQUEST_PARAN", "lang");
-define("LOCALE_DOMAIN", "messages"); // Must be the same name, as the po and mo files and the directory they are in
-
-require_once("HTTP2.php");
-
-$config = new SiWeather\Webservice\WebserviceConfig();
-
-$numberDelimiterDecimal = array();
-$numberDelimiterDecimal["en_US"] = ".";
-$numberDelimiterDecimal["de_DE"] = ",";
-
-$_localeCurrent = LOCALE_DEFAULT;
-if(isset($_SESSION)){
-	if(array_key_exists(LOCALE_REQUEST_PARAN, $_REQUEST)){
-		$_localeCurrent = $_REQUEST[LOCALE_REQUEST_PARAN];
-		$_SESSION[LOCALE_SESSION_KEY] = $_localeCurrent;
-	}
-	elseif(array_key_exists(LOCALE_SESSION_KEY, $_SESSION)){
-		$_localeCurrent = $_SESSION[LOCALE_SESSION_KEY];
-	}
-	else{
-		$supportedLanguages = Array(LOCALE_DEFAULT);
-		$transDirHandle = opendir($config->getConfig("translationdirectory"));
-		if($transDirHandle){
-			while(false !== ($entry = readdir($transDirHandle))){
-				if($entry != "." && $entry != ".."){
-					$supportedLanguages[str_replace("_", "-", $entry)] = true;
-				}
-			}
-			
-			closedir($transDirHandle);
-		}
-		$http = new HTTP2();
-		$_localeCurrent = str_replace("-", "_", $http->negotiateLanguage($supportedLanguages, LOCALE_DEFAULT));
-		$_SESSION[LOCALE_SESSION_KEY] = $_localeCurrent;
-	}
-}
-
-$results = putenv("LC_ALL0=". $_localeCurrent);
-if(!$results){
-	error_log("putenv failed (". $result .")");
-}
-$result = setlocale(LC_ALL, $_localeCurrent);
-if(!$results){
-	error_log("setlocale failed (". $result .")");
-}
-$results = bindtextdomain(LOCALE_DOMAIN, $config->getConfig("translationdirectory"));
-if(!$results){
-	error_log("bindtextdomain failed (". $result .")");
-}
-$results = bind_textdomain_codeset(LOCALE_DOMAIN, "UTF-8");
-if(!$results){
-	error_log("bind_textdomain_codeset failed (". $result .")");
-}
-$results = textdomain(LOCALE_DOMAIN);
-if(!$results){
-	error_log("textdomain failed (". $result .")");
-}
-
-class Translator {
-	public static function swGettext($id)
-	{
-		return vsprintf(gettext($id), array_slice(func_get_args(), 1));
-	}
-}
Index: src/webservice/htdocs/index.php
===================================================================
--- src/webservice/htdocs/index.php	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,74 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-require(__DIR__ ."/inc/envsetup.php");
-
-$settings = new SiWeather\Webservice\WebserviceConfig();
-
-$app = new \Slim\Slim
-(
-	array
-	(
-		"mode" => $settings->getConfig("mode"),
-	)
-);
-$app->setName("siweather");
-
-// Only invoked if mode is "production"
-$app->configureMode('production', function () use ($app) {
-    $app->config(array(
-        "log.enable" => true,
-        "log.level" => \Slim\Log::WARN,
-        "debug" => false,
-    ));
-});
-// Only invoked if mode is "development"
-$app->configureMode('development', function () use ($app) {
-    $app->config(array(
-        "log.enable" => true,
-        "log.level" => \Slim\Log::DEBUG,
-        "debug" => true
-    ));
-});
-
-$app->notFound(function () use ($app) {
-	$html = "";
-    if($app->config("debug")){
-        ob_start();
-        phpinfo( INFO_VARIABLES ^ INFO_ENVIRONMENT );
-        $html = ob_get_contents();
-        ob_end_clean();
-    }
-    $app->render("404.php", array("dump" => $html));
-});
-
-$app->get("/setup", function () use ($app){
-	$app->render("setup.php");
-});
-$app->get("/stations", function () use ($app){
-	\SiWeather\Webservice\WebserviceApi::stations();
-});
-$app->post("/stations/register", function () use ($app){
-	\SiWeather\Webservice\WebserviceApi::stationsRegister();
-});
-
-$app->run();
-
-?>
Index: src/webservice/htdocs/resources/css/webservice.css
===================================================================
--- src/webservice/htdocs/resources/css/webservice.css	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,72 +1,0 @@
-.success {
-	color: #66BD66;
-	font-weight: bold;
-}
-
-.error {
-	color: #8C1C00;
-	font-weight: bold;
-}
-
-.lierror {
-	list-style-type: none;
-	background-image: url("../icons/dialog-cancel.png");
-	background-repeat: no-repeat;
-	background-position: left center;
-	background-size: auto 1em;
-	padding-left: 1.5em;
-}
-
-.lisuccess {
-	list-style-type: none;
-	background-image: url("../icons/dialog-ok-apply.png");
-	background-repeat: no-repeat;
-	background-position: left center;
-	background-size: auto 1em;
-	padding-left: 1.5em;
-}
-
-.header {
-	margin-top: 1em;
-	padding-top: 0.5em;
-	padding-left: 2em;
-	color: #ACDFAC;
-	text-align: left;
-	font-size: 9pt;
-	border-width: 0;
-	border-bottom-width: 2px;
-	border-color: #ACDFAC;
-	border-style: solid;
-}
-
-.header h1 {
-	font-size: 16pt;
-}
-
-.footer {
-	margin-top: 1em;
-	padding-top: 0.5em;
-	color: #ACDFAC;
-	text-align: center;
-	font-size: 9pt;
-	border-width: 0;
-	border-top-width: 2px;
-	border-color: #ACDFAC;
-	border-style: solid;
-}
-
-.footnotes {
-	font-size: 8pt;
-	margin-top: 0.5em;
-}
-
-a {
-	color: #6BA3A3;
-	text-decoration: none;
-/* 	font-weight: bold; */
-}
-
-a:hover {
-	color: #6BA3A3;
-	text-decoration: underline;
-}
Index: src/webservice/htdocs/setup.php
===================================================================
--- src/webservice/htdocs/setup.php	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,23 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-require(__DIR__ ."/templates/setup.php");
-
-?>
Index: src/webservice/htdocs/templates/404.php
===================================================================
--- src/webservice/htdocs/templates/404.php	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,33 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-require(__DIR__ ."/../inc/envsetup.php");
-
-$title = _("404 Site Not Found");
-include(__DIR__ ."/../inc/header.php");
-
-if(isset($dump) && !empty($dump)){
-	echo "		<div class=\"dump\">\n";
-	echo $dump;
-	echo "		</div>\n";
-}
-
-include(__DIR__ ."/../inc/footer.php");
-?>
Index: src/webservice/htdocs/templates/setup.php
===================================================================
--- src/webservice/htdocs/templates/setup.php	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,116 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-require(__DIR__ ."/../inc/envsetup.php");
-
-function printError($message)
-{
-	echo "<div class=\"error\">\n";
-	echo "	<h3>". _("The following error occured:") ."</h3>\n";
-	echo $message;
-	echo "</div>\n";
-}
-
-function printResult($result, $message)
-{
-	$class = "success";
-	if(!$result){
-		$class = "error";
-	}
-	echo "<li class=\"". $class ." li". $class ."\">". $message ."</li>\n";
-}
-
-$title = _("Setup");
-include(__DIR__ ."/../inc/header.php");
-?>
-
-		<h2><?php echo _("Welcome to the setup"); ?></h2>
-		<ul>
-<?php
-
-$setup = new SiWeather\Webservice\Setup();
-$webserviceConfig = new SiWeather\Webservice\WebserviceConfig();
-
-$errorMessage = "";
-$result = $setup->dataDirectoryCheck($errorMessage);
-if($result == SiWeather\Webservice\DataDirectoryChecks::NotExist && $result != SiWeather\Webservice\DataDirectoryChecks::Success){
-	$result = $setup->dataDirectoryCreate($errorMessage);
-}
-
-if($result != SiWeather\Webservice\DataDirectoryChecks::Success){
-	printResult(false, Translator::swGettext("Data directory not accessible (%s)", $errorMessage));
-}
-else{
-	printResult(true, Translator::swGettext("Data directory checked (%s)", realpath($webserviceConfig->getConfig("dataDirectory"))));
-	$result = $setup->databaseDirectoryCheck($errorMessage);
-	if($result != SiWeather\Webservice\DatabaseChecks::Success){
-		printResult(false, $errorMessage);
-	}
-	else{
-		printResult(true, _("Database directory checked"));
-		$result = $setup->databaseFileCheck($errorMessage);
-		if($result != SiWeather\Webservice\DatabaseChecks::Success){
-			printResult(false, $errorMessage);
-		}
-		else{
-			printResult(true, _("Database file checked"));
-			if(!$setup->databaseConnection($errorMessage)){
-				printResult(false, $errorMessage);
-			}
-			else{
-				$prefix = "Database up and running";
-				$versionSqlite = $setup->databaseVersionSqlite($errorMessage);
-				if($versionSqlite <= 0){
-					printResult(false,  Translator::swGettext("%s (Could not determine SQLite version: %s)", $prefix, $errorMessage));
-				}
-				else{
-					$versionSpatalite = $setup->databaseVersionSpatalite($errorMessage);
-					if($versionSpatalite <= 0){
-						printResult(false, Translator::swGettext("%s (Could not determine Spatalite version: %s)", $prefix, $errorMessage));
-					}
-					else{
-						printResult(true, Translator::swGettext("%s (SQLite: %s, Spatalite: %s)", $prefix, $versionSqlite, $versionSpatalite));
-					}
-				}
-			}
-		}
-	}
-}
-
-if(!$setup->apiCheckWithoutRewrite($errorMessage)){
-	printResult(false, Translator::swGettext("Could not connect to webservice without rewrite (%s)", $errorMessage));
-}
-else{
-	$url = $webserviceConfig->webserviceBaseUrl() ."index.php/";
-	printResult(true, Translator::swGettext("Webservice withpout rewrite accessible at %s", "<a href=\"". $url ."\">". $url ."</a>"));
-}
-if(!$setup->apiCheckWithRewrite($errorMessage)){
-	printResult(false, Translator::swGettext("Could not connect to webservice with rewrite (%s)", $errorMessage));
-}
-else{
-	$url = $webserviceConfig->webserviceBaseUrl();
-	printResult(true, Translator::swGettext("Webservice withp rewrite accessible at %s", "<a href=\"". $url ."\">". $url ."</a>"));
-}
-
-?>
-		</ul>
-<?php
-	include(__DIR__ ."/../inc/footer.php");
-?>
Index: src/webservice/testconfig/testconfig.php.in
===================================================================
--- src/webservice/testconfig/testconfig.php.in	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,28 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-$testconfig = [
-	"webserviceDirectory" => "@WEBSERVICE_OUTPUT_APP_DIRECTORY@",
-];
-
-// set_include_path(get_include_path() . PATH_SEPARATOR . "@WEB_TEST_OUTPUT_DIRECTORY@");
-// require 'vendor/autoload.php';
-
-?>
Index: src/webservice/tests/GeoLocatorTest.php
===================================================================
--- src/webservice/tests/GeoLocatorTest.php	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,80 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-$file = __DIR__ ."/testconfig/testconfig.php";
-require($file);
-require_once($testconfig["webserviceDirectory"] ."/inc/envsetup.php");
-		
-class GeoLocatorTest extends PHPUnit_Framework_TestCase
-{
-	public function testConfigured(){
-		$this->assertTrue(\SiWeather\Webservice\GeoLocator::configured());
-	}
-
-	/**
-	  * @dataProvider testLocations_data
-	  */
-	public function testLocations($latiude, $longitude, $radius, $results){
-		$errorMessage = "";
-		$locations = \SiWeather\Webservice\GeoLocator::locations($latiude, $longitude, $radius, $errorMessage);
-
-		$this->assertInternalType("array", $locations, $errorMessage);
-		$this->assertTrue(empty($errorMessage));
-
-		$this->assertEquals(count($locations), count($results));
-
-		for($i = 0; $i < count($locations); $i++){
-			$this->assertEquals($locations[$i]->city(), $results[$i]->city());
-			$this->assertEquals($locations[$i]->postalCode(), $results[$i]->postalCode());
-			$this->assertEquals($locations[$i]->regionName(), $results[$i]->regionName());
-			$this->assertEquals($locations[$i]->regionCode(), $results[$i]->regionCode());
-			$this->assertEquals($locations[$i]->countryName(), $results[$i]->countryName());
-			$this->assertEquals($locations[$i]->countryCode(), $results[$i]->countryCode());
-			$this->assertEquals($locations[$i]->latitude(), $results[$i]->latitude());
-			$this->assertEquals($locations[$i]->longitude(), $results[$i]->longitude());
-			$this->assertEquals($locations[$i]->locationWkt(), $results[$i]->locationWkt());
-			$this->assertEquals($locations[$i]->timeZone(), $results[$i]->timeZone());
-		}
-	}
-	
-	public function testLocations_data(){
-		$radius = 5;
-		$result = array();
-		$result[] = array
-		(
-			51.828056,
-			10.2825,
-			$radius,
-			array
-			(
-				new \SiWeather\Webservice\Location("Wildemann", "", "Niedersachsen", "06", "Deutschland", "DE", 51.8281, 10.28152, "Europe/Berlin"),
-				new \SiWeather\Webservice\Location("Bad Grund", "", "Niedersachsen", "06", "Deutschland", "DE", 51.81021, 10.23694, "Europe/Berlin"),
-				new \SiWeather\Webservice\Location("Zellerfeld", "", "Niedersachsen", "06", "Deutschland", "DE", 51.81846, 10.33532, "Europe/Berlin"),
-				new \SiWeather\Webservice\Location("Clausthal-Zellerfeld", "", "Niedersachsen", "06", "Deutschland", "DE", 51.80949, 10.33821, "Europe/Berlin"),
-				new \SiWeather\Webservice\Location("Clausthal", "", "Niedersachsen", "06", "Deutschland", "DE", 51.80441, 10.33384, "Europe/Berlin"),
-				new \SiWeather\Webservice\Location("Hahnenklee-Bockswiese", "", "Niedersachsen", "06", "Deutschland", "DE", 51.85487, 10.33178, "Europe/Berlin"),
-				new \SiWeather\Webservice\Location("Lautenthal", "", "Niedersachsen", "06", "Deutschland", "DE", 51.86934, 10.28741, "Europe/Berlin"),
-				new \SiWeather\Webservice\Location("Laubhütte", "", "Niedersachsen", "06", "Deutschland", "DE", 51.79609, 10.23479, "Europe/Berlin"),
-			)
-		);
-		return $result;
-	}
-}
-?>
Index: src/webservice/tests/LocationTest.php
===================================================================
--- src/webservice/tests/LocationTest.php	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,146 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-$file = __DIR__ ."/testconfig/testconfig.php";
-require($file);
-require($testconfig["webserviceDirectory"] ."/inc/envsetup.php");
-
-class LocationTest extends PHPUnit_Framework_TestCase
-{
-	public function testCity(){
-		$location = new \SiWeather\Webservice\Location("", "");
-		
-		$value = "testCity";
-		$location->setCity($value);
-		$this->assertEquals($location->city(), $value);
-	}
-	
-	public function testPostalCode(){
-		$location = new \SiWeather\Webservice\Location("", "");
-		
-		$value = "12345";
-		$location->setPostalCode($value);
-		$this->assertEquals($location->postalCode(), $value);
-	}
-	
-	public function testRegion(){
-		$location = new \SiWeather\Webservice\Location("", "");
-		
-		$value1 = "Wallhall";
-		$value2 = "WH";
-		$location->setRegion($value1, $value2);
-		$this->assertEquals($location->regionName(), $value1);
-		$this->assertEquals($location->regionCode(), $value2);
-	}
-	
-	public function testCountry(){
-		$location = new \SiWeather\Webservice\Location("", "");
-		
-		$value1 = "Wallhall";
-		$value2 = "WH";
-		$location->setCountry($value1, $value2);
-		$this->assertEquals($location->countryName(), $value1);
-		$this->assertEquals($location->countryCode(), $value2);
-	}
-
-	public function testValidLatitude_data(){
-		$result = array();
-		$result[] = array(null, false);
-		$result[] = array("asdasd", false);
-		$result[] = array(0, true);
-		$result[] = array(-90, true);
-		$result[] = array(90, true);
-		$result[] = array(85.1234, true);
-		$result[] = array(-90.0001, false);
-		$result[] = array(90.0001, false);
-		return $result;
-	}
-
-	/**
-		* @dataProvider testValidLatitude_data
-		*/
-	public function testValidLatitude($latitude, $result){
-		$this->assertEquals(\SiWeather\Webservice\Location::validLatitude($latitude), $result);
-	}
-
-	public function testValidLongitude_data(){
-		$result = array();
-		$result[] = array(null, false);
-		$result[] = array("asdasd", false);
-		$result[] = array(0, true);
-		$result[] = array(-90, true);
-		$result[] = array(90, true);
-		$result[] = array(85.1234, true);
-		$result[] = array(-180.0001, false);
-		$result[] = array(180.0001, false);
-		return $result;
-	}
-
-	/**
-		* @dataProvider testValidLongitude_data
-		*/
-	public function testValidLongitude($longitude, $result){
-		$this->assertEquals(\SiWeather\Webservice\Location::validLongitude($longitude), $result);
-	}
-	
-	public function testLocation(){
-		$location = new \SiWeather\Webservice\Location("", "");
-		
-		$latitude = -59.0;
-		$longitude = 33;
-		$location->setLocation($latitude, $longitude);
-		$this->assertEquals($location->latitude(), $latitude);
-		$this->assertEquals($location->longitude(), $longitude);
-		$this->assertEquals($location->locationWKT(), $longitude ." ". $latitude);
-	}
-	
-	public function testTimeZone(){
-		$location = new \SiWeather\Webservice\Location("", "");
-		
-		$value = "Europe/Berlin";
-		$location->setTimeZone($value);
-		$this->assertEquals($location->timeZone(), $value);
-	}
-
-	public function constructor(){
-		$city = "Nice Place";
-		$postalCode = "0001";
-		$regionName = "Nice Region";
-		$regionCode = "NR";
-		$countryName = "Nice Country";
-		$countryCode = "NC";
-		$longitude = 50;
-		$latitude = 20;
-		$location = new \SiWeather\Webservice\Location($city, $postalCode, $regionName,
-													   $regionCode, $countryName, $countryCode,
-													   $latitude, $longitude);
-		
-		$this->assertEquals($location->city(), $city);
-		$this->assertEquals($location->postalCode(), $postalCode);
-		$this->assertEquals($location->regionName(), $regionName);
-		$this->assertEquals($location->regionCode(), $regionCode);
-		$this->assertEquals($location->countryName(), $countryName);
-		$this->assertEquals($location->countryCode(), $countryCode);
-		$this->assertEquals($location->latitude(), $latitude);
-		$this->assertEquals($location->longitude(), $longitude);
-		$this->assertEquals($location->locationWkt(), $longitude ." ". $latitude);
-	}
-}
-?>
Index: src/webservice/tests/SetupTest.php
===================================================================
--- src/webservice/tests/SetupTest.php	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,170 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-require_once(__DIR__ ."/TestHelpers/TestSetup.php");
-
-class SetupTest extends PHPUnit_Framework_TestCase
-{
-	public static function setUpBeforeClass()
-	{
-		global $testconfig;
-
-		$file = __DIR__ ."/testconfig/testconfig.php";
-		self::assertFileExists($file);
-		require($file);
-		self::$_testconfig = $testconfig;
-
-		require_once($testconfig["webserviceDirectory"] ."/inc/envsetup.php");
-		
-		self::$_webserviceConfig = new SiWeather\Webservice\WebserviceConfig();
-		self::assertNotNull(self::$_webserviceConfig);
-
-		self::$_dataDirectory = self::$_webserviceConfig->getConfig("dataDirectory");
-		self::assertInternaltype("string", self::$_dataDirectory);
-		self::assertTrue(!empty(self::$_dataDirectory));
-		if(file_exists(self::$_dataDirectory))
-			self::assertTrue(TestHelpers\TestSetup::wipeDataDirectory());
-
-		self::assertTrue(!file_exists(self::$_dataDirectory));
-	}
-	
-	public static function tearDownAfterClass()
-	{
-		if(file_exists(self::$_dataDirectory))
-			self::assertTrue(TestHelpers\TestSetup::wipeDataDirectory());
-	}
-
-	public function testSetupFail() {
-		$setup = new SiWeather\Webservice\Setup();
-		$errorMessage = "";
-
-		// all of the following setup routines should report errors (with errorMessages)!
-		// check that data directory does not exists
-		$result = $setup->dataDirectoryCheck($errorMessage);
-		$this->assertEquals($result, SiWeather\Webservice\DataDirectoryChecks::NotExist, $errorMessage);
-		$this->assertTrue(!empty($errorMessage), "Error message \"". $errorMessage ."\" is not empty");
-		$errorMessage = "";
-		
-		// check database directory
-		$result = $setup->databaseDirectoryCheck($errorMessage);
-		$this->assertEquals(!$result, SiWeather\Webservice\DatabaseChecks::Success, $errorMessage);
-		$this->assertTrue(!empty($errorMessage), "Error message \"". $errorMessage ."\" is not empty");
-		$errorMessage = "";
-		
-		// open database connection (and configure the database, if necessary)
-		$this->assertTrue(!$setup->databaseConnection($errorMessage), $errorMessage);
-		$this->assertTrue(!empty($errorMessage), "Error message \"". $errorMessage ."\" is not empty");
-		$errorMessage = "";
-		
-		$prefix = "Database not connected";
-		$versionSqlite = $setup->databaseVersionSqlite($errorMessage);
-		$this->assertEquals($versionSqlite, 0, $prefix ." (Could not determine SQLite version: ". $errorMessage .")");
-		$this->assertTrue(!empty($errorMessage), "Error message \"". $errorMessage ."\" is not empty");
-		$errorMessage = "";
-
-		$versionSpatalite = $setup->databaseVersionSpatalite($errorMessage);
-		$this->assertEquals($versionSpatalite, 0, $prefix ." (Could not determine Spatalite version: ". $errorMessage .")");
-		$this->assertTrue(!empty($errorMessage), "Error message \"". $errorMessage ."\" is not empty");
-   }
-   
-   	public function testSetupWorking() {
-		$setup = new SiWeather\Webservice\Setup();
-		$errorMessage = "";
-		
-		// check that data directory does not exists
-		$result = $setup->dataDirectoryCheck($errorMessage);
-		$this->assertEquals($result, SiWeather\Webservice\DataDirectoryChecks::NotExist, $errorMessage);
-		$this->assertTrue(!empty($errorMessage), "Error message \"". $errorMessage ."\" is not empty");
-		$errorMessage = "";
-		
-		// create data directory
-		$result = $setup->dataDirectoryCreate($errorMessage);
-		$this->assertEquals($result, SiWeather\Webservice\DataDirectoryChecks::Success, $errorMessage);
-		$this->assertTrue(empty($errorMessage), "Error message \"". $errorMessage ."\" is not empty");
-
-		// check database directory
-		$result = $setup->databaseDirectoryCheck($errorMessage);
-		$this->assertEquals($result, SiWeather\Webservice\DatabaseChecks::Success, $errorMessage);
-		$this->assertTrue(empty($errorMessage), "Error message \"". $errorMessage ."\" is not empty");
-		
-		// check database file (or if it could be created)
-		$result = $setup->databaseFileCheck($errorMessage);
-		$this->assertEquals($result, SiWeather\Webservice\DatabaseChecks::Success, $errorMessage);
-		$this->assertTrue(empty($errorMessage), "Error message \"". $errorMessage ."\" is not empty");
-		
-		// open database connection (and configure the database, if necessary)
-		$this->assertTrue($setup->databaseConnection($errorMessage), $errorMessage);
-		$this->assertTrue(empty($errorMessage), "Error message \"". $errorMessage ."\" is not empty");
-
-		$prefix = "Database up and running";
-		$versionSqlite = $setup->databaseVersionSqlite($errorMessage);
-		$this->assertLessThan($versionSqlite, 0, $prefix ." (Could not determine SQLite version: ". $errorMessage .")");
-		$this->assertTrue(empty($errorMessage), "Error message \"". $errorMessage ."\" is not empty");
-
-		$versionSpatalite = $setup->databaseVersionSpatalite($errorMessage);
-		$this->assertLessThan($versionSpatalite, 0, $prefix ." (Could not determine Spatalite version: ". $errorMessage .")");
-		$this->assertTrue(empty($errorMessage), "Error message \"". $errorMessage ."\" is not empty");
-
-		$result = $setup->apiCheckWithoutRewrite($errorMessage);
-		$this->assertTrue($result, $errorMessage);
-   }
-   
-   public function testAlreadyConfigured(){
-		$setup = new SiWeather\Webservice\Setup();
-		$errorMessage = "";
-
-		// check that data directory does not exists
-		$result = $setup->dataDirectoryCheck($errorMessage);
-		$this->assertEquals($result, SiWeather\Webservice\DataDirectoryChecks::Success, $errorMessage);
-		$this->assertTrue(empty($errorMessage), "Error message \"". $errorMessage ."\" is not empty");
-		$errorMessage = "";
-
-		// check database directory
-		$result = $setup->databaseDirectoryCheck($errorMessage);
-		$this->assertEquals($result, SiWeather\Webservice\DatabaseChecks::Success, $errorMessage);
-		$this->assertTrue(empty($errorMessage), "Error message \"". $errorMessage ."\" is not empty");
-		
-		// check database file (or if it could be created)
-		$result = $setup->databaseFileCheck($errorMessage);
-		$this->assertEquals($result, SiWeather\Webservice\DatabaseChecks::Success, $errorMessage);
-		$this->assertTrue(empty($errorMessage), "Error message \"". $errorMessage ."\" is not empty");
-		
-		// open database connection (and configure the database, if necessary)
-		$this->assertTrue($setup->databaseConnection($errorMessage), $errorMessage);
-		$this->assertTrue(empty($errorMessage), "Error message \"". $errorMessage ."\" is not empty");
-
-		$prefix = "Database up and running";
-		$versionSqlite = $setup->databaseVersionSqlite($errorMessage);
-		$this->assertLessThan($versionSqlite, 0, $prefix ." (Could not determine SQLite version: ". $errorMessage .")");
-		$this->assertTrue(empty($errorMessage), "Error message \"". $errorMessage ."\" is not empty");
-
-		$versionSpatalite = $setup->databaseVersionSpatalite($errorMessage);
-		$this->assertLessThan($versionSpatalite, 0, $prefix ." (Could not determine Spatalite version: ". $errorMessage .")");
-		$this->assertTrue(empty($errorMessage), "Error message \"". $errorMessage ."\" is not empty");
-
-		$result = $setup->apiCheckWithoutRewrite($errorMessage);
-		$this->assertTrue($result, $errorMessage);
-	}
-   
-	protected static $_webserviceConfig;
-	protected static $_dataDirectory;
-	protected static $_testconfig;
-}
-?>
Index: src/webservice/tests/SpatialiteTest.php
===================================================================
--- src/webservice/tests/SpatialiteTest.php	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,208 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-class SpatialiteTest extends PHPUnit_Framework_TestCase
-{
-	public static function setUpBeforeClass()
-	{
-		global $testconfig;
-
-		$file = __DIR__ ."/testconfig/testconfig.php";
-		self::assertFileExists($file);
-		require($file);
-		require_once($testconfig["webserviceDirectory"] ."/SiWeather/Webservice/WebserviceConfig.php");
-		self::$_webserviceConfig = new SiWeather\Webservice\WebserviceConfig();
-		self::assertNotNull(self::$_webserviceConfig);
-		
-		self::$_databaseFile = tempnam(sys_get_temp_dir(), "siw");
-		# PDO SQlite is not able to load extensions (caused by the sqlite pdo driver)
-		# therefore we use PHP SQlite module
-		self::$_database = new SQLite3(self::$_databaseFile);
-	}
-	
-	public static function tearDownAfterClass()
-	{
-		self::assertTrue(self::$_database->close());
-		self::assertTrue(unlink(self::$_databaseFile));
-		self::$_database = null;
-		self::$_databaseFile = null;
-	}
-
-	public function testLoadSpatialite()
-	{
-		$this->assertInstanceOf("SQLite3", self::$_database);
-
-		# loading SpatiaLite as an extension
-		if(!self::$_database->loadExtension(self::$_webserviceConfig->getConfig("spatialiteExtension"))){
-			echo "Could not load SpatialLite extension: ". self::$_database->lastErrorMsg();
-			return;
-		}
-		
-		$this->assertTrue(self::$_database->exec("BEGIN"));
-		$this->assertTrue(self::$_database->exec("SELECT InitSpatialMetadata()"));
-		$this->assertTrue(self::$_database->exec("COMMIT"));
-		
-		# reporting some version info
-		$rs = self::$_database->query("SELECT spatialite_version()");
-		$this->assertInstanceOf('SQLite3Result', $rs);
-		$row = $rs->fetchArray();
-		$this->assertInternalType("array", $row);
-		$this->assertGreaterThan(1, count($row));
-		$this->assertTrue(!empty($row[0]));
-		$row = $rs->fetchArray();
-		$this->assertTrue(!$row);
-	}
-	
-	public function testDistance()
-	{
-		$this->assertInstanceOf("SQLite3", self::$_database);
-
-		$table = "cities";
-		
-		# creating a POINT table
-		$sql  = "CREATE TABLE ". $table ." (";
-		$sql .= "id INTEGER NOT NULL PRIMARY KEY,";
-		$sql .= "name TEXT NOT NULL)";
-		$this->assertTrue(self::$_database->exec($sql));
-
-		# creating a POINT Geometry column named center,
-		# taking two coordinates in SRID 4326 (WGS84) format
-		$sql  = "SELECT AddGeometryColumn(\"". $table ."\", ";
-		$sql .= "\"center\", 4326, \"POINT\", \"XY\")";
-		$this->assertTrue(self::$_database->exec($sql));
-		
-		# insert some cities
-		# the center must be described in WKT (s. http://giswiki.org/wiki/WKT) format for a point.
-		# Since we use WGS84 with SRID 4326 as a coordinate system, it expects POINT(LONGITUDE LATITUDE)
-		# as values.
-		# CITY, LATITUDE, LONGITUDE
-		# example Berlin:
-		#   52°31′7″N, 13°24′30″E
-		#   --> 52.518611° Latitude and 13.408333° Longitude
-		#   --> $values[] = array("name" => "Berlin", "latitude" => 52.518611, "longitude" => 13.408333);
-		#   --> POINT("13.408333 52.518611")
-		$values = array();
-		$values[] = array("name" => "Berlin", 			"latitude" => 52.518611, 	"longitude" => 13.408333);
-		$values[] = array("name" => "Potsdam", 			"latitude" => 52.395833, 	"longitude" => 13.061389);
-		$values[] = array("name" => "Hamburg", 			"latitude" => 53.550556, 	"longitude" => 9.993333);
-		$values[] = array("name" => "Dresden", 			"latitude" => 51.049259, 	"longitude" => 13.73836);
-		$values[] = array("name" => "Cape Town",		"latitude" => -33.922667, 	"longitude" => 18.416689);
-		$values[] = array("name" => "New York City", 	"latitude" => 40.712778, 	"longitude" => -74.005833);
-		$values[] = array("name" => "Sydney", 			"latitude" => -33.85, 		"longitude" => 151.2);
-		
-		# distances in meter
-		$distances = array();
-		$distances["Berlin"] = array();
-		$distances["Berlin"]["Potsdam"] = 27185;
-		$distances["Berlin"]["Hamburg"] = 255518;
-		$distances["Berlin"]["Dresden"] = 164954;
-		$distances["Berlin"]["Cape Town"] = 9624137;
-		$distances["Berlin"]["New York City"] = 6385266;
-		$distances["Berlin"]["Sydney"] = 16092238;
-		
-		$distances["Potsdam"] = array();
-		$distances["Potsdam"]["Hamburg"] = 242231;
-		$distances["Potsdam"]["Dresden"] = 156823;
-		$distances["Potsdam"]["Cape Town"] =9612288;
-		$distances["Potsdam"]["New York City"] = 6370104;
-		$distances["Potsdam"]["Sydney"] = 16118486;
-		
-		$distances["Hamburg"] = array();
-		$distances["Hamburg"]["Dresden"] = 377003;
-		$distances["Hamburg"]["Cape Town"] = 9760489;
-		$distances["Hamburg"]["New York City"] = 6129909;
-		$distances["Hamburg"]["Sydney"] = 16275543;
-		
-		$distances["Dresden"] = array();
-		$distances["Dresden"]["Cape Town"] = 9459562;
-		$distances["Dresden"]["New York City"] = 6478589;
-		$distances["Dresden"]["Sydney"] = 16109156;
-		
-		$distances["Cape Town"] = array();
-		$distances["Cape Town"]["New York City"] = 12564111;
-		$distances["Cape Town"]["Sydney"] = 11013398;
-		
-		$distances["New York City"] = array();
-		$distances["New York City"]["Sydney"] = 15988687;
-		
-		$this->assertTrue(self::$_database->exec("BEGIN"));
-		$sql  = "INSERT INTO ". $table ." (name, center) VALUES(:name, GeomFromText(:center, 4326))";
-		$sqlStatement = self::$_database->prepare($sql);
-		foreach ($values as $value){
-			$sqlStatement->clear();
-			$this->assertEquals(3, count($value));
-			$this->assertTrue($sqlStatement->bindValue(":name", $value["name"]));
-			$this->assertTrue($sqlStatement->bindValue(":center", "POINT(". $value["longitude"] ." ". $value["latitude"] .")"));
-			$this->assertInstanceOf("SQLite3Result", $sqlStatement->execute());
-			$sqlStatement->reset();
-		}
-		$this->assertTrue(self::$_database->exec("COMMIT"));
-		
-		# check the inserts
-		$sql  = "SELECT id, name, X(center) as longitude, Y(center) as latitude FROM ". $table ." WHERE name=:name";
-		$sqlStatement = self::$_database->prepare($sql);
-		foreach ($values as $value){
-			$sqlStatement->clear();
-			$this->assertEquals(3, count($value));
-			$this->assertTrue($sqlStatement->bindValue(":name", $value["name"]));
-			$result = $sqlStatement->execute();
-			$this->assertInstanceOf("SQLite3Result", $result);
-			while($row = $result->fetchArray()){
-				$this->assertGreaterThan(4, count($row));
-				$this->assertGreaterThan(-1, $row[0]);
-				$this->assertEquals($value["name"], $row[1]);
-				$this->assertEquals($value["longitude"], $row[2]);
-				$this->assertEquals($value["latitude"], $row[3]);
-			}
-			$sqlStatement->reset();
-		}
-
-		# calculate the distances
-		# Calling Distance() with three parameters, which returns distance in Meter
-		$sql  = "SELECT t1.name, t2.name, Round(Distance(t1.center, t2.center, 1), 0) As distance";
-		$sql .= "  FROM ". $table ." AS t1, ". $table ." AS t2";
-		$sql .= "  WHERE t1.name=:from AND t2.name=:to";
-		$sqlStatement = self::$_database->prepare($sql);
-		foreach(array_keys($distances) as $start){
-			foreach(array_keys($distances[$start]) as $end){
-				$sqlStatement->clear();
-				# Calculate distance from start --> end
-				$this->assertTrue($sqlStatement->bindValue(":from", $start));
-				$this->assertTrue($sqlStatement->bindValue(":to", $end));
-				$result = $sqlStatement->execute();
-				$this->assertInstanceOf("SQLite3Result", $result);
-				while($row = $result->fetchArray()){
-					$this->assertGreaterThan(3, count($row));
-					$this->assertEquals($start, $row[0]);
-					$this->assertEquals($end, $row[1]);
-					# 0.5% difference of the distance is accepted
-					$delta = abs($distances[$start][$end] - $row[2])/$distances[$start][$end];
-					$this->assertLessThan(0.005, $delta, $start ." --> ". $end .":\n  Expected: ". $distances[$start][$end] ."\n  Is: ". $row[2]);
-				}
-				$sqlStatement->reset();
-			}
-		}
-	}
-
-	protected static $_databaseFile;
-	protected static $_database;
-	protected static $_webserviceConfig;
-}
-?>
Index: src/webservice/tests/StationsTest.php
===================================================================
--- src/webservice/tests/StationsTest.php	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,149 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-require_once(__DIR__ ."/TestHelpers/TestSetup.php");
-
-class StationsTest extends PHPUnit_Framework_TestCase
-{
-	protected function setUp(){
-		$file = __DIR__ ."/testconfig/testconfig.php";
-		$this->assertFileExists($file);
-		require($file);
-		$this->_testconfig = $testconfig; 
-		$this->assertNotNull($this->_testconfig);
-		
-		require($testconfig["webserviceDirectory"] ."/inc/envsetup.php");
-		require_once($testconfig["webserviceDirectory"] ."/SiWeather/Webservice/WebserviceConfig.php");
-		
-		$this->_webserviceConfig = new SiWeather\Webservice\WebserviceConfig();
-		$this->assertNotNull($this->_webserviceConfig);
-
-		$this->_dataDirectory = $this->_webserviceConfig->getConfig("dataDirectory");
-		$this->assertInternaltype("string", $this->_dataDirectory);
-		$this->assertTrue(!empty($this->_dataDirectory));
-		if(file_exists($this->_dataDirectory))
-			$this->assertTrue(TestHelpers\TestSetup::wipeDataDirectory());
-		$this->assertTrue(TestHelpers\TestSetup::databaseSetup());
-	}
-    
-	protected function tearDown(){
-		if(file_exists($this->_dataDirectory))
-			$this->assertTrue(TestHelpers\TestSetup::wipeDataDirectory());
-	}
-
-	public function testEmptyStations()
-	{
-		$stations = $this->query("index.php/stations");
-
-		$this->assertInternalType("array", $stations);
-		$message = "";
-		if(array_key_exists("message", $stations))
-			$message = $stations["message"];
-		$this->assertTrue(!array_key_exists("result", $stations), $message);
-		$this->assertEquals(count($stations), 0);
-	}
-
-	public function testRegisterStationUnprovenLocation()
-	{
-		$baseUrl = TestHelpers\TestSetup::webserviceTestBaseUrl();
-		$this->assertInternalType('string', $baseUrl, "baseUrl is not of type string: ". $baseUrl);
-		$this->assertTrue(!empty($baseUrl), "baseUrl is empty: ". $baseUrl);
-		$client = new GuzzleHttp\Client
-		(
-			[
-				"base_uri" => $baseUrl,
-				"timeout" => 5.0,
-				"http_errors" => false,
-			]
-		);
-
-		// sending must failing register request, caused by unproven location
-		$response = $client->post("index.php/stations/register",
-			[ "json" => ["name" => "Cool Station", "longitude" => 23.2, "latitude" => 90, "city" => "Nice town", "type" => "testing", "email" => "test@example.org"]]
-		);
-		$this->assertEquals($response->getStatusCode(), 200, $response->getReasonPhrase());
-		$json = json_decode($response->getBody(), true);
-		$this->assertTrue(array_key_exists("result", $json));
-		$this->assertTrue(array_key_exists("message", $json));
-		$this->assertEquals("unprovenlocation", $json["result"], $json["message"]);
-	}
-
-	public function testRegisterStation()
-	{
-		$baseUrl = TestHelpers\TestSetup::webserviceTestBaseUrl();
-		$this->assertInternalType('string', $baseUrl, "baseUrl is not of type string: ". $baseUrl);
-		$this->assertTrue(!empty($baseUrl), "baseUrl is empty: ". $baseUrl);
-		$client = new GuzzleHttp\Client
-		(
-			[
-				"base_uri" => $baseUrl,
-				"timeout" => 5.0,
-				"http_errors" => false,
-			]
-		);
-
-		$response = $client->post("index.php/stations/register",
-			[ "json" => ["name" => "My Weather Station", "city" => "Clausthal-Zellerfeld", "longitude" => 10.28152, "latitude" => 51.8281, "type" => "testing", "email" => "test@example.org"]]
-		);
-		$this->assertEquals(200, $response->getStatusCode(), $response->getReasonPhrase());
-		$json = json_decode($response->getBody(), true);
-		$this->assertTrue(array_key_exists("result", $json));
-		$this->assertEquals("success", $json["result"], $json["message"]);
-		$this->assertTrue(array_key_exists("uuid", $json));
-		$this->assertTrue(!empty($json["uuid"]));
-		$this->assertTrue(array_key_exists("message", $json));
-		$this->assertTrue(!empty($json["message"]));
-
-		$stations = $this->query("index.php/stations");
-		$this->assertInternalType("array", $stations);
-		$this->assertEquals(1, count($stations));
-		$this->assertTrue(array_key_exists("uuid", $stations[0]));
-		$this->assertEquals($json["uuid"], $stations[0]["uuid"]);
-	}
-	
-	protected function query($url){
-		$baseUrl = TestHelpers\TestSetup::webserviceTestBaseUrl();
-		$this->assertInternalType('string', $baseUrl, "baseUrl is not of type string: ". $baseUrl);
-		$this->assertTrue(!empty($baseUrl), "baseUrl is empty: ". $baseUrl);
-		$client = new GuzzleHttp\Client
-		(
-			[
-				"base_uri" => $baseUrl,
-				"timeout" => 2.0,
-				"http_errors" => false,
-			]
-		);
-		$response = $client->get($url);
-		$this->assertNotNull($response, "Response is empty. Url: ". $baseUrl . $url);
-		$this->assertEquals($response->getStatusCode(), 200, "Status code != 200. Url: ". $baseUrl . $url);
-		$this->assertEquals($response->getReasonPhrase(), "OK", "Reason phrase not empty. Url: ". $baseUrl . $url);
-
-		$body = $response->getBody();
-		$this->assertTrue(!empty($body), "Response body is empty. Url: ". $baseUrl . $url);
-		$json = json_decode($body, true);
-		$this->assertNotNull($json, "Json decode returned null. Url: ". $baseUrl . $url ."\nBody: ". $body);
-		return $json;
-	}
-	
-	protected $_testconfig;
-	protected $_webserviceConfig;
-	protected $_dataDirectory;
-}
-?>
Index: src/webservice/tests/TestHelpers/TestSetup.php
===================================================================
--- src/webservice/tests/TestHelpers/TestSetup.php	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,139 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-*/
-
-namespace TestHelpers;
-
-class TestSetup {
-	
-	public static function webserviceTestBaseUrl(){
-		$file = __DIR__ ."/../testconfig/testconfig.php";
-		if(!file_exists($file)){
-			error_log("testconfig file ". $file ." not found");
-			return false;
-		}
-		require($file);
-		if(is_null($testconfig)){
-			error_log("No testconfig found");
-			return false;
-		}
-		require($testconfig["webserviceDirectory"] ."/inc/envsetup.php");
-		require_once($testconfig["webserviceDirectory"] ."/SiWeather/Webservice/WebserviceConfig.php");
-		
-		$webserviceConfig = new \SiWeather\Webservice\WebserviceConfig();
-		if(is_null($webserviceConfig)){
-			error_log("No webservice config created");
-			return false;
-		}
-		$webserviceBaseUrl =  $webserviceConfig->webserviceBaseUrl();
-		if(empty($webserviceBaseUrl) || preg_match("/^https?:\/\/localhost/", $webserviceBaseUrl) != 1){
-			error_log("NOT TESTING AGAINST REMOTE WEBSERVICE. INSTALL WEBSERVICE ON LOCALHOST TO TEST IT!");
-			return false;
-		}
-		return $webserviceBaseUrl;
-	}
-
-	/**
-	  * @brief Configures the database of the webservice which is used for the tests.
-	  *
-	  * @note This function checks whether the webservice base url starts with localhost. If not,
-	  *       false is returned and the remote webservice is not touched. We do not touch remote
-	  *       webservices, not on localhost for testing purposes.
-	  */
-	public static function databaseSetup(){
-		$file = __DIR__ ."/../testconfig/testconfig.php";
-		if(!file_exists($file)){
-			error_log("testconfig file ". $file ." not found");
-			return false;
-		}
-		require($file);
-		if(is_null($testconfig)){
-			error_log("No testconfig found");
-			return false;
-		}
-		
-		require($testconfig["webserviceDirectory"] ."/inc/envsetup.php");
-		require_once($testconfig["webserviceDirectory"] ."/SiWeather/Webservice/WebserviceConfig.php");
-		
-		$webserviceConfig = new \SiWeather\Webservice\WebserviceConfig();
-		if(is_null($webserviceConfig)){
-			error_log("No webservice config created");
-			return false;
-		}
-
-		$webserviceBaseUrl = self::webserviceTestBaseUrl();
-		if(!$webserviceBaseUrl){
-			error_log("Got no webservice test base url");
-			return false;
-		}
-
-		$client = new \GuzzleHttp\Client
-		(
-			[
-				"base_uri" => $webserviceBaseUrl,
-				"timeout" => 15.0,					// Needs some time to create the database!
-				"http_errors" => false,
-			]
-		);
-		$response = $client->get("setup.php");
-		if($response->getStatusCode() !=  200){
-			error_log("Failed to setup webservice database: ". $response->getReasonPhrase());
-			return false;
-		}
-		$body = $response->getBody();
-		if(empty($body)){
-			error_log("Failed to setup webservice database: Empty response!");
-			return false;
-		}
-		
-		// since rewrite api is not working, we get an error here!
-// 		if(strpos($body, "error")){
-// 			error_log("Failed to setup webservice database: Found error in reply (". $body .")");
-// 			return false;
-// 		}
-
-		return true;
-	}
-
-	public static function wipeDataDirectory(){
-		$webserviceConfig = new \SiWeather\Webservice\WebserviceConfig();
-		$dataDirectory = $webserviceConfig->dataDirectory();
-		if(!file_exists($dataDirectory))
-			return true;
-
-		// clear data directory (not recursive, because there should be only a database file in it
-		$content = scandir($dataDirectory);
-		if(!is_array($content)){
-			error_log("result of scandir is not an array");
-			return false;
-		}
-		foreach($content as $file){
-			if(!in_array($file, array(".",".."))){
-				$file = $dataDirectory ."/". $file;
-				if(!unlink($file)){
-					error_log("Failed to delete file ". $file);
-					return false;
-				}
-			}
-		}
-		return rmdir($dataDirectory);
-	}
-}
-
-?>
Index: src/webservice/tests/bootstrap.php
===================================================================
--- src/webservice/tests/bootstrap.php	(revision 4b09d68494ca3be62fedf1006b53f3df1248aa54)
+++ 	(revision )
@@ -1,49 +1,0 @@
-<?php
-/*
-    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-    
-    Followed the guide at http://tech.vg.no/2013/07/19/using-phps-built-in-web-server-in-your-test-suites/
-*/
-
-// Command that starts the built-in web server
-$command = sprintf(
-    'php -S %s:%d -t %s >/tmp/php-dev-server.log 2>&1 & echo $!',
-    WEBSERVICE_SERVER_HOST,
-    WEBSERVICE_SERVER_PORT,
-    WEBSERVICE_SERVER_DOCROOT
-);
- 
-// Execute the command and store the process ID
-$output = array(); 
-exec($command, $output);
-$pid = (int) $output[0];
- 
-echo sprintf(
-    '%s - Web server started on %s:%d with PID %d', 
-    date('r'),
-    WEBSERVICE_SERVER_HOST, 
-    WEBSERVICE_SERVER_PORT, 
-    $pid
-) . PHP_EOL;
- 
-// Kill the web server when the process ends
-register_shutdown_function(function() use ($pid) {
-    echo sprintf('%s - Killing process with ID %d', date('r'), $pid) . PHP_EOL;
-    exec('kill ' . $pid);
-});
-?>
