API Documentation

TimeSync.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_TimeSync
version
$Id: TimeSync.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_TimeSync

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_TimeSync

Implements
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_TimeSync
Constants
DEFAULT_PROTOCOL
Properties
$_timeservers
$_current
$_allowedSchemes
$options
Methods
__construct
getIterator
addServer
setOptions
setServer
getOptions
getServer
getInfo
getDate
_addServer

Description

Constants

DEFAULT_PROTOCOL

 DEFAULT_PROTOCOL = 'Ntp'

Set the default timeserver protocol to "Ntp". This will be called when no protocol is specified

Details

value
Ntp

Properties

$_allowedSchemes

array $_allowedSchemes = 'array'

Allowed timeserver schemes

Details

$_allowedSchemes
array
visibility
protected
default
array
final
false
static
false

$_current

object $_current = ''

Holds a reference to the timeserver that is currently being used

Details

$_current
object
visibility
protected
default
final
false
static
false

$_timeservers

array $_timeservers = 'array'

Contains array of timeserver objects

Details

$_timeservers
array
visibility
protected
default
array
final
false
static
false

$options

array $options = 'array'

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

Details

$options
array
visibility
public
default
array
final
false
static
true

Methods

__construct

__construct( string|array $target = null, string $alias = null ) : object

Zend_TimeSync constructor

Arguments
$target
stringarray
- OPTIONAL single timeserver, or an array of timeservers.
$alias
string
- OPTIONAL an alias for this timeserver
Output
object
Details
visibility
public
final
false
static
false

_addServer

_addServer( string|array $target, string $alias ) :

Adds a timeserver object to the timeserver list

Arguments
$target
stringarray
- Single timeserver, or an array of timeservers.
$alias
string
- An alias for this timeserver
Details
visibility
protected
final
false
static
false

addServer

addServer( string|array $target, string $alias = null ) :

Add a timeserver or multiple timeservers

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: - ntp - sntp

Arguments
$target
stringarray
- Single timeserver, or an array of timeservers.
$alias
string
- OPTIONAL an alias for this timeserver
Details
visibility
public
final
false
static
false
throws

getDate

getDate( $locale $locale = null ) : object

Query the timeserver list using the fallback mechanism

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.

Arguments
$locale
$locale
- OPTIONAL locale
Output
object
Details
visibility
public
final
false
static
false
throws

getInfo

getInfo( ) : array

Returns information sent/returned from the current timeserver

Output
array
Details
visibility
public
final
false
static
false

getIterator

getIterator( ) : ArrayObject

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

Output
ArrayObject
Details
visibility
public
final
false
static
false

getOptions

getOptions( string $key = null ) : mixed

Returns the value to the option

Arguments
$key
string
- The option's identifier
Output
mixed
Details
visibility
public
final
false
static
true
throws

getServer

getServer( string|integer $alias = null ) : object

Return a specified timeserver by alias If no alias is given it will return the current timeserver

Arguments
$alias
stringinteger
- The alias from the timeserver to return
Output
object
Details
visibility
public
final
false
static
false
throws

setOptions

setOptions( array $options ) :

Sets the value for the given options

This will replace any currently defined options.

Arguments
$options
array
- An array of options to be set
Details
visibility
public
final
false
static
true

setServer

setServer( string|integer $alias ) :

Marks a nameserver as current

Arguments
$alias
stringinteger
- The alias from the timeserver to set as current
Details
visibility
public
final
false
static
false
throws
Documentation was generated by DocBlox.