Blame view

php/config.php 7.24 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

9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
32
33
//  SYSTEM config section 
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
//  GUESTS LOGIN section
1c86e68e   Myriam Bouchemit   Max Guests number...
42
define("MaxGuests", 15);               // 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

9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
55
56
57
58
//  BATCH JOBS section  
//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

9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
65
// PHP run-time settings 
bf74fc2d   Elena.Budnik   IMPEX
66
67
ini_set('memory_limit',128000000);
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
158
159
160
161
			'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
162
			'initTTCacheFromUploadedFile'=>array('len'=>3),
bf74fc2d   Elena.Budnik   IMPEX
163
164
165
166
167
168
169
170
171
172
173
			'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),
bf74fc2d   Elena.Budnik   IMPEX
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
			'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
196
			'getDerivedParamInfo'=>array('len'=>1),
bf74fc2d   Elena.Budnik   IMPEX
197
198
			'getSharedObjectFolders' => array('len'=>1),
			'shareObjects' => array('len'=>1),
0bda97f3   Benjamin Renard   Fix SAMP export f...
199
200
			'isSharedObjectNameAlreadyUsed' => array('len'=>1),
			'getRequestByProcessId' => array('len'=>1),
bf74fc2d   Elena.Budnik   IMPEX
201
		)
10200969   Roipoussiere   Remove whitespace...
202
	)
16035364   Benjamin Renard   First commit
203
204
);
?>