Blame view

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

bf74fc2d   Elena.Budnik   IMPEX
8
9
/*
 * ob_start
10200969   Roipoussiere   Remove whitespace...
10
11
 * This function will turn output buffering on.
 * While output buffering is active no output is sent from the script (other than headers),
bf74fc2d   Elena.Budnik   IMPEX
12
 * instead the output is stored in an internal buffer.
10200969   Roipoussiere   Remove whitespace...
13
14
15
 * The contents of this internal buffer may be copied into a string variable using ob_get_contents().
 * To output what is stored in the internal buffer, use ob_end_flush().
 * Alternatively, ob_end_clean() will silently discard the buffer contents.
bf74fc2d   Elena.Budnik   IMPEX
16
17
18
19
20
21
*/
// ob_start();

/*
* Installation-dependent settings
*/
16035364   Benjamin Renard   First commit
22
23
require_once 'my_config.php';

bf74fc2d   Elena.Budnik   IMPEX
24
25
if (is_file('amda_version.php'))
	require_once 'amda_version.php';
10200969   Roipoussiere   Remove whitespace...
26
27

if (is_file('errors.php'))
bf74fc2d   Elena.Budnik   IMPEX
28
	require_once 'errors.php';
10200969   Roipoussiere   Remove whitespace...
29
30
31

/*----------------------- SYSTEM config section --------*/
if (!defined('PHP_VERSION_ID'))
bf74fc2d   Elena.Budnik   IMPEX
32
33
34
{
	$version = explode('.', PHP_VERSION);
	define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2]));
16035364   Benjamin Renard   First commit
35
36
}

10200969   Roipoussiere   Remove whitespace...
37
if (!defined('MAGIC_FILE'))
bf74fc2d   Elena.Budnik   IMPEX
38
	define('MAGIC_FILE','/usr/share/misc/magic');
10200969   Roipoussiere   Remove whitespace...
39
40

date_default_timezone_set('UTC');
bf74fc2d   Elena.Budnik   IMPEX
41
/*-----------------------END SYSTEM config section --------*/
16035364   Benjamin Renard   First commit
42

10200969   Roipoussiere   Remove whitespace...
43
/*----------------------- GUESTS LOGIN section --------*/
bf74fc2d   Elena.Budnik   IMPEX
44
define("MaxGuests", 10); // Max Guests number
16035364   Benjamin Renard   First commit
45
46
define("GuestSessionDuration", 300);   //300 minutes
define("MaxGuestTimeInterval", 10);   // days
10200969   Roipoussiere   Remove whitespace...
47
/*-----------------------END GUESTS LOGIN section --------*/
16035364   Benjamin Renard   First commit
48

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

10200969   Roipoussiere   Remove whitespace...
56
57
define('IMPEX_INTERVAL_LIMIT', 86400); // one day for impex request

bf74fc2d   Elena.Budnik   IMPEX
58
59
/*----------------------- BATCH JOBS section --------*/
define('JOBTIMEOUT', '1'); // one cycle secs to sleep to allow job be executed
16035364   Benjamin Renard   First commit
60
61
define('PLOT_CYCLES_NUMBER', 500); // cycles number for PNG
define('JOB_CYCLES_NUMBER', 5);   // cycles number for all the jobs
bf74fc2d   Elena.Budnik   IMPEX
62
//define('TIMEOUT', '100'); //TODO secs wait before job is killed  OR 'max_execution_time' - kill automatic?
16035364   Benjamin Renard   First commit
63

bf74fc2d   Elena.Budnik   IMPEX
64
/*-----------------------END BATCH JOBS section --------*/
16035364   Benjamin Renard   First commit
65

16035364   Benjamin Renard   First commit
66
67
// EPN-TAP services
define('EPNTAP_APIS','http://voparis-tap.obspm.fr/__system__/tap/run/tap/sync');
ff2c3319   Myriam Bouchemit   cesr -> irap
68
define('EPNTAP_AMDA','http://cdpp-epntap.irap.omp.eu/__system__/tap/run/tap/sync');
16035364   Benjamin Renard   First commit
69

