Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
zendframework1
library
Zend
TimeSync
Sntp.php
Go to the documentation of this file.
1
<?php
25
#require_once 'Zend/TimeSync/Protocol.php';
26
35
class
Zend_TimeSync_Sntp
extends
Zend_TimeSync_Protocol
36
{
42
protected
$_port
= 37;
43
49
private
$_delay;
50
57
public
function
__construct
($timeserver, $port)
58
{
59
$this->_timeserver =
'udp://'
. $timeserver;
60
if
($port !==
null
) {
61
$this->_port = $port;
62
}
63
}
64
70
protected
function
_prepare
()
71
{
72
return
"\n"
;
73
}
74
80
protected
function
_read
()
81
{
82
$result
= fread($this->_socket, 49);
83
$this->_delay = (($this->_delay -
time
()) / 2);
84
85
return
$result
;
86
}
87
94
protected
function
_write
(
$data
)
95
{
96
$this->
_connect
();
97
$this->_delay =
time
();
98
fputs($this->_socket,
$data
);
99
}
100
107
protected
function
_extract
(
$result
)
108
{
109
$dec = hexdec(
'7fffffff'
);
110
$time = abs(($dec - hexdec(bin2hex(
$result
))) - $dec);
111
$time -= 2208988800;
112
// Socket delay
113
$time -= $this->_delay;
114
115
$this->_info[
'offset'
] = $this->_delay;
116
117
return
$time;
118
}
119
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Zend_TimeSync_Sntp
Definition:
Sntp.php:35
Zend_TimeSync_Protocol\_connect
_connect()
Definition:
Protocol.php:96
Magento\Setup\Model\Cron\time
time()
Definition:
ReadinessCheckTest.php:207
Zend_TimeSync_Sntp\_extract
_extract($result)
Definition:
Sntp.php:107
Zend_TimeSync_Sntp\_write
_write($data)
Definition:
Sntp.php:94
Zend_TimeSync_Sntp\__construct
__construct($timeserver, $port)
Definition:
Sntp.php:57
Zend_TimeSync_Protocol
Definition:
Protocol.php:30
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Zend_TimeSync_Sntp\_prepare
_prepare()
Definition:
Sntp.php:70
Zend_TimeSync_Sntp\$_port
$_port
Definition:
Sntp.php:42
Zend_TimeSync_Sntp\_read
_read()
Definition:
Sntp.php:80