Blame view

php/config.php 9.41 KB
16035364   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
 /**
 * @file config.php
 * @version $Id: config.php 2368 2014-05-21 08:46:23Z elena $
 *
 *
 */

$useFirePHP = false;
// require FirePHP files
if($useFirePHP) {
	require_once("firephp/FirePHP.class.php");
	require_once("firephp/fb.php");
}
1f7926b5   Nathanael Jourdane   Remove a warning ...
15
16

// define empty fb() function so code does not break
16035364   Benjamin Renard   First commit
17
18
19
20
// on any forgotten fb() calls later
else {
	function fb() {};
}
1f7926b5   Nathanael Jourdane   Remove a warning ...
21

16035364   Benjamin Renard   First commit
22
23
24
25
26
27
28
29
30
31
32
33
ob_start();

// all installation dependent staff
require_once 'my_config.php';

if (is_file('php/amda_version.php') || is_file('amda_version.php'))
            require_once 'amda_version.php';

// all impex dependent staff
// if (is_file('php/impex_config.php') || is_file('impex_config.php'))
//             require_once 'impex_config.php';
if (is_file('php/impex_config.php'))
1f7926b5   Nathanael Jourdane   Remove a warning ...
34
	require_once 'php/impex_config.php';
16035364   Benjamin Renard   First commit
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
else  require_once 'impex_config.php';
//---------------------------------------

if (!defined('PHP_VERSION_ID'))
 {
    $version = explode('.', PHP_VERSION);
    define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2]));
}

if (!defined('MAGIC_FILE'))
		define('MAGIC_FILE','/usr/share/misc/magic');

define("MaxGuests", 10);
define("GuestSessionDuration", 300);   //300 minutes
define("MaxGuestTimeInterval", 10);   // days

ini_set('upload_max_filesize',30000000);
// SHOULD BE DEFINED IN MASTER php.ini !!!
// ini_set('post_max_size',40000000);
ini_set('memory_limit',128000000);

1f7926b5   Nathanael Jourdane   Remove a warning ...
56
// max lines of uploaded ascii file to show
16035364   Benjamin Renard   First commit
57
58
59
60
61
62
63
64
65
66
67
68
69
define('MAX_FILE_INDEX_TO_SHOW', 100);
// user WS size limit
define('DISK_QUOTA', 1024*1024*200); // 200MB

// 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');

// private key used to be considerate as a trust client for some functions of DD web service
define('DDSERVICE_PRIVATEKEY','!%p856Dc');

date_default_timezone_set('UTC');
// time restriction suffix
define('restricted', '_restr');
1f7926b5   Nathanael Jourdane   Remove a warning ...
70

16035364   Benjamin Renard   First commit
71
72
73
74
// one cycle secs to sleep to allow job be executed
define('JOBTIMEOUT', '1');
define('PLOT_CYCLES_NUMBER', 500); // cycles number for PNG
define('JOB_CYCLES_NUMBER', 5);   // cycles number for all the jobs
1f7926b5   Nathanael Jourdane   Remove a warning ...
75

16035364   Benjamin Renard   First commit
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//TODO secs wait before job is killed  OR 'max_execution_time' - kill automatic?
//define('TIMEOUT', '100');
//TODO define max PHP execution
ini_set('max_execution_time',600);

//Error codes
define('-1','NAME_EXISTS');
define('-2','ID_CREATION_ERROR');
define('-3','NO_SUCH_ID');
define('-4','NO_SUCH_PARENT_ID');
define('-5','NO_OBJECT_FILE');

// SVN Repository for local parameters files (DD_*.xml, LocalParams.xml, ...)
define('SVN_DDMISSIONSINFO', 'svn://cdpp1.cesr.fr/depotINFO/');
define('SVN_LOCALPARAMSINFO', SVN_DDMISSIONSINFO.'LocalParam/');
define('SVN_TEMPLATES', SVN_DDMISSIONSINFO.'Templates/');

// EPN-TAP services
define('EPNTAP_APIS','http://voparis-tap.obspm.fr/__system__/tap/run/tap/sync');
define('EPNTAP_AMDA','http://cdpp-epntap.cesr.fr/__system__/tap/run/tap/sync');

