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
Protocol.php
Go to the documentation of this file.
1
<?php
30
abstract
class
Zend_TimeSync_Protocol
31
{
37
protected
$_socket
;
38
44
protected
$_exceptions
;
45
51
protected
$_timeserver
;
52
58
protected
$_info
= array();
59
65
abstract
protected
function
_prepare
();
66
72
abstract
protected
function
_read
();
73
80
abstract
protected
function
_write
(
$data
);
81
88
abstract
protected
function
_extract
(
$data
);
89
96
protected
function
_connect
()
97
{
98
$socket = @
fsockopen
($this->_timeserver, $this->_port, $errno, $errstr,
99
Zend_TimeSync::$options
[
'timeout'
]);
100
if
($socket ===
false
) {
101
throw
new
Zend_TimeSync_Exception
(
'could not connect to '
.
102
"'$this->_timeserver' on port '$this->_port', reason: '$errstr'"
);
103
}
104
105
$this->_socket = $socket;
106
}
107
113
protected
function
_disconnect
()
114
{
115
@fclose($this->_socket);
116
$this->_socket =
null
;
117
}
118
124
public
function
getInfo
()
125
{
126
if
(empty($this->_info) ===
true
) {
127
$this->
_write
($this->
_prepare
());
128
$timestamp = $this->
_extract
($this->
_read
());
129
}
130
131
return
$this->_info
;
132
}
133
140
public
function
getDate
($locale =
null
)
141
{
142
$this->
_write
($this->
_prepare
());
143
$timestamp = $this->
_extract
($this->
_read
());
144
145
$date =
new
Zend_Date
($this,
null
, $locale);
146
return
$date;
147
}
148
}
Zend_TimeSync_Protocol\getDate
getDate($locale=null)
Definition:
Protocol.php:140
Zend_TimeSync_Exception
Definition:
Exception.php:35
Zend_TimeSync_Protocol\$_socket
$_socket
Definition:
Protocol.php:37
Zend_TimeSync_Protocol\_connect
_connect()
Definition:
Protocol.php:96
Magento\Framework\Filesystem\Driver\fsockopen
fsockopen(&$errorNumber, &$errorMessage)
Definition:
http_mock.php:37
Zend_TimeSync_Protocol\_write
_write($data)
Zend_TimeSync_Protocol\$_info
$_info
Definition:
Protocol.php:58
Zend_TimeSync_Protocol\$_exceptions
$_exceptions
Definition:
Protocol.php:44
Zend_TimeSync_Protocol\_prepare
_prepare()
Zend_TimeSync_Protocol
Definition:
Protocol.php:30
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Zend_TimeSync_Protocol\getInfo
getInfo()
Definition:
Protocol.php:124
Zend_TimeSync_Protocol\_disconnect
_disconnect()
Definition:
Protocol.php:113
Zend_Date
Zend_TimeSync_Protocol\$_timeserver
$_timeserver
Definition:
Protocol.php:51
Zend_TimeSync_Protocol\_read
_read()
Zend_TimeSync\$options
static $options
Definition:
TimeSync.php:72
Zend_TimeSync_Protocol\_extract
_extract($data)