Blame view

php/config.php 6.69 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
*/
16035364   Benjamin Renard   First commit
10
11
require_once 'my_config.php';

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

9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
14
15
if (is_file('amda_version.php')) require_once 'amda_version.php';
if (is_file('errors.php')) require_once 'errors.php';
10200969   Roipoussiere   Remove whitespace...
16

9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
17
//  SYSTEM config section 
a394ee09   Nathanael Jourdane   bugFix token
18
if (!defined('PHP_VERSION_ID')) {
bf74fc2d   Elena.Budnik   IMPEX
19
20
	$version = explode('.', PHP_VERSION);
	define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2]));
a394ee09   Nathanael Jourdane   bugFix token
21
}
9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
22
if (!defined('MAGIC_FILE')) define('MAGIC_FILE','/usr/share/misc/magic');
10200969   Roipoussiere   Remove whitespace...
23
24

date_default_timezone_set('UTC');
16035364   Benjamin Renard   First commit
25

9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
26
27
//  GUESTS LOGIN section
define("MaxGuests", 10);               // Max Guests number
16035364   Benjamin Renard   First commit
28
define("GuestSessionDuration", 300);   //300 minutes
9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
29
30
define("MaxGuestTimeInterval", 10);    // days

16035364   Benjamin Renard   First commit
31

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

10200969   Roipoussiere   Remove whitespace...
39

9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
40
41
42
43
//  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
44
//define('TIMEOUT', '100'); //TODO secs wait before job is killed  OR 'max_execution_time' - kill automatic?
16035364   Benjamin Renard   First commit
45

16035364   Benjamin Renard   First commit
46
// EPN-TAP services
a394ee09   Nathanael Jourdane   bugFix token
47
48
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
49

9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
50
// PHP run-time settings 
bf74fc2d   Elena.Budnik   IMPEX
51
52
ini_set('memory_limit',128000000);
ini_set('max_execution_time',600); // max PHP execution
38ee7afc   Elena.Budnik   correction of mer...
53

bf74fc2d   Elena.Budnik   IMPEX
54
55
56
57
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...
58
// ini_set('upload_max_filesize',100000000);
bf74fc2d   Elena.Budnik   IMPEX
59
// ini_set('post_max_size',1050000000);
7baca0ef   Elena.Budnik   user special sett...
60

16035364   Benjamin Renard   First commit
61

bf74fc2d   Elena.Budnik   IMPEX
62
// General Info dirs
a394ee09   Nathanael Jourdane   bugFix token
63
define('DATAPATH', IHM_SRC_DIR . 'generic_data/');
10200969   Roipoussiere   Remove whitespace...
64
//define('Param', DATAPATH.'Param/');
a394ee09   Nathanael Jourdane   bugFix token
65
66
67
define('LocalData', DATAPATH . 'LocalData/');
define('RemoteData', DATAPATH . 'RemoteData/');
define('Functions', DATAPATH . 'Functions/');
bf74fc2d   Elena.Budnik   IMPEX
68
//define('Plot', DATAPATH.'Plot/');
a394ee09   Nathanael Jourdane   bugFix token
69
70
define('Hst', DATAPATH . 'Hst/');
define('SpecialSettingsDir', DATAPATH . 'SpecialSettings/');
16035364   Benjamin Renard   First commit
71

bf74fc2d   Elena.Budnik   IMPEX
72
// General Info files
a394ee09   Nathanael Jourdane   bugFix token
73
74
75
76
77
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
78
79

//Help info dirs
9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
80
define('HELPPATH', IHM_SRC_DIR."help/");
16035364   Benjamin Renard   First commit
81

9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
82
// IMPEX section
bf74fc2d   Elena.Budnik   IMPEX
83
define('SimuTargetsXml', DATAPATH.'SimuTemplate/TargetsSimu.xml');
9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
84
define('IMPEX_INTERVAL_LIMIT', 86400); // one day for impex request
16035364   Benjamin Renard   First commit
85

16035364   Benjamin Renard   First commit
86

bf74fc2d   Elena.Budnik   IMPEX
87
// Root User dir  : All user dirs are defined in UserMgr.php
a394ee09   Nathanael Jourdane   bugFix token
88
define('USERPATH', IHM_SRC_DIR . 'data/');
16035364   Benjamin Renard   First commit
89