1f7926b5   Nathanael Jourdane   Remove a warning ...
97
// General Info dirs; old AMDA
16035364   Benjamin Renard   First commit
98
99
100
101
102
103
104
define('INFODIR', ROOT_PATH.'INFO/');
define('XMLDIR', ROOT_PATH.'XML/');

// General Info files; old AMDA
define('userGroupsXml',XMLDIR.'AMDA_Users.xml');

// PHP classes : new AMDA
1f7926b5   Nathanael Jourdane   Remove a warning ...
105
define('CLASSPATH', BASE_PATH.'php/classes/');
16035364   Benjamin Renard   First commit
106
107
108
109
110
111
define('OLD_CLASSPATH', BASE_PATH.'php/old_amda/');
define('XMLPATH', BASE_PATH.'php/XML/');

// General Info dirs : new AMDA
define('DATAPATH', BASE_PATH.'generic_data/');

1f7926b5   Nathanael Jourdane   Remove a warning ...
112
define('Param', DATAPATH.'Param/');
16035364   Benjamin Renard   First commit
113
114
115
define('ParamArgs', Param.'Args/');
define('LocalData', DATAPATH.'LocalData/');
define('LocalDataParam', LocalData.'Param/');
1f7926b5   Nathanael Jourdane   Remove a warning ...
116
define('EPNResources', DATAPATH.'EPNResources/');
16035364   Benjamin Renard   First commit
117
118
119
120
121
122
define('LocalDataTemplate', LocalData.'Templates/');
define('RemoteData', DATAPATH.'RemoteData/');
define('Functions', DATAPATH.'Functions/');
define('Plot', DATAPATH.'Plot/');
define('Hst', DATAPATH.'Hst/');
define('GeneralInfo', DATAPATH.'Info/');
1f7926b5   Nathanael Jourdane   Remove a warning ...
123
define('SpecialSettingsDir',DATAPATH.'SpecialSettings/');
16035364   Benjamin Renard   First commit
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139

// General Info files; new  AMDA
define('paramListXml',Param.'LocalParamsList.xml');
define('paramXml',Param.'LocalParams.xml');
define('orbitesXml',Param.'Orbites.xml');
define('spectraXml',Param.'SpectraParamList.xml');
define('targetsXml',LocalData.'targets.xml');

define('missionXml',LocalData.'Missions.xml');
define('internalParams', LocalData.'DD_InternalParams.xml');
define('FeedbackXml', DATAPATH.'Feedback/Feedback.xml');
define('TEMPLATES',BASE_PATH.'amda_plus/templates/');
define('PREDEFINED',BASE_PATH.'amda_plus/predefined/');
define('PRO',BASE_PATH.'amda_plus/pro/');
define('specialGrpsXml',SpecialSettingsDir.'Groups.xml');

a79b0198   Nathanael Jourdane   Add EPN-TAP modul...
140
141
142
// EPN-TAP data
define('EpnTapDataPath', DATAPATH.'EpnTapData/');

16035364   Benjamin Renard   First commit
143
144
145
146
147
148
149
150
151
//Help info dirs
define('HELPPATH',  BASE_PATH."help/");
define('targetsSimu',HELPPATH.'simu/TargetsSimu.xml');

//Root User dir : new AMDA
// All user dirs are defined in UserMgr.php
define('USERPATH', BASE_PATH.'data/');

// Shared dir
169f14d2   Benjamin Renard   Add shared object...
152
define('SHAREDPATH', BASE_PATH.'shared_data/');
16035364   Benjamin Renard   First commit
153
154
155
156
157
158
159
160
161
162
163
164

// Web Services result directory
define('WSRESULT', USERPATH.'WSRESULT/');

// Web Service result file
define('wsResultsXml',WSRESULT.'WSresults.xml');

// Web Service getPlot : list of parameters to plot
define('plotsXml', BASE_PATH.'public/WebServices/XML/AmdaPlots.xml');
// Web Service serveurs WSDL

