Blame view

php/config.php 7.35 KB
16035364   Benjamin Renard   First commit
1
<?php
a394ee09   Nathanael Jourdane   bugFix token
2
/**
16035364   Benjamin Renard   First commit
3
4
 * @file config.php
 * @version $Id: config.php 2368 2014-05-21 08:46:23Z elena $
16035364   Benjamin Renard   First commit
5
 */
10200969   Roipoussiere   Remove whitespace...
6

bf74fc2d   Elena.Budnik   IMPEX
7
/*
bf74fc2d   Elena.Budnik   IMPEX
8
9
* Installation-dependent settings
*/
72cddaa0   Benjamin Renard   Add template for ...
10
11
12
13
14

if (!file_exists(__DIR__."/my_config.php")) {
	die("Missing 'my_config.php' config file. Please copy the template file 'php/my_config.template' in 'php/my_config.php' and fill it with your own values.");
}

16035364   Benjamin Renard   First commit
15
16
require_once 'my_config.php';

9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
17
error_reporting(E_ERROR);
10200969   Roipoussiere   Remove whitespace...
18

a22ecd3b   Benjamin Renard   Keep only necessa...
19
# Load AMDA_Integration config
72cddaa0   Benjamin Renard   Add template for ...
20
require_once(INTEGRATION_BASE_PATH.'/config/AMDAIntegrationConfig.php');
a22ecd3b   Benjamin Renard   Keep only necessa...
21
22

//AKKA - For compatibility with IHM
72cddaa0   Benjamin Renard   Add template for ...
23
24
define('BASE_PATH', IHM_SRC_DIR."/");
define('AMDA_IHM', IHM_SRC_DIR."/");
a22ecd3b   Benjamin Renard   Keep only necessa...
25
26

//log for AmdaUpdate/AmdaInstall
75492fe8   Benjamin Renard   Remove some obsol...
27
define('log', IHM_SRC_DIR.'/LOG');
a22ecd3b   Benjamin Renard   Keep only necessa...
28

9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
29
30
if (is_file('amda_version.php')) require_once 'amda_version.php';
if (is_file('errors.php')) require_once 'errors.php';
10200969   Roipoussiere   Remove whitespace...
31

0fea5567   Benjamin Renard   First step for re...
32
//  SYSTEM config section
9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
33
if (!defined('PHP_VERSION_ID')) {
bf74fc2d   Elena.Budnik   IMPEX
34
35
	$version = explode('.', PHP_VERSION);
	define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2]));
16035364   Benjamin Renard   First commit
36
}
9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
37
if (!defined('MAGIC_FILE')) define('MAGIC_FILE','/usr/share/misc/magic');
10200969   Roipoussiere   Remove whitespace...
38

10200969   Roipoussiere   Remove whitespace...
39
date_default_timezone_set('UTC');
16035364   Benjamin Renard   First commit
40

9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
41
42
//  GUESTS LOGIN section
define("MaxGuests", 10);               // Max Guests number
16035364   Benjamin Renard   First commit
43
define("GuestSessionDuration", 300);   //300 minutes
9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
44
45
define("MaxGuestTimeInterval", 10);    // days

16035364   Benjamin Renard   First commit
46

16035364   Benjamin Renard   First commit
47
// user WS size limit
7baca0ef   Elena.Budnik   user special sett...
48
define('DISK_QUOTA_standard', 1024*1024*200); // 200MB
10200969   Roipoussiere   Remove whitespace...
49
// max lines of uploaded ascii file to show
bf74fc2d   Elena.Budnik   IMPEX
50
define('MAX_FILE_INDEX_TO_SHOW', 100);
16035364   Benjamin Renard   First commit
51
// private key used to be considerate as a trust client for some functions of DD web service
a394ee09   Nathanael Jourdane   bugFix token
52
define('DDSERVICE_PRIVATEKEY', '!%p856Dc');
6acb8d2a   Elena.Budnik   checkRequest in R...
53

10200969   Roipoussiere   Remove whitespace...
54

