262 $leap = ($binary[
'flags'] & 0xc0) >> 6;
265 $this->_info[
'leap'] =
'0 - no warning';
269 $this->_info[
'leap'] =
'1 - last minute has 61 seconds';
273 $this->_info[
'leap'] =
'2 - last minute has 59 seconds';
277 $this->_info[
'leap'] =
'3 - not syncronised';
286 $this->_info[
'version'] = ($binary[
'flags'] & 0x38) >> 3;
295 $mode = ($binary[
'flags'] & 0x07);
298 $this->_info[
'mode'] =
'symetric active';
302 $this->_info[
'mode'] =
'symetric passive';
306 $this->_info[
'mode'] =
'client';
310 $this->_info[
'mode'] =
'server';
314 $this->_info[
'mode'] =
'broadcast';
318 $this->_info[
'mode'] =
'reserved';
322 $ntpserviceid =
'Unknown Stratum ' . $binary[
'stratum'] .
' Service';
329 $refid = strtoupper($binary[
'referenceid']);
330 switch($binary[
'stratum']) {
332 if (substr($refid, 0, 3) ===
'DCN') {
333 $ntpserviceid =
'DCN routing protocol';
334 }
else if (substr($refid, 0, 4) ===
'NIST') {
335 $ntpserviceid =
'NIST public modem';
336 }
else if (substr($refid, 0, 3) ===
'TSP') {
337 $ntpserviceid =
'TSP time protocol';
338 }
else if (substr($refid, 0, 3) ===
'DTS') {
339 $ntpserviceid =
'Digital Time Service';
344 if (substr($refid, 0, 4) ===
'ATOM') {
345 $ntpserviceid =
'Atomic Clock (calibrated)';
346 }
else if (substr($refid, 0, 3) ===
'VLF') {
347 $ntpserviceid =
'VLF radio';
348 }
else if ($refid ===
'CALLSIGN') {
349 $ntpserviceid =
'Generic radio';
350 }
else if (substr($refid, 0, 4) ===
'LORC') {
351 $ntpserviceid =
'LORAN-C radionavigation';
352 }
else if (substr($refid, 0, 4) ===
'GOES') {
353 $ntpserviceid =
'GOES UHF environment satellite';
354 }
else if (substr($refid, 0, 3) ===
'GPS') {
355 $ntpserviceid =
'GPS UHF satellite positioning';
360 $ntpserviceid = ord(substr($binary[
'referenceid'], 0, 1));
361 $ntpserviceid .=
'.';
362 $ntpserviceid .= ord(substr($binary[
'referenceid'], 1, 1));
363 $ntpserviceid .=
'.';
364 $ntpserviceid .= ord(substr($binary[
'referenceid'], 2, 1));
365 $ntpserviceid .=
'.';
366 $ntpserviceid .= ord(substr($binary[
'referenceid'], 3, 1));
370 $this->_info[
'ntpid'] = $ntpserviceid;
377 switch($binary[
'stratum']) {
379 $this->_info[
'stratum'] =
'undefined';
383 $this->_info[
'stratum'] =
'primary reference';
387 $this->_info[
'stratum'] =
'secondary reference';
398 $this->_info[
'rootdelay'] = $binary[
'rootdelay'];
406 $this->_info[
'rootdispersion'] = $binary[
'rootdispersion'];
415 $this->_info[
'roundtrip'] = $binary[
'receivestamp'];
416 $this->_info[
'roundtrip'] -= $binary[
'originatestamp'];
417 $this->_info[
'roundtrip'] -= $binary[
'transmitstamp'];
418 $this->_info[
'roundtrip'] += $binary[
'clientreceived'];
419 $this->_info[
'roundtrip'] /= 2;
422 $this->_info[
'offset'] = $binary[
'receivestamp'];
423 $this->_info[
'offset'] -= $binary[
'originatestamp'];
424 $this->_info[
'offset'] += $binary[
'transmitstamp'];
425 $this->_info[
'offset'] -= $binary[
'clientreceived'];
426 $this->_info[
'offset'] /= 2;
427 $time = (
time() - $this->_info[
'offset']);
if($exist=($block->getProductCollection() && $block->getProductCollection() ->getSize())) $mode