category | Zend |
---|---|
package | Zend_TimeSync |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
__construct(string|array $target= null
, string $alias= null
) : object
string
array
string
object
addServer(string|array $target, string $alias = null
)
Server should be a single string representation of a timeserver, or a structured array listing multiple timeservers.
If you provide an array of timeservers in the $target variable, $alias will be ignored. you can enter these as the array key in the provided array, which should be structured as follows:
$example = array(
'server_a' => 'ntp://127.0.0.1',
'server_b' => 'ntp://127.0.0.1:123',
'server_c' => 'ntp://[2000:364:234::2.5]',
'server_d' => 'ntp://[2000:364:234::2.5]:123'
);
If no port number has been suplied, the default matching port number will be used.
Supported protocols are:
string
array
string
\Zend_TimeSync_Exception |
---|
getDate(\Zend_Locale $locale = null
) : object
If there are multiple servers listed, this method will act as a facade and will try to return the date from the first server that returns a valid result.
\Zend_Locale
\Zend_TimeSync_Exception |
---|
object
getInfo() : array
array
getIterator() : \ArrayObject
\ArrayObject
getOptions(string $key = null
) : mixed
string
\Zend_TimeSync_Exception |
---|
mixed
getServer(string|integer $alias = null
) : object
string
integer
\Zend_TimeSync_Exception |
---|
object
setOptions(array $options)
This will replace any currently defined options.
array
setServer(string|integer $alias)
string
integer
\Zend_TimeSync_Exception |
---|
_addServer(string|array $target, string $alias)
string
array
string
$_allowedSchemes : array
array('Ntp', 'Sntp')
$_current : object
$_timeservers : array
array()
DEFAULT_PROTOCOL = 'Ntp'