config.php
7.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
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
<?php
/**
* @file config.php
* @version $Id: config.php 2368 2014-05-21 08:46:23Z elena $
*
*/
/*
* ob_start
* This function will turn output buffering on.
* While output buffering is active no output is sent from the script (other than headers),
* instead the output is stored in an internal buffer.
* 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.
*/
// ob_start();
/*
* Installation-dependent settings
*/
require_once 'my_config.php';
if (is_file('amda_version.php'))
require_once 'amda_version.php';
if (is_file('errors.php'))
require_once 'errors.php';
/*----------------------- SYSTEM config section --------*/
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');
date_default_timezone_set('UTC');
/*-----------------------END SYSTEM config section --------*/
/*----------------------- GUESTS LOGIN section --------*/
define("MaxGuests", 10); // Max Guests number
define("GuestSessionDuration", 300); //300 minutes
define("MaxGuestTimeInterval", 10); // days
/*-----------------------END GUESTS LOGIN section --------*/
// user WS size limit
define('DISK_QUOTA', 1024*1024*200); // 200MB
// max lines of uploaded ascii file to show
define('MAX_FILE_INDEX_TO_SHOW', 100);
// private key used to be considerate as a trust client for some functions of DD web service
define('DDSERVICE_PRIVATEKEY','!%p856Dc');
/*----------------------- 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
//define('TIMEOUT', '100'); //TODO secs wait before job is killed OR 'max_execution_time' - kill automatic?
/*-----------------------END BATCH JOBS section --------*/
/*----------------------- PHP run-time settings --------*/
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 !!!
// ini_set('upload_max_filesize',100000000);
// ini_set('post_max_size',1050000000);
/*-----------------------END PHP run-time settings --------*/
// General Info dirs
define('DATAPATH', IHM_SRC_DIR.'generic_data/');
//define('Param', DATAPATH.'Param/');
define('LocalData', DATAPATH.'LocalData/');
define('RemoteData', DATAPATH.'RemoteData/');
define('Functions', DATAPATH.'Functions/');
//define('Plot', DATAPATH.'Plot/');
define('Hst', DATAPATH.'Hst/');
define('SpecialSettingsDir',DATAPATH.'SpecialSettings/');
// General Info files
define('orbitsXml',LocalData.'Orbites.xml');
// define('targetsXml',LocalData.'targets.xml');
define('FeedbackXml', DATAPATH.'Feedback/Feedback.xml');
define('specialGrpsXml',SpecialSettingsDir.'Groups.xml');
define('specialSettingsXml',SpecialSettingsDir.'Settings.xml');
//Help info dirs
define('HELPPATH', IHM_SRC_DIR."help/");
// IMPEX special files
define('SimuTargetsXml', DATAPATH.'SimuTemplate/TargetsSimu.xml');
// Root User dir : All user dirs are defined in UserMgr.php
define('USERPATH', IHM_SRC_DIR.'data/');
// Shared dir
define('SHAREDPATH', IHM_SRC_DIR.'shared_data/');
/*------------------- WEB SERVICES section ---------*/
define('WSRESULT', USERPATH.'WSRESULT/'); // Web Services result directory
define('wsResultsXml',WSRESULT.'WSresults.xml'); // Web Service result file
define('plotsXml', IHM_SRC_DIR.'public/WebServices/XML/AmdaPlots.xml'); // Web Service getPlot : list of parameters to plot
// Web Service servers WSDL : $_SERVER['SERVER_NAME'] (par apache) gethostname() (par command)
$SERVER_NAME = $_SERVER['SERVER_NAME'] ? $_SERVER['SERVER_NAME'] : gethostname();
define('wsdl_AMDA', "http://".$SERVER_NAME.APACHE_ALIAS."public/wsdl/Methods_AMDA.wsdl");
/*-------------------END WEB SERVICES section ---------*/
// AKKA - KERNELBIN is now the new kernel bin dir
define('KERNELBIN',NEWKERNEL_INSTALL_DIR.'bin/');
putenv("LD_LIBRARY_PATH=".SYS_LIBS.":".DDLIB.":".CEFLIB.":".CDFLIB);
putenv("PATH=./:".DDBIN.":".SYS_BIN.":".IHM_SRC_DIR."php/bin");
putenv("DDPATH=".DDRES_DIR);
// PHP classes
define('XMLPATH', IHM_SRC_DIR.'php/XML/');
define('CLASSPATH', IHM_SRC_DIR.'php/classes/');
define('OLD_CLASSPATH', IHM_SRC_DIR.'php/old_amda/');
set_include_path(".:".CLASSPATH.":".OLD_CLASSPATH);
if (!function_exists('__autoload'))
{
function __autoload($class_name) {
require_once $class_name . '.php';
}
}
global $API;
$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),
'getAsciiFile'=>array('len'=>1),
'getTmpObject'=>array('len'=>3),
'getUploadedObject'=>array('len'=>3),
'getMyParamInfo'=>array('len'=>1),
'deleteObject'=>array('len'=>1),
'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),
'loadTTIntervals'=>array('len'=>1),
'saveTTCacheIntervalsInTT'=>array('len'=>1),
'initTTCache'=>array ('len'=>2),
'initTTCacheFromTT'=>array('len'=>2),
'initForChart'=>array('len'=>4),
'initTTCacheFromTmpObject'=>array('len'=>3),
'initTTCacheFromUploadedFile'=>array('len'=>2),
'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)
)
)
);
?>