0fea5567   Benjamin Renard   First step for re...
55
//  BATCH JOBS section
9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
56
57
58
//define('JOBTIMEOUT', '1'); // one cycle secs to sleep to allow job be executed
//define('PLOT_CYCLES_NUMBER', 500); // cycles number for PNG
//define('JOB_CYCLES_NUMBER', 5);   // cycles number for all the jobs
bf74fc2d   Elena.Budnik   IMPEX
59
//define('TIMEOUT', '100'); //TODO secs wait before job is killed  OR 'max_execution_time' - kill automatic?
16035364   Benjamin Renard   First commit
60

16035364   Benjamin Renard   First commit
61
// EPN-TAP services
a394ee09   Nathanael Jourdane   bugFix token
62
63
define('EPNTAP_APIS', 'http://voparis-tap.obspm.fr/__system__/tap/run/tap/sync');
define('EPNTAP_AMDA', 'http://cdpp-epntap.irap.omp.eu/__system__/tap/run/tap/sync');
16035364   Benjamin Renard   First commit
64

0fea5567   Benjamin Renard   First step for re...
65
// PHP run-time settings
378a5f7d   Benjamin Renard   Increase PHP memo...
66
ini_set('memory_limit',256000000);
bf74fc2d   Elena.Budnik   IMPEX
67
ini_set('max_execution_time',600); // max PHP execution
38ee7afc   Elena.Budnik   correction of mer...
68

bf74fc2d   Elena.Budnik   IMPEX
69
70
71
72
ini_set('default_socket_timeout', 600); //TODO if this is needed ? IMPEX LONG DURATION WEBSERVICES
// to avoid 403 error while copying from URL
ini_set('user_agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:7.0) Gecko/201001012 Firefox/7.0');
// SHOULD BE DEFINED IN MASTER /etc/php.ini !!!
10200969   Roipoussiere   Remove whitespace...
73
// ini_set('upload_max_filesize',100000000);
bf74fc2d   Elena.Budnik   IMPEX
74
// ini_set('post_max_size',1050000000);
7baca0ef   Elena.Budnik   user special sett...
75

16035364   Benjamin Renard   First commit
76

bf74fc2d   Elena.Budnik   IMPEX
77
// General Info dirs
72cddaa0   Benjamin Renard   Add template for ...
78
define('DATAPATH', IHM_SRC_DIR.'/generic_data/');
72cddaa0   Benjamin Renard   Add template for ...
79
80
81
82
83
84
85
86
87
define('LocalData', DATAPATH.'/LocalData/');
define('PARAMS_LOCALDB_DIR', LocalData.'/ParamDef/');
define('PARAMS_LOCALINFO_DIR', LocalData.'/ParamInfo/');
define('ParamTemplate', LocalData.'/ParamTemplate/');
define('MissionInfo',  LocalData.'/MissionInfo');
define('InstrumentInfo', LocalData.'/InstrumentInfo');
define('DataSetInfo', LocalData.'/DataSetInfo/');
define('RemoteData', DATAPATH.'/RemoteData/');
define('Functions', DATAPATH.'/Functions/');
72cddaa0   Benjamin Renard   Add template for ...
88
89
define('Hst', DATAPATH.'/Hst/');
define('SpecialSettingsDir',DATAPATH.'/SpecialSettings/');
fc890e33   Benjamin Renard   Define common lib...
90
define('CommonLib', DATAPATH.'/compilation/lib/');
16035364   Benjamin Renard   First commit
91

bf74fc2d   Elena.Budnik   IMPEX
92
// General Info files
72cddaa0   Benjamin Renard   Add template for ...
93
94
95
96
97
define('orbitsXml',LocalData.'/Orbites.xml');
define('orbitsAllXml',LocalData.'/OrbitsAll.xml');
define('FeedbackXml', DATAPATH.'/Feedback/Feedback.xml');
define('specialGrpsXml',SpecialSettingsDir.'/Groups.xml');
define('specialSettingsXml',SpecialSettingsDir.'/Settings.xml');
16035364   Benjamin Renard   First commit
98
99

//Help info dirs
72cddaa0   Benjamin Renard   Add template for ...
100
define('HELPPATH', IHM_SRC_DIR."/help/");
82d5e2cf   Elena.Budnik   auto in help dir
101
define('HelpAuto', HELPPATH.'auto/');
16035364   Benjamin Renard   First commit
102

