diff config/config.php @ 77:97c1e5102a22 extractapp

New: export table for a file from LGService
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Thu, 16 Apr 2015 14:53:22 +0200
parents 6676ca451dcc
children 960ba96efce1
line wrap: on
line diff
--- a/config/config.php	Mon Apr 13 15:43:59 2015 +0200
+++ b/config/config.php	Thu Apr 16 14:53:22 2015 +0200
@@ -1,27 +1,44 @@
 <?php
+$conf = new Config();
+$conf->Configuration();
 
-$AT_LOCAL = false;
+class Config {
 
-if (!$AT_LOCAL) {
-	// host at localgazetteers-dev server
-	$mysql_database = "Gazetteer";
-	$mysql_server = "localhost";
-	$mysql_user = "root";
-	$mysql_password = "admin";
-	$server_host = "http://localgazetteers-dev/";
-	$lgserver_url = $server_host."LGServices/";
+	public function Configuration() {
+		/** 
+		* Configuration for the system.
+		* If it runs with LGService, set $AT_LOCAL to be true; 
+		* otherwise (runs on localhost), set it to be false.
+		*/
+
+		global $AT_LOCAL, $mysql_database, $mysql_server, $mysql_user, $mysql_password, $server_host, $lgserver_url,
+				$systemNAME, $system_root_url;
+
+		$AT_LOCAL = false;
 
-} else {
-	// localhost
-	$mysql_database = "Gazetteers";
-	$mysql_server = "localhost";
-	$mysql_user = "root";
-	$mysql_password = "root";
-	$server_host = "http://localhost:1080/localgazetteers-dev/";
-	$lgserver_url = "http://localgazetteers-dev/LGServices/";
+		if (!$AT_LOCAL) {
+			// host at localgazetteers-dev server
+			$mysql_database = "Gazetteer";
+			$mysql_server = "localhost";
+			$mysql_user = "root";
+			$mysql_password = "admin";
+			$server_host = "http://localgazetteers-dev/";
+			$lgserver_url = $server_host."LGServices/";
+
+		} else {
+			// localhost
+			$mysql_database = "Gazetteers";
+			$mysql_server = "localhost";
+			$mysql_user = "root";
+			$mysql_password = "root";
+			$server_host = "http://localhost:1080/localgazetteers-dev/";
+			$lgserver_url = "http://localgazetteers-dev/LGServices/";
+		}
+
+		$systemNAME = "interface";
+		$system_root_url = $server_host."extraction-interface";
+
+	}
+
 }
-
-$systemNAME = "interface";
-$system_root_url = $server_host."extraction-interface";
-
 ?>