bf74fc2d   Elena.Budnik   IMPEX
90
// Shared dir
a394ee09   Nathanael Jourdane   bugFix token
91
define('SHAREDPATH', IHM_SRC_DIR . 'shared_data/');
16035364   Benjamin Renard   First commit
92

9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
93
// WEB SERVICES section
bf74fc2d   Elena.Budnik   IMPEX
94
95
define('WSRESULT', USERPATH.'WSRESULT/'); // Web Services result directory
define('wsResultsXml',WSRESULT.'WSresults.xml'); // Web Service result file
bf74fc2d   Elena.Budnik   IMPEX
96
define('plotsXml', IHM_SRC_DIR.'public/WebServices/XML/AmdaPlots.xml'); // Web Service getPlot : list of parameters to plot
16035364   Benjamin Renard   First commit
97

10200969   Roipoussiere   Remove whitespace...
98
// Web Service servers WSDL : $_SERVER['SERVER_NAME'] (par apache)  gethostname() (par command)
16035364   Benjamin Renard   First commit
99
$SERVER_NAME =  $_SERVER['SERVER_NAME'] ? $_SERVER['SERVER_NAME'] : gethostname();
63f83396   Elena.Budnik   orbit in km for i...
100
101
define('webAlias',"http://".$SERVER_NAME.APACHE_ALIAS);
define('wsdl_AMDA', webAlias."public/wsdl/Methods_AMDA.wsdl");
bf74fc2d   Elena.Budnik   IMPEX
102

ba5ca383   Benjamin Renard   Cleanup old confi...
103
// AKKA - KERNELBIN is now the new kernel bin dir
a394ee09   Nathanael Jourdane   bugFix token
104
define('KERNELBIN', NEWKERNEL_INSTALL_DIR . 'bin/');
16035364   Benjamin Renard   First commit
105

a394ee09   Nathanael Jourdane   bugFix token
106
107
putenv("LD_LIBRARY_PATH=" . SYS_LIBS . ":" . DDLIB . ":" . CEFLIB . ":" . CDFLIB);
putenv("PATH=./:" . DDBIN . ":" . SYS_BIN . ":" . IHM_SRC_DIR . "php/bin");
16035364   Benjamin Renard   First commit
108

16035364   Benjamin Renard   First commit
109
putenv("DDPATH=".DDRES_DIR);
bf74fc2d   Elena.Budnik   IMPEX
110
define('XMLPATH', IHM_SRC_DIR.'php/XML/');
bf74fc2d   Elena.Budnik   IMPEX
111

9e3cbd95   Elena.Budnik   merge AMDA_IHM AM...
112
require_once(INTEGRATION_BASE_PATH.'src/amdaintegration_autoload.php');
a394ee09   Nathanael Jourdane   bugFix token
113

16035364   Benjamin Renard   First commit
114

10200969   Roipoussiere   Remove whitespace...
115
global $API;
16035364   Benjamin Renard   First commit
116
$API = array(
bf74fc2d   Elena.Budnik   IMPEX
117
118
119
120
121
122
123
	'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...
124
			'getObject'=>array('len'=>2),
bf74fc2d   Elena.Budnik   IMPEX
125
126
127
128
			'getAsciiFile'=>array('len'=>1),
			'getTmpObject'=>array('len'=>3),
			'getUploadedObject'=>array('len'=>3),
			'getMyParamInfo'=>array('len'=>1),
10200969   Roipoussiere   Remove whitespace...
129
			'deleteObject'=>array('len'=>1),
bf74fc2d   Elena.Budnik   IMPEX
130
131
132
133
134
135
136
137
138
139
140
141
			'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...
142
			'loadTTIntervals'=>array('len'=>1),
bf74fc2d   Elena.Budnik   IMPEX
143
144
145
146
147
			'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
148
			'initTTCacheFromUploadedFile'=>array('len'=>3),
bf74fc2d   Elena.Budnik   IMPEX
149
150
151
152
153
154
155
156
157
158
159
			'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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
			'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),
0bda97f3   Benjamin Renard   Fix SAMP export f...
184
185
			'isSharedObjectNameAlreadyUsed' => array('len'=>1),
			'getRequestByProcessId' => array('len'=>1),
bf74fc2d   Elena.Budnik   IMPEX
186
		)
10200969   Roipoussiere   Remove whitespace...
187
	)
16035364   Benjamin Renard   First commit
188
);
16035364   Benjamin Renard   First commit
189
?>