9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
103
// IMPEX section
72cddaa0   Benjamin Renard   Add template for ...
104
define('SimuTargetsXml', DATAPATH.'/SimuTemplate/TargetsSimu.xml');
9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
105
define('IMPEX_INTERVAL_LIMIT', 86400); // one day for impex request
16035364   Benjamin Renard   First commit
106

bf74fc2d   Elena.Budnik   IMPEX
107
// Root User dir  : All user dirs are defined in UserMgr.php
72cddaa0   Benjamin Renard   Add template for ...
108
define('USERPATH', IHM_SRC_DIR.'/data/');
16035364   Benjamin Renard   First commit
109

bf74fc2d   Elena.Budnik   IMPEX
110
// Shared dir
72cddaa0   Benjamin Renard   Add template for ...
111
define('SHAREDPATH', IHM_SRC_DIR.'/shared_data/');
16035364   Benjamin Renard   First commit
112

10200969   Roipoussiere   Remove whitespace...
113
// Web Service servers WSDL : $_SERVER['SERVER_NAME'] (par apache)  gethostname() (par command)
16035364   Benjamin Renard   First commit
114
$SERVER_NAME =  $_SERVER['SERVER_NAME'] ? $_SERVER['SERVER_NAME'] : gethostname();
63f83396   Elena.Budnik   orbit in km for i...
115
define('webAlias',"http://".$SERVER_NAME.APACHE_ALIAS);
bf74fc2d   Elena.Budnik   IMPEX
116

b7741da9   Benjamin Renard   Define DDService ...
117
118
define('DD_WSDL',DDSERVICE.'/dd.wsdl');

99ae8744   Benjamin Renard   Use config variab...
119
120
putenv("LD_LIBRARY_PATH=".COTS_BASE_DIR."/lib:".GCC_BASE_DIR."/lib:".GCC_BASE_DIR."/lib64:"."/lib:/usr/local/lib:/usr/local/lib64");
putenv("PATH=./:".COTS_BASE_DIR."/bin:".GCC_BASE_DIR."/bin:"."/bin:/usr/bin:/usr/local/bin:".IHM_SRC_DIR."/php/bin");
16035364   Benjamin Renard   First commit
121

16035364   Benjamin Renard   First commit
122
putenv("DDPATH=".DDRES_DIR);
72cddaa0   Benjamin Renard   Add template for ...
123
define('XMLPATH', IHM_SRC_DIR.'/php/XML/');
bf74fc2d   Elena.Budnik   IMPEX
124

72cddaa0   Benjamin Renard   Add template for ...
125
require_once(INTEGRATION_BASE_PATH.'/src/amdaintegration_autoload.php');
16035364   Benjamin Renard   First commit
126

16035364   Benjamin Renard   First commit
127