10200969   Roipoussiere   Remove whitespace...
70
/*----------------------- PHP run-time settings --------*/
bf74fc2d   Elena.Budnik   IMPEX
71
72
73
74
75
76
ini_set('memory_limit',128000000);
ini_set('max_execution_time',600); // max PHP execution
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...
77
// ini_set('upload_max_filesize',100000000);
bf74fc2d   Elena.Budnik   IMPEX
78
// ini_set('post_max_size',1050000000);
7baca0ef   Elena.Budnik   user special sett...
79

10200969   Roipoussiere   Remove whitespace...
80
/*-----------------------END PHP run-time settings --------*/
16035364   Benjamin Renard   First commit
81

bf74fc2d   Elena.Budnik   IMPEX
82
83
// General Info dirs
define('DATAPATH', IHM_SRC_DIR.'generic_data/');
10200969   Roipoussiere   Remove whitespace...
84
85
//define('Param', DATAPATH.'Param/');
define('LocalData', DATAPATH.'LocalData/');
16035364   Benjamin Renard   First commit
86
87
define('RemoteData', DATAPATH.'RemoteData/');
define('Functions', DATAPATH.'Functions/');
bf74fc2d   Elena.Budnik   IMPEX
88
//define('Plot', DATAPATH.'Plot/');
16035364   Benjamin Renard   First commit
89
define('Hst', DATAPATH.'Hst/');
10200969   Roipoussiere   Remove whitespace...
90
define('SpecialSettingsDir',DATAPATH.'SpecialSettings/');
16035364   Benjamin Renard   First commit
91

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

//Help info dirs
bf74fc2d   Elena.Budnik   IMPEX
100
define('HELPPATH',  IHM_SRC_DIR."help/");
16035364   Benjamin Renard   First commit
101

10200969   Roipoussiere   Remove whitespace...
102
// IMPEX special files
bf74fc2d   Elena.Budnik   IMPEX
103
define('SimuTargetsXml', DATAPATH.'SimuTemplate/TargetsSimu.xml');
16035364   Benjamin Renard   First commit
104

bf74fc2d   Elena.Budnik   IMPEX
105
106
// Root User dir  : All user dirs are defined in UserMgr.php
define('USERPATH', IHM_SRC_DIR.'data/');
16035364   Benjamin Renard   First commit
107

bf74fc2d   Elena.Budnik   IMPEX
108
109
// Shared dir
define('SHAREDPATH', IHM_SRC_DIR.'shared_data/');
16035364   Benjamin Renard   First commit
110

bf74fc2d   Elena.Budnik   IMPEX
111
112
113
/*------------------- WEB SERVICES section ---------*/
define('WSRESULT', USERPATH.'WSRESULT/'); // Web Services result directory
define('wsResultsXml',WSRESULT.'WSresults.xml'); // Web Service result file
16035364   Benjamin Renard   First commit
114

bf74fc2d   Elena.Budnik   IMPEX
115
define('plotsXml', IHM_SRC_DIR.'public/WebServices/XML/AmdaPlots.xml'); // Web Service getPlot : list of parameters to plot
16035364   Benjamin Renard   First commit
116

10200969   Roipoussiere   Remove whitespace...
117
// Web Service servers WSDL : $_SERVER['SERVER_NAME'] (par apache)  gethostname() (par command)
16035364   Benjamin Renard   First commit
118
$SERVER_NAME =  $_SERVER['SERVER_NAME'] ? $_SERVER['SERVER_NAME'] : gethostname();
63f83396   Elena.Budnik   orbit in km for i...
119
120
121

define('webAlias',"http://".$SERVER_NAME.APACHE_ALIAS);
define('wsdl_AMDA', webAlias."public/wsdl/Methods_AMDA.wsdl");
bf74fc2d   Elena.Budnik   IMPEX
122
123
/*-------------------END WEB SERVICES section ---------*/

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

16035364   Benjamin Renard   First commit
127
putenv("LD_LIBRARY_PATH=".SYS_LIBS.":".DDLIB.":".CEFLIB.":".CDFLIB);
bf74fc2d   Elena.Budnik   IMPEX
128
putenv("PATH=./:".DDBIN.":".SYS_BIN.":".IHM_SRC_DIR."php/bin");
16035364   Benjamin Renard   First commit
129

