Zend Framework
1.12
|
Public Member Functions | |
__construct ($timeserver, $port=123) | |
NTP class constructor, sets the timeserver and port number. | |
![]() | |
getInfo () | |
Return information sent/returned from the timeserver. | |
getDate ($locale=null) | |
Query this timeserver without using the fallback mechanism. | |
Protected Member Functions | |
_prepare () | |
Prepare local timestamp for transmission in our request packet. | |
_getInteger ($input) | |
Calculates a 32bit integer. | |
_getFloat ($input) | |
Calculates a 32bit signed fixed point number. | |
_getTimestamp ($input) | |
Calculates a 64bit timestamp. | |
_read () | |
Reads the data returned from the timeserver. | |
_write ($data) | |
Sends the NTP packet to the server. | |
_extract ($binary) | |
Extracts the binary data returned from the timeserver. | |
![]() | |
_prepare () | |
Abstract method that prepares the data to send to the timeserver. | |
_read () | |
Abstract method that reads the data returned from the timeserver. | |
_write ($data) | |
Abstract method that writes data to to the timeserver. | |
_extract ($data) | |
Abstract method that extracts the binary data returned from the timeserver. | |
_connect () | |
Connect to the specified timeserver. | |
_disconnect () | |
Disconnects from the peer, closes the socket. | |
Protected Attributes | |
$_port = 123 | |
![]() | |
$_socket | |
$_exceptions | |
$_timeserver | |
$_info = array() | |
__construct | ( | $timeserver, | |
$port = 123 |
|||
) |
NTP class constructor, sets the timeserver and port number.
string | $timeserver | Adress of the timeserver to connect to |
integer | $port | (Optional) Port for this timeserver |
|
protected |
Extracts the binary data returned from the timeserver.
string | array | $binary | Data returned from the timeserver |
|
protected |
Calculates a 32bit signed fixed point number.
string | $input |
|
protected |
Calculates a 32bit integer.
string | $input |
|
protected |
Calculates a 64bit timestamp.
string | $input |
|
protected |
Prepare local timestamp for transmission in our request packet.
NTP timestamps are represented as a 64-bit fixed-point number, in seconds relative to 0000 UT on 1 January 1900. The integer part is in the first 32 bits and the fraction part in the last 32 bits
|
protected |
Reads the data returned from the timeserver.
This will return an array with binary data listing:
Zend_TimeSync_Exception | When timeserver can not be connected |
|
protected |
Sends the NTP packet to the server.
string | $data | Data to send to the timeserver |
|
protected |