// $_SERVER['SERVER_NAME'] (par apache)  gethostname() (par command)
1f7926b5   Nathanael Jourdane   Remove a warning ...
165
166
167
$SERVER_NAME = array_key_exists('SERVER_NAME', $_SERVER) ? $_SERVER['SERVER_NAME'] : gethostname();
define('wsdl_AMDA', "http://".$SERVER_NAME.APACHE_ALIAS."public/wsdl/Methods_AMDA.wsdl");

ba5ca383   Benjamin Renard   Cleanup old confi...
168
169
// AKKA - KERNELBIN is now the new kernel bin dir
define('KERNELBIN',NEWKERNEL_INSTALL_DIR.'bin/');
16035364   Benjamin Renard   First commit
170

16035364   Benjamin Renard   First commit
171
172
173
putenv("LD_LIBRARY_PATH=".SYS_LIBS.":".DDLIB.":".CEFLIB.":".CDFLIB);
putenv("PATH=./:".DDBIN.":".SYS_BIN.":".BASE_PATH."php/bin");

16035364   Benjamin Renard   First commit
174
putenv("DDPATH=".DDRES_DIR);
1f7926b5   Nathanael Jourdane   Remove a warning ...
175

16035364   Benjamin Renard   First commit
176
177
178
set_include_path(".:".CLASSPATH.":".OLD_CLASSPATH);

global $API;
1f7926b5   Nathanael Jourdane   Remove a warning ...
179

16035364   Benjamin Renard   First commit
180
181
182
183
184
if (!function_exists('__autoload')) {
     function __autoload($class_name) {
            require_once $class_name . '.php';
     }
}
1f7926b5   Nathanael Jourdane   Remove a warning ...
185

16035364   Benjamin Renard   First commit
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206

