Commit 9e3cbd95f704cb33bba6051e7bf72e63fe843672
1 parent
cb2fbb88
Exists in
master
and in
111 other branches
merge AMDA_IHM AMDA_Integration
Showing
2 changed files
with
41 additions
and
84 deletions
Show diff stats
php/classes/AmdaAction.php
... | ... | @@ -2,10 +2,8 @@ |
2 | 2 | /** |
3 | 3 | * @class AmdaAction |
4 | 4 | * @version $Id: AmdaAction.php 2976 2015-07-01 15:05:40Z benjamin $ |
5 | - * | |
5 | + * @brief | |
6 | 6 | */ |
7 | - | |
8 | - | |
9 | 7 | class AmdaAction |
10 | 8 | { |
11 | 9 | private $xmlFiles = array('localParam' => 'LocalParams.xml', 'remoteParam' => 'RemoteParams.xml', |
... | ... | @@ -483,14 +481,7 @@ class AmdaAction |
483 | 481 | else |
484 | 482 | { |
485 | 483 | $restricted = FALSE; |
486 | -// if ($child->tagName == 'dataCenter') | |
487 | -// { | |
488 | -// $restricted = ($child->getAttribute('available') != "1"); | |
489 | -// } | |
490 | -// | |
491 | - if ($id == 'CDAWEB' || $id == 'THEMIS'|| $id == 'MAPSKP') | |
492 | - $restricted = FALSE; | |
493 | - | |
484 | + | |
494 | 485 | if ($child->tagName == 'dataset') |
495 | 486 | { |
496 | 487 | $nonavailable = ($child->getAttribute('disabled')); |
... | ... | @@ -683,8 +674,7 @@ class AmdaAction |
683 | 674 | case 'request' : |
684 | 675 | $objectMgr = new RequestMgr($nodeType); |
685 | 676 | break; |
686 | - case 'bkgWorks' : | |
687 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | |
677 | + case 'bkgWorks' : | |
688 | 678 | return $this->executeRequest($id, FunctionTypeEnumClass::PROCESSGETINFO); |
689 | 679 | break; |
690 | 680 | case 'myData' : |
... | ... | @@ -722,7 +712,6 @@ class AmdaAction |
722 | 712 | $obj->id = substr($obj->id,strlen('alias_')); |
723 | 713 | break; |
724 | 714 | case 'bkgWorks' : |
725 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | |
726 | 715 | return $this->executeRequest($obj, FunctionTypeEnumClass::PROCESSDELETE); |
727 | 716 | |
728 | 717 | case 'myData' : |
... | ... | @@ -857,8 +846,7 @@ class AmdaAction |
857 | 846 | */ |
858 | 847 | public function getJobs() |
859 | 848 | { |
860 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | |
861 | - $obj = (object) array(); | |
849 | + $obj = (object) array(); | |
862 | 850 | return $this->executeRequest($obj, FunctionTypeEnumClass::PROCESSRUNNINGINFO); |
863 | 851 | } |
864 | 852 | |
... | ... | @@ -906,7 +894,7 @@ class AmdaAction |
906 | 894 | } |
907 | 895 | |
908 | 896 | private function executeRequest($obj, $function) |
909 | - { | |
897 | + { | |
910 | 898 | // Check user if access to DD Server and / or possible 'space consuming' action |
911 | 899 | if ( $function == FunctionTypeEnumClass::PARAMS || |
912 | 900 | $function == FunctionTypeEnumClass::ACTION || |
... | ... | @@ -917,7 +905,6 @@ class AmdaAction |
917 | 905 | } |
918 | 906 | |
919 | 907 | $requestManager = new RequestManagerClass(); |
920 | - | |
921 | 908 | try { |
922 | 909 | $res = $requestManager->runIHMRequest($this->user, !empty($res['userHost']) ? $res['userHost'] : NULL, $function, $obj); |
923 | 910 | } catch (Exception $e) { |
... | ... | @@ -932,8 +919,6 @@ class AmdaAction |
932 | 919 | */ |
933 | 920 | public function execute($node, $obj) |
934 | 921 | { |
935 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | |
936 | - | |
937 | 922 | // just convert TT / Catalog |
938 | 923 | if ($obj->nodeType == "download" && $obj->downloadSrc == "1") |
939 | 924 | return $this->executeRequest($obj, FunctionTypeEnumClass::TTCONVERT); |
... | ... | @@ -953,7 +938,6 @@ class AmdaAction |
953 | 938 | */ |
954 | 939 | public function compilParam($obj) |
955 | 940 | { |
956 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | |
957 | 941 | return $this->executeRequest($obj, FunctionTypeEnumClass::PARAMSGEN); |
958 | 942 | } |
959 | 943 | |
... | ... | @@ -962,7 +946,6 @@ class AmdaAction |
962 | 946 | */ |
963 | 947 | public function compilParamDelete($obj) |
964 | 948 | { |
965 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | |
966 | 949 | $res = $this->checkUser($obj); |
967 | 950 | |
968 | 951 | if (!$res['success']) |
... | ... | @@ -981,7 +964,6 @@ class AmdaAction |
981 | 964 | |
982 | 965 | public function killPlotRequest() |
983 | 966 | { |
984 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | |
985 | 967 | return $this->executeRequest((object) array('nodeType' => 'killplot'), FunctionTypeEnumClass::PARAMS); |
986 | 968 | } |
987 | 969 | |
... | ... | @@ -1323,7 +1305,6 @@ class AmdaAction |
1323 | 1305 | public function cleanUserWS() |
1324 | 1306 | { |
1325 | 1307 | $this->rrmdir(USERDIR.'DOWNLOAD.TEMP'); |
1326 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | |
1327 | 1308 | IHMConfigClass::setUserName($this->user); |
1328 | 1309 | |
1329 | 1310 | // delete impex params and data |
... | ... | @@ -1359,7 +1340,6 @@ class AmdaAction |
1359 | 1340 | |
1360 | 1341 | public function interactivePlot($obj, $multiPlotState) |
1361 | 1342 | { |
1362 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | |
1363 | 1343 | $inputobj = (Object)array( |
1364 | 1344 | 'action' => $obj, |
1365 | 1345 | 'multiPlotState' => $multiPlotState |
... | ... | @@ -1369,7 +1349,6 @@ class AmdaAction |
1369 | 1349 | |
1370 | 1350 | public function getParamPlotInit($obj) |
1371 | 1351 | { |
1372 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | |
1373 | 1352 | // IMPEX param |
1374 | 1353 | if (preg_match("#^spase___IMPEX_#",$obj->paramId)) |
1375 | 1354 | $type = 'impex_plot_init'; |
... | ... | @@ -1385,7 +1364,6 @@ class AmdaAction |
1385 | 1364 | |
1386 | 1365 | public function getParamInfo($obj) |
1387 | 1366 | { |
1388 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | |
1389 | 1367 | // IMPEX param |
1390 | 1368 | if (preg_match("#^spase___IMPEX_#",$obj->paramId)) |
1391 | 1369 | $type = 'impex_param_info'; |
... | ... | @@ -1437,8 +1415,6 @@ class AmdaAction |
1437 | 1415 | |
1438 | 1416 | public function getRequestByProcessId($obj) |
1439 | 1417 | { |
1440 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | |
1441 | - | |
1442 | 1418 | return $this->executeRequest($obj->processId, FunctionTypeEnumClass::PROCESSGETREQUEST); |
1443 | 1419 | } |
1444 | 1420 | } |
... | ... |
php/config.php
... | ... | @@ -2,49 +2,31 @@ |
2 | 2 | /** |
3 | 3 | * @file config.php |
4 | 4 | * @version $Id: config.php 2368 2014-05-21 08:46:23Z elena $ |
5 | - * | |
6 | 5 | */ |
7 | 6 | |
8 | 7 | /* |
9 | - * ob_start | |
10 | - * This function will turn output buffering on. | |
11 | - * While output buffering is active no output is sent from the script (other than headers), | |
12 | - * instead the output is stored in an internal buffer. | |
13 | - * The contents of this internal buffer may be copied into a string variable using ob_get_contents(). | |
14 | - * To output what is stored in the internal buffer, use ob_end_flush(). | |
15 | - * Alternatively, ob_end_clean() will silently discard the buffer contents. | |
16 | -*/ | |
17 | -// ob_start(); | |
18 | - | |
19 | -/* | |
20 | 8 | * Installation-dependent settings |
21 | 9 | */ |
22 | 10 | require_once 'my_config.php'; |
23 | 11 | |
24 | -if (is_file('amda_version.php')) | |
25 | - require_once 'amda_version.php'; | |
12 | +error_reporting(E_ERROR); | |
26 | 13 | |
27 | -if (is_file('errors.php')) | |
28 | - require_once 'errors.php'; | |
14 | +if (is_file('amda_version.php')) require_once 'amda_version.php'; | |
15 | +if (is_file('errors.php')) require_once 'errors.php'; | |
29 | 16 | |
30 | -/*----------------------- SYSTEM config section --------*/ | |
31 | -if (!defined('PHP_VERSION_ID')) | |
32 | -{ | |
17 | +// SYSTEM config section | |
18 | +if (!defined('PHP_VERSION_ID')) { | |
33 | 19 | $version = explode('.', PHP_VERSION); |
34 | 20 | define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2])); |
35 | 21 | } |
36 | - | |
37 | -if (!defined('MAGIC_FILE')) | |
38 | - define('MAGIC_FILE','/usr/share/misc/magic'); | |
39 | - | |
22 | +if (!defined('MAGIC_FILE')) define('MAGIC_FILE','/usr/share/misc/magic'); | |
40 | 23 | date_default_timezone_set('UTC'); |
41 | -/*-----------------------END SYSTEM config section --------*/ | |
42 | 24 | |
43 | -/*----------------------- GUESTS LOGIN section --------*/ | |
44 | -define("MaxGuests", 10); // Max Guests number | |
25 | +// GUESTS LOGIN section | |
26 | +define("MaxGuests", 10); // Max Guests number | |
45 | 27 | define("GuestSessionDuration", 300); //300 minutes |
46 | -define("MaxGuestTimeInterval", 10); // days | |
47 | -/*-----------------------END GUESTS LOGIN section --------*/ | |
28 | +define("MaxGuestTimeInterval", 10); // days | |
29 | + | |
48 | 30 | |
49 | 31 | // user WS size limit |
50 | 32 | define('DISK_QUOTA_standard', 1024*1024*200); // 200MB |
... | ... | @@ -53,21 +35,18 @@ define('MAX_FILE_INDEX_TO_SHOW', 100); |
53 | 35 | // private key used to be considerate as a trust client for some functions of DD web service |
54 | 36 | define('DDSERVICE_PRIVATEKEY','!%p856Dc'); |
55 | 37 | |
56 | -define('IMPEX_INTERVAL_LIMIT', 86400); // one day for impex request | |
57 | 38 | |
58 | -/*----------------------- BATCH JOBS section --------*/ | |
59 | -define('JOBTIMEOUT', '1'); // one cycle secs to sleep to allow job be executed | |
60 | -define('PLOT_CYCLES_NUMBER', 500); // cycles number for PNG | |
61 | -define('JOB_CYCLES_NUMBER', 5); // cycles number for all the jobs | |
39 | +// BATCH JOBS section | |
40 | +//define('JOBTIMEOUT', '1'); // one cycle secs to sleep to allow job be executed | |
41 | +//define('PLOT_CYCLES_NUMBER', 500); // cycles number for PNG | |
42 | +//define('JOB_CYCLES_NUMBER', 5); // cycles number for all the jobs | |
62 | 43 | //define('TIMEOUT', '100'); //TODO secs wait before job is killed OR 'max_execution_time' - kill automatic? |
63 | 44 | |
64 | -/*-----------------------END BATCH JOBS section --------*/ | |
65 | - | |
66 | 45 | // EPN-TAP services |
67 | 46 | define('EPNTAP_APIS','http://voparis-tap.obspm.fr/__system__/tap/run/tap/sync'); |
68 | 47 | define('EPNTAP_AMDA','http://cdpp-epntap.irap.omp.eu/__system__/tap/run/tap/sync'); |
69 | 48 | |
70 | -/*----------------------- PHP run-time settings --------*/ | |
49 | +// PHP run-time settings | |
71 | 50 | ini_set('memory_limit',128000000); |
72 | 51 | ini_set('max_execution_time',600); // max PHP execution |
73 | 52 | ini_set('default_socket_timeout', 600); //TODO if this is needed ? IMPEX LONG DURATION WEBSERVICES |
... | ... | @@ -77,7 +56,6 @@ ini_set('user_agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:7.0) Gecko/201 |
77 | 56 | // ini_set('upload_max_filesize',100000000); |
78 | 57 | // ini_set('post_max_size',1050000000); |
79 | 58 | |
80 | -/*-----------------------END PHP run-time settings --------*/ | |
81 | 59 | |
82 | 60 | // General Info dirs |
83 | 61 | define('DATAPATH', IHM_SRC_DIR.'generic_data/'); |
... | ... | @@ -97,10 +75,11 @@ define('specialGrpsXml',SpecialSettingsDir.'Groups.xml'); |
97 | 75 | define('specialSettingsXml',SpecialSettingsDir.'Settings.xml'); |
98 | 76 | |
99 | 77 | //Help info dirs |
100 | -define('HELPPATH', IHM_SRC_DIR."help/"); | |
78 | +define('HELPPATH', IHM_SRC_DIR."help/"); | |
101 | 79 | |
102 | -// IMPEX special files | |
80 | +// IMPEX section | |
103 | 81 | define('SimuTargetsXml', DATAPATH.'SimuTemplate/TargetsSimu.xml'); |
82 | +define('IMPEX_INTERVAL_LIMIT', 86400); // one day for impex request | |
104 | 83 | |
105 | 84 | // Root User dir : All user dirs are defined in UserMgr.php |
106 | 85 | define('USERPATH', IHM_SRC_DIR.'data/'); |
... | ... | @@ -108,18 +87,15 @@ define('USERPATH', IHM_SRC_DIR.'data/'); |
108 | 87 | // Shared dir |
109 | 88 | define('SHAREDPATH', IHM_SRC_DIR.'shared_data/'); |
110 | 89 | |
111 | -/*------------------- WEB SERVICES section ---------*/ | |
90 | +// WEB SERVICES section | |
112 | 91 | define('WSRESULT', USERPATH.'WSRESULT/'); // Web Services result directory |
113 | 92 | define('wsResultsXml',WSRESULT.'WSresults.xml'); // Web Service result file |
114 | - | |
115 | 93 | define('plotsXml', IHM_SRC_DIR.'public/WebServices/XML/AmdaPlots.xml'); // Web Service getPlot : list of parameters to plot |
116 | 94 | |
117 | 95 | // Web Service servers WSDL : $_SERVER['SERVER_NAME'] (par apache) gethostname() (par command) |
118 | 96 | $SERVER_NAME = $_SERVER['SERVER_NAME'] ? $_SERVER['SERVER_NAME'] : gethostname(); |
119 | - | |
120 | 97 | define('webAlias',"http://".$SERVER_NAME.APACHE_ALIAS); |
121 | 98 | define('wsdl_AMDA', webAlias."public/wsdl/Methods_AMDA.wsdl"); |
122 | -/*-------------------END WEB SERVICES section ---------*/ | |
123 | 99 | |
124 | 100 | // AKKA - KERNELBIN is now the new kernel bin dir |
125 | 101 | define('KERNELBIN',NEWKERNEL_INSTALL_DIR.'bin/'); |
... | ... | @@ -128,21 +104,26 @@ putenv("LD_LIBRARY_PATH=".SYS_LIBS.":".DDLIB.":".CEFLIB.":".CDFLIB); |
128 | 104 | putenv("PATH=./:".DDBIN.":".SYS_BIN.":".IHM_SRC_DIR."php/bin"); |
129 | 105 | |
130 | 106 | putenv("DDPATH=".DDRES_DIR); |
131 | - | |
132 | -// PHP classes | |
133 | 107 | define('XMLPATH', IHM_SRC_DIR.'php/XML/'); |
134 | -define('CLASSPATH', IHM_SRC_DIR.'php/classes/'); | |
135 | -define('REMOTE_CLASSPATH', IHM_SRC_DIR.'php/RemoteDataCenter/'); | |
136 | -define('OLD_CLASSPATH', IHM_SRC_DIR.'php/old_amda/'); | |
137 | 108 | |
138 | -set_include_path(".:".CLASSPATH.":".REMOTE_CLASSPATH.":".OLD_CLASSPATH); | |
109 | +// PHP classes | |
139 | 110 | |
140 | -if (!function_exists('__autoload')) | |
141 | -{ | |
142 | - function __autoload($class_name) { | |
143 | - require_once $class_name . '.php'; | |
144 | - } | |
145 | -} | |
111 | +// define('CLASSPATH', IHM_SRC_DIR.'php/classes'); | |
112 | +// define('REMOTE_CLASSPATH', IHM_SRC_DIR.'php/RemoteDataCenter'); | |
113 | +// define('OLD_CLASSPATH', IHM_SRC_DIR.'php/old_amda'); | |
114 | +// define('INTEGRATION_CLASSPATH', INTEGRATION_BASE_PATH.'src'); | |
115 | +// define('CONFIG_CLASSPATH', INTEGRATION_BASE_PATH.'src/InputOutput/IHMImpl/Config'); | |
116 | +// | |
117 | +// set_include_path(".:".CLASSPATH.":".REMOTE_CLASSPATH.":".INTEGRATION_CLASSPATH.":".CONFIG_CLASSPATH.":".OLD_CLASSPATH); | |
118 | +// | |
119 | +// if (!function_exists('__autoload')) | |
120 | +// { | |
121 | +// function __autoload($class_name) { | |
122 | +// require_once $class_name . '.php'; | |
123 | +// } | |
124 | +// } | |
125 | + | |
126 | +require_once(INTEGRATION_BASE_PATH.'src/amdaintegration_autoload.php'); | |
146 | 127 | |
147 | 128 | global $API; |
148 | 129 | $API = array( |
... | ... |