changeset 1:de2c442b6cbb

config to development server
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Tue, 24 Mar 2015 15:13:59 +0100
parents 57bde4830927
children b85894a9b2dc
files config/Lib_mb_utf8.php config/config.php get_coordinates_for_listed_books.php
diffstat 3 files changed, 107 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/Lib_mb_utf8.php	Tue Mar 24 15:13:59 2015 +0100
@@ -0,0 +1,76 @@
+<?php
+   mb_regex_encoding('UTF-8');
+   mb_internal_encoding('UTF-8');
+
+   // ******************************************************************************
+
+   function mb($s) {
+      return mb8($s);
+   }
+   
+   function mb16($s) {
+      //return mb_convert_encoding($s, 'UTF-16LE');
+      return big5_to_utf16($s);
+   }
+   
+   function mb8($s) {
+      //return mb_convert_encoding($s, 'UTF-16LE');
+      return big5_to_utf8($s);
+   }
+   
+   function u8b5($s) {
+      return utf8_to_big5($s);
+   }
+   
+   function b5u8($s) {
+      return big5_to_utf8($s);
+   }
+   
+   function u8u16($s) {
+      return utf8_to_utf16($s);
+   }
+   
+   function u16u8($s) {
+      return utf16_to_utf8($s);
+   }
+   
+   function b5u16($s) {
+      return big5_to_utf16($s);
+   }
+   
+   function u16b5($s) {
+      return utf16_to_big5($s);
+   }
+   
+   function big5_to_utf16($s) {
+      if (!$s) return '';
+      return iconv("BIG-5", "UTF-16LE", $s);
+   }
+   
+   function utf16_to_big5($s) {
+      if (!$s) return '';
+      return iconv("UTF-16LE", "BIG-5//IGNORE", $s);
+   }
+   
+   function utf16_to_utf8($s) {
+      if (!$s) return '';
+      return iconv("UTF-16LE", "UTF-8", $s);
+   }
+   
+   function utf8_to_utf16($s) {
+      if (!$s) return '';
+      return iconv("UTF-8", "UTF-16LE", $s);
+   }
+   
+   function big5_to_utf8($s) {
+      if (!$s) return '';
+      return iconv("CP950", "UTF-8//IGNORE", $s);
+   }
+   
+   function utf8_to_big5($s) {
+      if (!$s) return '';
+      return iconv("UTF-8", "CP950//IGNORE", $s);
+   }
+   
+   // ******************************************************************************
+?>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/config.php	Tue Mar 24 15:13:59 2015 +0100
@@ -0,0 +1,26 @@
+<?php
+
+$at_local = false;
+
+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/";
+
+} else {
+	// localhost
+	$mysql_database = "Gazetteers";
+	$mysql_server = "localhost";
+	$mysql_user = "root";
+	$mysql_password = "root";
+	$server_host = "http://localhost:1080/localgazetteers-dev/";
+}
+
+$systemNAME = "interface";
+$system_root_url = $server_host."LGMap/";
+$lgserver_url = $server_host."LGServer/";
+
+?>
--- a/get_coordinates_for_listed_books.php	Tue Mar 24 11:37:17 2015 +0100
+++ b/get_coordinates_for_listed_books.php	Tue Mar 24 15:13:59 2015 +0100
@@ -1,6 +1,6 @@
 <?php
-include_once('../interface/Lib_mb_utf8.php');
-include_once('../interface/config.php');
+include_once('config/Lib_mb_utf8.php');
+include_once('config/config.php');
 
 set_time_limit(0);
 ini_set('memory_limit', '-1');
@@ -18,7 +18,9 @@
 }
 
 function readCsvFile($fileName){
-	$fp=fopen("../search/csv_files/".$fileName,"r");
+	global $server_host;
+	//$fp=fopen("../LGSearch/csv_files/".$fileName,"r");
+	$fp=fopen($server_host."LGSearch/csv_files/".$fileName,"r");
 	$data=fgetcsv($fp);
 	$columnNameMappingArray=['BOOK_ID','LEVEL1','LEVEL2',
                 'Name','PERIOD','TimeSpan:begin','TimeSpan:end','PAGE','SECTION','CONTENT',