Commit efe03f29283947d6ceaef61c2b967b12d47ed213

Authored by Benjamin Renard
1 parent 86dadb0d
Exists in SpeasyGet

Fix config for speasy proxy data dir

php/RemoteDataCenter/SPEASYClientClass.php
... ... @@ -16,12 +16,12 @@ class SPEASYClientClass
16 16  
17 17 public function monitor()
18 18 {
19   - if (!defined('SpeasyProxyData')) {
20   - echo '[ERROR] Missing SpeasyProxyData in config'.PHP_EOL;
  19 + if (!defined('SPEASY_PROXY_DATA')) {
  20 + echo '[ERROR] Missing SPEASY_PROXY_DATA in config'.PHP_EOL;
21 21 return FALSE;
22 22 }
23   - if (!file_exists(SpeasyProxyData.$this->baseID."/base.xml")) {
24   - echo '[ERROR] Cannot retrieve Speasy base definition for '.$this->baseID.PHP_EOL;
  23 + if (!file_exists(SPEASY_PROXY_DATA.$this->baseID."/base.xml")) {
  24 + echo '[ERROR] Cannot retrieve Speasy base definition for '.$this->baseID." - ".SPEASY_PROXY_DATA.PHP_EOL;
25 25 return FALSE;
26 26 }
27 27 return TRUE;
... ... @@ -35,7 +35,7 @@ class SPEASYClientClass
35 35 $dom->preserveWhiteSpace = FALSE;
36 36  
37 37 $node = NULL;
38   - if ($dom->load(SpeasyProxyData.$this->baseID."/base.xml")) {
  38 + if ($dom->load(SPEASY_PROXY_DATA.$this->baseID."/base.xml")) {
39 39 $nodeBase = $dom->getElementsByTagName('dataCenter')->item(0);
40 40 $node = $xmlDom->importNode($nodeBase, true);
41 41 }
... ... @@ -50,16 +50,16 @@ class SPEASYClientClass
50 50 $dom->preserveWhiteSpace = FALSE;
51 51  
52 52 $node = NULL;
53   - if ($dom->load(SpeasyProxyData.$this->baseID."/base.xml")) {
  53 + if ($dom->load(SPEASY_PROXY_DATA.$this->baseID."/base.xml")) {
54 54 $xpath = new DOMXPath($dom);
55 55 $params = $xpath->query("//parameter");
56 56  
57 57 foreach ($params as $param)
58 58 {
59 59 $paramId = $param->getAttribute('xml:id');
60   - if (is_file(SpeasyProxyData.$this->baseID."/PARAMS/".$paramId.".xml")) {
  60 + if (is_file(SPEASY_PROXY_DATA.$this->baseID."/PARAMS/".$paramId.".xml")) {
61 61 if (!is_link(PARAMS_LOCALDB_DIR.$paramId.".xml")) {
62   - if (!symlink(SpeasyProxyData.$this->baseID."/PARAMS/".$paramId.".xml", PARAMS_LOCALDB_DIR.$paramId.".xml")) {
  62 + if (!symlink(SPEASY_PROXY_DATA.$this->baseID."/PARAMS/".$paramId.".xml", PARAMS_LOCALDB_DIR.$paramId.".xml")) {
63 63 echo "[ERROR] Cannot create symbolic link for ".$paramId.PHP_EOL;
64 64 }
65 65 }
... ...
php/classes/UserMgr.php
... ... @@ -462,8 +462,10 @@ class UserMgr
462 462 */
463 463 else
464 464 {
465   - $center = new $baseId();
  465 + $center = new $baseId();
466 466 $centerNode = $center->makeCenterNode($this->paramMgr->xmlDom);
  467 + if (!isset($centerNode))
  468 + return NULL;
467 469 $centerNode->setAttribute('available', TRUE);
468 470 }
469 471  
... ...