16035364   Benjamin Renard   First commit
130
putenv("DDPATH=".DDRES_DIR);
bf74fc2d   Elena.Budnik   IMPEX
131
132
133
134

// PHP classes
define('XMLPATH', IHM_SRC_DIR.'php/XML/');
define('CLASSPATH', IHM_SRC_DIR.'php/classes/');
6657f68b   Elena.Budnik   monitor impex ser...
135
define('REMOTE_CLASSPATH', IHM_SRC_DIR.'php/RemoteDataCenter/');
bf74fc2d   Elena.Budnik   IMPEX
136
137
define('OLD_CLASSPATH', IHM_SRC_DIR.'php/old_amda/');

6657f68b   Elena.Budnik   monitor impex ser...
138
set_include_path(".:".CLASSPATH.":".REMOTE_CLASSPATH.":".OLD_CLASSPATH);
16035364   Benjamin Renard   First commit
139

10200969   Roipoussiere   Remove whitespace...
140
if (!function_exists('__autoload'))
bf74fc2d   Elena.Budnik   IMPEX
141
142
143
144
{
	function __autoload($class_name) {
			require_once $class_name . '.php';
	}
16035364   Benjamin Renard   First commit
145
}
16035364   Benjamin Renard   First commit
146

10200969   Roipoussiere   Remove whitespace...
147
global $API;
16035364   Benjamin Renard   First commit
148
$API = array(
bf74fc2d   Elena.Budnik   IMPEX
149
150
151
152
153
154
155
	'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...
156
			'getObject'=>array('len'=>2),
bf74fc2d   Elena.Budnik   IMPEX
157
158
159
160
			'getAsciiFile'=>array('len'=>1),
			'getTmpObject'=>array('len'=>3),
			'getUploadedObject'=>array('len'=>3),
			'getMyParamInfo'=>array('len'=>1),
10200969   Roipoussiere   Remove whitespace...
161
			'deleteObject'=>array('len'=>1),
bf74fc2d   Elena.Budnik   IMPEX
162
163
164
165
166
167
168
169
170
171
172
173
			'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),
			'compilParamDelete'=>array('len'=>1),
			'killPlotRequest'=>array('len'=>0),
			'merge'=>array('len'=>1),
			'intersect'=>array('len'=>1),
10200969   Roipoussiere   Remove whitespace...
174
			'loadTTIntervals'=>array('len'=>1),
bf74fc2d   Elena.Budnik   IMPEX
175
176
177
178
179
			'saveTTCacheIntervalsInTT'=>array('len'=>1),
			'initTTCache'=>array ('len'=>2),
			'initTTCacheFromTT'=>array('len'=>2),
			'initForChart'=>array('len'=>4),
			'initTTCacheFromTmpObject'=>array('len'=>3),
901ba3f3   Elena.Budnik   upload catalog
180
			'initTTCacheFromUploadedFile'=>array('len'=>3),
bf74fc2d   Elena.Budnik   IMPEX
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
			'readTTCacheIntervals'=>array('len'=>1),
			'readIntervalsForChart'=>array('len'=>1),
			'addTTCacheInterval'=>array('len'=>1),
			'removeTTCacheIntervalFromId'=>array('len'=>2),
			'modifyTTCacheInterval'=>array('len'=>1),
			'operationTTCacheIntervals'=>array('len'=>2),
			'mergeTTCacheIntervals'=>array('len'=>0),
			'getTTCacheStatistics'=>array('len'=>0),
			'sendFeedback'=>array('len'=>1),
			'saveState'=>array('len'=>1),
			'loadState'=>array('len'=>1),
			'sendToSAMP'=>array('len'=>1),
			'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),
			'getSharedObjectFolders' => array('len'=>1),
			'shareObjects' => array('len'=>1),
			'isSharedObjectNameAlreadyUsed' => array('len'=>1)
		)
10200969   Roipoussiere   Remove whitespace...
219
	)
16035364   Benjamin Renard   First commit
220
221
);
?>