Commit 41fbf0bddfd0eff7466dac33d0c64f22449d01cb
1 parent
f6e7bb24
Exists in
master
and in
110 other branches
copy base.xml, update only
Showing
1 changed file
with
12 additions
and
3 deletions
Show diff stats
php/RemoteDataCenter/getRemoteDDBaseProxies.php
... | ... | @@ -47,12 +47,13 @@ |
47 | 47 | |
48 | 48 | $basesRemote = $basesDomRemote->getElementsByTagName("dataCenter"); |
49 | 49 | foreach ($basesRemote as $baseRemote) { |
50 | + | |
50 | 51 | $baseId = $baseRemote->getAttribute("xml:id"); |
51 | - | |
52 | + $baseDir = DATAPATH."/RemoteData/$baseId"; | |
53 | + $baseDirRemote = DDSERVICE."/BASE/INFO/bases/$baseId"; | |
54 | + | |
52 | 55 | // add remote base if it doesn't exist |
53 | 56 | if (!$basesDom->getElementById($baseId)) { |
54 | - $baseDir = DATAPATH."/RemoteData/$baseId"; | |
55 | - $baseDirRemote = DDSERVICE."/BASE/INFO/bases/$baseId"; | |
56 | 57 | if (!is_dir($baseDir)) mkdir($baseDir, 0775, true); |
57 | 58 | chmod($baseDir,0775); |
58 | 59 | if (!copy("$baseDirRemote/base.xml", "$baseDir/base.xml")) { |
... | ... | @@ -67,6 +68,14 @@ |
67 | 68 | $center->makeAllParams(); |
68 | 69 | } |
69 | 70 | } |
71 | + }// just copy base xml | |
72 | + else { | |
73 | + if (!copy("$baseDirRemote/base.xml", "$baseDir/base.xml")) { | |
74 | + echo "Cannot copy base.xml for $baseId".PHP_EOL; | |
75 | + } | |
76 | + else { | |
77 | + echo "Copied base.xml for $baseId".PHP_EOL; | |
78 | + } | |
70 | 79 | } |
71 | 80 | } |
72 | 81 | } |
... | ... |