10200969   Roipoussiere   Remove whitespace...
128
global $API;
16035364   Benjamin Renard   First commit
129
$API = array(
bf74fc2d   Elena.Budnik   IMPEX
130
131
132
133
134
135
136
	'AmdaAction'=>array(
		'methods'=>array(
			'getTree'=>array('len'=>1),
			'saveTree'=>array('len'=>1),
			'getInfo'=>array('len'=>1),
			'doNothing'=>array('len'=>1),
			'deleteFromTree'=>array('len'=>1),
10200969   Roipoussiere   Remove whitespace...
137
			'getObject'=>array('len'=>2),
bf74fc2d   Elena.Budnik   IMPEX
138
139
140
141
			'getAsciiFile'=>array('len'=>1),
			'getTmpObject'=>array('len'=>3),
			'getUploadedObject'=>array('len'=>3),
			'getMyParamInfo'=>array('len'=>1),
10200969   Roipoussiere   Remove whitespace...
142
			'deleteObject'=>array('len'=>1),
bf74fc2d   Elena.Budnik   IMPEX
143
144
145
146
147
148
149
150
			'renameObject'=>array('len'=>1),
			'createObject'=>array('len'=>2),
			'modifyObject'=>array('len'=>1),
			'validNameObject'=>array('len'=>1),
			'getJobs'=>array('len'=>0),
			'execute'=>array('len'=>2),
			//'formHandler'=>true
			'compilParam'=>array('len'=>1),
8ba47f72   Benjamin Renard   rest actualisatio...
151
			'generateParamInfo'=>array('len'=>1),
bf74fc2d   Elena.Budnik   IMPEX
152
153
154
155
			'compilParamDelete'=>array('len'=>1),
			'killPlotRequest'=>array('len'=>0),
			'merge'=>array('len'=>1),
			'intersect'=>array('len'=>1),
10200969   Roipoussiere   Remove whitespace...
156
			'loadTTIntervals'=>array('len'=>1),
bf74fc2d   Elena.Budnik   IMPEX
157
			'saveTTCacheIntervalsInTT'=>array('len'=>1),
0fea5567   Benjamin Renard   First step for re...
158
			'initObjectCache'=>array ('len'=>2),
342b20ca   Benjamin Renard   Fix inheritence b...
159
			'initObjectCacheFromObject'=>array('len'=>2),
8be9a1a8   Benjamin Renard   Fix catalog visu
160
			'initForChart'=>array('len'=>5),
0fea5567   Benjamin Renard   First step for re...
161
162
163
			'initObjectCacheFromTmpObject'=>array('len'=>3),
			'initObjectCacheFromUploadedFile'=>array('len'=>3),
			'initObjectCacheFromCatalog'=>array('len'=>2),
19eca0a6   Hacene SI HADJ MOHAND   ok
164
			'initObjectCacheFromTimeTable'=>array('len'=>3),
342b20ca   Benjamin Renard   Fix inheritence b...
165
			'readCacheIntervals'=>array('len'=>1),
bf74fc2d   Elena.Budnik   IMPEX
166
			'readIntervalsForChart'=>array('len'=>1),
342b20ca   Benjamin Renard   Fix inheritence b...
167
			'addCacheInterval'=>array('len'=>1),
bf74fc2d   Elena.Budnik   IMPEX
168
			'removeTTCacheIntervalFromId'=>array('len'=>2),
342b20ca   Benjamin Renard   Fix inheritence b...
169
			'modifyCacheInterval'=>array('len'=>1),
bf74fc2d   Elena.Budnik   IMPEX
170
171
			'operationTTCacheIntervals'=>array('len'=>2),
			'mergeTTCacheIntervals'=>array('len'=>0),
0318dbe6   Hacene SI HADJ MOHAND   rm_6998 ok
172
			'getTTCacheStatistics'=>array('len'=>1),
bf74fc2d   Elena.Budnik   IMPEX
173
174
175
			'sendFeedback'=>array('len'=>1),
			'saveState'=>array('len'=>1),
			'loadState'=>array('len'=>1),
bf74fc2d   Elena.Budnik   IMPEX
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
			'getHstImagesUrl'=>array('len'=>1),
			'getAPISImagesUrl'=>array('len'=>1),
			'loadFilterList'=>array('len'=>0),
			'loadFilters'=>array('len'=>1),
			'saveFilter'=>array('len'=>1),
			'createFilter'=>array('len'=>1),
			'destroyFilter'=>array('len'=>1),
			'getCrtFilterId'=>array('len'=>0),
			'getCrtFilterResult'=>array('len'=>0),
			'setCrtFilterId'=>array('len'=>1),
			'resetFilter'=>array('len'=>0),
			'logout'=>array('len'=>1),
			'getUserInfo'=>array('len'=>0),
			'convertWS'=>array('len'=>0),
			'getRun'=>array('len'=>1),
			'addRun'=>array('len'=>1),
			//AKKA - New action to clean user WS
			'cleanUserWS'=>array('len'=>0),
			'deleteSpecialInfo'=>array('len'=>1),
			'interactivePlot'=>array('len'=>2),
			'getParamPlotInit'=>array('len'=>1),
			'getParamInfo'=>array('len'=>1),
bf776dc8   Benjamin Renard   working
198
			'getDerivedParamInfo'=>array('len'=>1),
bf74fc2d   Elena.Budnik   IMPEX
199
200
			'getSharedObjectFolders' => array('len'=>1),
			'shareObjects' => array('len'=>1),
0bda97f3   Benjamin Renard   Fix SAMP export f...
201
202
			'isSharedObjectNameAlreadyUsed' => array('len'=>1),
			'getRequestByProcessId' => array('len'=>1),
bf74fc2d   Elena.Budnik   IMPEX
203
		)
10200969   Roipoussiere   Remove whitespace...
204
	)
16035364   Benjamin Renard   First commit
205
206
);
?>