1
1
<?php
2
+ //ini_set("session.gc_maxlifetime", 86400);
3
+ // set this in php ini
2
4
// $Id$
3
5
define('__ROOT__', dirname(__FILE__). "/");
4
6
require_once(__ROOT__."vendor/autoload.php");
@@ -10,28 +12,28 @@ require_once(__ROOT__."lib/phpwee-php-minifier/phpwee.php");
10
12
$protocol = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") ? "https://" : "http://";
11
13
$out_root = "/srv/www/htdocs/map/out";
12
14
// tmpdir for backend_make
13
- $out_root_tmp = "/home/nas /twmapcache/tmp/out";
14
- $out_html_root = "/map/ out";
15
+ $out_root_tmp = "/home/happyman /twmapcache/tmp/out";
16
+ $out_html_root = "/out";
15
17
$site_url = $protocol . "map.happyman.idv.tw";
16
- $site_html_root = "/twmap ";
18
+ $site_html_root = "/gen ";
17
19
// 30 for SuSE, 33 for Ububtu
18
- define('WWWRUN_UID', 33 );
20
+ define('WWWRUN_UID', 1001 );
19
21
20
22
// 放一版的圖資目錄
21
23
$stbpath = 'http://make.happyman.idv.tw/~happyman/stb';
22
24
// 放從 TMS 的圖磚
23
25
// 放3版 1x1 的圖檔
24
- $tilecachepath = "/mnt /twmapcache/cache";
26
+ $tilecachepath = "/home/happyman /twmapcache/cache";
25
27
26
28
// 不重要
27
29
//if (!file_exists($tilepath."/16")) {
28
30
// die("image dir not ready");
29
31
//}
30
- $tmppath = "/home/nas /twmapcache/tmp";
31
- $diskfullchk = "/home/nas /";
32
+ $tmppath = "/home/happyman /twmapcache/tmp";
33
+ $diskfullchk = "/home/happyman/map /";
32
34
$twmap_gen_version = trim(file_get_contents(__ROOT__."VERSION"));
33
- $TWMAP3_html_root = "/~happyman/twmap3 ";
34
- $TWMAP3URL = "/~happyman/twmap3 /index.php";
35
+ $TWMAP3_html_root = "/map ";
36
+ $TWMAP3URL = "/map /index.php";
35
37
$BETA = 0; // beta for debug output
36
38
$ERROROUT = "ajax";
37
39
@@ -55,41 +57,21 @@ $pixels['A3R'] = array("x"=>2984, "y"=>2110);
55
57
$fuzzy = 20;
56
58
57
59
/* DB 設定寫在這裡 */
58
- $db_host = 'localhost ';
59
- $db_user = "twmap ";
60
- $db_pass = "password ";
61
- $db_name = "twmap ";
60
+ $db_host = '';
61
+ $db_user = "";
62
+ $db_pass = "";
63
+ $db_name = "";
62
64
$db_port = '5432';
63
- $db_dsn = sprintf("postgres9://%s:%s@%s:%s/%s?persist ",$db_user,$db_pass,$db_host,$db_port,$db_name);
65
+ $db_dsn = sprintf("postgres9://%s:%s@%s:%s/%s",$db_user,$db_pass,$db_host,$db_port,$db_name);
64
66
$gdal_dsn = sprintf("PG:dbname='%s' user='%s' password='%s' host='%s' port='%s'",$db_name,$db_user,$db_pass,$db_host,$db_port);
65
67
66
68
67
- // 需要申請一把 xuite / facebook 的 api key
68
- // api.xuite.net
69
69
require_once(__ROOT__."lib/twmapdb.inc.php");
70
70
/* login */
71
71
if (php_sapi_name() != "cli") {
72
-
73
72
require_once(__ROOT__."lib/xuite.php");
74
- require_once __ROOT__."lib/Hybrid/Hybrid/thirdparty/Facebook/base_facebook.php";
75
- require_once __ROOT__."lib/Hybrid/Hybrid/thirdparty/Facebook/facebook.php";
76
-
77
- //require_once(__ROOT__."lib/openid.php");
78
- // move to config-hybridauth.php
79
73
$fb_appid = '';
80
- $facebook = new Facebook(array(
81
- 'appId' => $fb_appid,
82
- // here
83
- 'secret' => '',
84
- // 'cookie' => false,
85
- ));
86
- // here
87
- $xuite = new xuiteAuth(array(
88
- 'api_key' => '',
89
- 'secret' => ''));
90
-
91
74
/* template */
92
- //require_once(__ROOT__."lib/twmapdb.inc.php");
93
75
$smarty = new Smarty();
94
76
// composer autoload require_once(__ROOT__."lib/smarty/Smarty.class.php");
95
77
require_once(__ROOT__."lib/smarty-out-jsmin.inc.php");
@@ -105,10 +87,6 @@ if (php_sapi_name() != "cli") {
105
87
$smarty->assign('twmap3_html_root',$TWMAP3_html_root);
106
88
107
89
}
108
- else {
109
- // special include for CLI
110
- //
111
- }
112
90
require_once __ROOT__."lib/ape/ApeAbstractConnection.php";
113
91
require_once __ROOT__."lib/ape/ApeClient.php";
114
92
require_once __ROOT__."lib/ape/ApeCurlConnection.php";
@@ -120,16 +98,14 @@ require_once __ROOT__."lib/ape/ApeResponse.php";
120
98
121
99
#
122
100
123
- ini_set("session.gc_maxlifetime", 86400);
124
-
125
101
# Keppon API : queue
126
102
define('GEARMAN_SERVER','127.0.0.1');
127
103
128
104
129
- define('APE_HOST','0.ape.happyman.idv.tw');
130
- $CONFIG['admin'] = array();
105
+ define('APE_HOST','0.ape.tile. happyman.idv.tw');
106
+ $CONFIG['admin'] = array( 3 );
131
107
// gdalwarp -t_srs EPSG:4326 dem_20m.tif dem_20m-latlong.tif
132
108
// source: http://data.gov.tw/node/35430
133
109
define('twDEM_path', __ROOT__ ."db/DEM/dem_20m-latlong.tif");
134
- $CONFIG['poi_file'] = "/home/mountain/mapsforge/20171008 /MOI_OSM_Taiwan_TOPO_Rudy.poi";
110
+ $CONFIG['poi_file'] = "/home/happyman/poi /MOI_OSM_Taiwan_TOPO_Rudy.poi";
135
111
0 commit comments