Class Zend_TimeSync

Description

Implements interfaces:

  • IteratorAggregate (internal interface)

  • license: New BSD License
  • copyright: Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)

Located in /TimeSync.php (line 44)


	
			
Class Constant Summary
Variable Summary
 static array $options
 object $_current
Method Summary
 void addServer (mixed $server)
 Zend_TimeSync __construct ([mixed $server = array()], [array $options = array()])
 object get ([integer $flag = null])
 object getCurrent ()
 object getDate ([$locale $locale = false])
 array getInfo ()
 ArrayObject getIterator ()
 mixed getOption (integer $flag)
 void setCurrent ([integer $flag = null])
 void setOption (mixed $key, mixed $value)
 void setOptions ([array $options = array()])
 void _addServer (string $server)
Variables
static array $options = array(
'timeout' => 1
)
(line 88)

Configuration array, set using the constructor or using ::setOptions() or ::setOption()

  • access: public
array $_allowedSchemes = array(
'ntp',
'sntp'
)
(line 77)

Allowed timeserver schemes

  • access: protected
object $_current (line 70)

Holds a reference to the current timeserver being used

  • access: protected
array $_timeservers = array() (line 63)

Contains array of timeservers

  • access: protected
Methods
addServer (line 143)

Adds a timeserver to the server list

The $server parameter may be a string with a single timeserver, or an array listing multiple timeservers.

  • access: public
  • throws: Zend_TimeSync_Exception
void addServer (mixed $server)
  • mixed $server
Constructor __construct (line 114)

Zend_TimeSync constructor

The constructor takes one to two parameters. The first parameter is $server, which may be a single string representation for a timeserver, or a structured array for multiple timeservers.

Each server must be provided with a valid scheme, and may contain an optional port number. If no port number has been suplied, the default matching port number will be used.

Supported schemes are:

  • ntp
  • sntp
The second parameter is $options, and it is optional. If not specified, default options will be used.

  • access: public
Zend_TimeSync __construct ([mixed $server = array()], [array $options = array()])
  • mixed $server
  • array $options
get (line 234)

Receive a specified timeservers

  • access: public
  • throws: Zend_TimeSync_Exception
object get ([integer $flag = null])
  • integer $flag
getCurrent (line 249)

Returns the timeserver that is currently set

  • access: public
  • throws: Zend_TimeSync_Exception
object getCurrent ()
getDate (line 275)

Query the timeserver list using the fallback mechanism

  • access: public
  • throws: Zend_TimeSync_Exception
object getDate ([$locale $locale = false])
  • $locale $locale: optional locale
getInfo (line 263)

Returns information sent/returned from the current timeserver

  • access: public
array getInfo ()
getIterator (line 128)

getIterator() - return an iteratable object for use in foreach and the like, this completes the IteratorAggregate interface

  • access: public
ArrayObject getIterator ()

Implementation of:
IteratorAggregate::getIterator
getOption (line 218)

Returns the value to the option

  • access: public
  • throws: Zend_TimeSync_Exception
mixed getOption (integer $flag)
  • integer $flag
setCurrent (line 202)

Marks a nameserver as current

  • access: public
  • throws: Zend_TimeSync_Exception
void setCurrent ([integer $flag = null])
  • integer $flag
setOption (line 166)

Sets the value for a given option

This will replace any currently defined options.

  • access: public
  • throws: Zend_TimeSync_Exception
void setOption (mixed $key, mixed $value)
  • mixed $key
  • mixed $value
setOptions (line 184)

Sets the value for the given options

This will replace any currently defined options.

  • access: public
  • throws: Zend_TimeSync_Exception
void setOptions ([array $options = array()])
  • array $options
_addServer (line 298)

Adds a timeserver object to the timeserver list

  • access: protected
void _addServer (string $server)
  • string $server
Class Constants
DEFAULT_NTP_PORT = 123 (line 49)

The well-known NTP and SNTP port numbers

DEFAULT_SCHEME = 'ntp' (line 56)

Set the default timeserver scheme to "ntp". This will be called

when no, or an invalid scheme is specified

DEFAULT_SNTP_PORT = 37 (line 50)

Documentation generated on Thu, 18 Jan 2007 10:01:21 -0800 by phpDocumentor 1.3.1