$API = array(
    'AmdaAction'=>array(
        'methods'=>array(
	      'getTree'=>array(
		  'len'=>1
	      ),
	      'saveTree'=>array(
		  'len'=>1
	      ),
	      'getInfo'=>array(
		  'len'=>1
	      ),
	      'doNothing'=>array(
		  'len'=>1
	      ),
	      'deleteFromTree'=>array(
		  'len'=>1
	      ),
	      'getObject'=>array(
		  'len'=>2
1f7926b5   Nathanael Jourdane   Remove a warning ...
207
	      ),
16035364   Benjamin Renard   First commit
208
209
210
211
212
213
214
215
216
	      'getAsciiFile'=>array(
		  'len'=>1
	      ),
	      'getTmpObject'=>array(
		  'len'=>3
	      ),
	      'getUploadedObject'=>array(
		  'len'=>3
	      ),
7ac3ce50   Benjamin Renard   First implementat...
217
	      'getMyParamInfo'=>array(
16035364   Benjamin Renard   First commit
218
219
220
221
		  'len'=>1
	      ),
	      'deleteObject'=>array(
		  'len'=>1
1f7926b5   Nathanael Jourdane   Remove a warning ...
222
	      ),
16035364   Benjamin Renard   First commit
223
224
225
226
227
228
229
230
231
	      'renameObject'=>array(
		  'len'=>1
	      ),
	      'createObject'=>array(
		  'len'=>2
	      ),
	      'modifyObject'=>array(
		  'len'=>1
	      ),
86263051   elena   visu second draft
232
233
234
		'validNameObject'=>array(
			'len'=>1
		),
16035364   Benjamin Renard   First commit
235
236
237
238
239
240
241
	      'getJobs'=>array(
		  'len'=>0
	      ),
	      'execute'=>array(
		  'len'=>2
  //		'formHandler'=>true
	      ),
70aabdee   elena   catalog draft
242
243
244
245
246
247
		'compilParam' => array(
			'len'=>1
		),
		'compilParamDelete' => array(
			'len'=>1
		),
16035364   Benjamin Renard   First commit
248
	      'killPlotRequest' =>array(
e6e5b259   Benjamin Renard   Add kill plot req...
249
		  'len'=>0
16035364   Benjamin Renard   First commit
250
251
252
253
254
255
256
257
258
	      ),
	      'merge'=>array(
		      'len'=>1
	      ),
	      'intersect'=>array(
		      'len'=>1
	      ),
	      'loadTTIntervals'=>array(
	          'len'=>1
1f7926b5   Nathanael Jourdane   Remove a warning ...
259
	      ),
048b4d77   elena   catalogs +
260
261
	      'saveTTCacheIntervalsInTT'=>array(
		  'len'=>1
16035364   Benjamin Renard   First commit
262
	      ),
70aabdee   elena   catalog draft
263
		'initTTCache' => array (
3c4227f8   elena   add arg
264
		'len'=>2
70aabdee   elena   catalog draft
265
266
267
268
		)	,
		'initTTCacheFromTT' => array(
		'len'=>2
		),
9d412dda   elena   catalog tmp and r...
269
270
		'initForChart' => array(
		'len'=>4
86263051   elena   visu second draft
271
		),
70aabdee   elena   catalog draft
272
273
274
275
276
277
278
279
280
		'initTTCacheFromTmpObject' => array(
		'len'=>3
		),
		'initTTCacheFromUploadedFile' => array(
		'len'=>2
		),
		'readTTCacheIntervals'=>array(
		'len'=>1
		),
86263051   elena   visu second draft
281
282
283
		'readIntervalsForChart'=>array(
		'len'=>1
		),
70aabdee   elena   catalog draft
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
		'addTTCacheInterval'=>array (
		'len'=>1
		),
		'removeTTCacheIntervalFromId'=>array (
		'len'=>2
		),
		'modifyTTCacheInterval' => array(
		'len'=>1
		),
		'operationTTCacheIntervals' => array(
		'len'=>2
		),
		'mergeTTCacheIntervals' => array (
		'len'=>0
		),
		'getTTCacheStatistics' => array (
		'len'=>0
		),
16035364   Benjamin Renard   First commit
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
	      'sendFeedback'=>array(
		      'len'=>1
	      ),
	      'saveState'=>array(
	          'len'=>1
	      ),
	      'loadState'=>array(
	          'len'=>1
	      ),
	      'sendToSAMP'=>array(
	          'len'=>1
	      ),
	      'getHstImagesUrl'=>array(
	          'len'=>1
	      ),
	      'getAPISImagesUrl'=>array(
1f7926b5   Nathanael Jourdane   Remove a warning ...
318
	          'len'=>1
16035364   Benjamin Renard   First commit
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
	      ),
              '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(
ec577a2d   Elena.Budnik   guest logout bug
348
	           'len'=>1
16035364   Benjamin Renard   First commit
349
350
351
352
	      ),
	      'getUserInfo'=>array(
	           'len'=>0
	      ),
70aabdee   elena   catalog draft
353
354
355
356
357
358
359
360
361
362
363
364
365
366
		'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(
7ac3ce50   Benjamin Renard   First implementat...
367
			'len'=>1
9f08f4eb   Benjamin Renard   Zoom in interacti...
368
369
		),
        'interactivePlot'=>array(
7ac3ce50   Benjamin Renard   First implementat...
370
			'len'=>2
ced82260   Benjamin Renard   Get initial plot ...
371
372
		),
        'getParamPlotInit'=>array(
1f7926b5   Nathanael Jourdane   Remove a warning ...
373
        	'len'=>1
7ac3ce50   Benjamin Renard   First implementat...
374
375
376
		),
        'getParamInfo'=>array(
        	'len'=>1
169f14d2   Benjamin Renard   Add shared object...
377
378
379
380
381
382
383
384
385
        ),
        'getSharedObjectFolders' => array(
        	'len'=>1
        ),
        'shareObjects' => array(
        	'len'=>1
        ),
        'isSharedObjectNameAlreadyUsed' => array(
        	'len'=>1
a79b0198   Nathanael Jourdane   Add EPN-TAP modul...
386
387
        ),
		'epnTapMgr' => array('len'=>2)
ced82260   Benjamin Renard   Get initial plot ...
388
      )
1f7926b5   Nathanael Jourdane   Remove a warning ...
389
    )
16035364   Benjamin Renard   First commit
390
391
);
?>