Blame view

Client/getTaoStop.php 672 Bytes
c58abd8b   Elena.Budnik   Client
1
2
<?php

e6a132d3   Elena.Budnik   work
3
4
5
6
7
8
9
  $taoroot = getenv("TAOROOT");
 
  // Tao stop from regular OMNI Input
  if (getenv("sw_vi") == 'ace_swepam_real')
    $taopath = $taoroot.'/SW';
  else 
    $taopath = getenv('TAOPATH');
c58abd8b   Elena.Budnik   Client
10

e6a132d3   Elena.Budnik   work
11
  $file = $taopath.'/sw_info.xml';
c58abd8b   Elena.Budnik   Client
12
13
14
15
16
17
18
19
20
21
  if (!file_exists($file)) exit('ERROR');

  $xml = new DomDocument('1.0');
  if (!$xml->load($file)) exit('ERROR');

  $time = $xml->getElementsByTagName('GlobalStop');
  if ($time->length == 0) exit('ERROR');

  $timeValue = $time->item(0)->nodeValue;

e6a132d3   Elena.Budnik   work
22
23
24
25
  // if new data or error set take this year
  if ($timeValue == '' || $timeValue == '1970-01-01T::.Z')
    $timeValue=date('Y',time()).'-01-01T00:00:00.000Z';

c58abd8b   Elena.Budnik   Client
26
27
28
  exit($timeValue);

?>