PHP 클래스 Horde_Timezone, horde

This class is the central point to fetch timezone information from the timezone (Olson) database, parse it, cache it, and generate VTIMEZONE objects. Usage: $tz = new Horde_Timezone(); $tz->getZone('America/New_York')->toVtimezone()->exportVcalendar(); Documentation on the database file formats can be found at ftp://ftp.iana.org/tz/tz-how-to.html
저자: Jan Schneider ([email protected])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_links array Alias map of all Link entries.
$_months array List to map month descriptions used in the timezone database.
$_params array Any configuration parameters for this class.
$_rules array List of all Rule entries parsed into Horde_Timezone_Rule objects.
$_tmpfile string File location of the downloaded timezone database.
$_zones array List of all Zone entries parsed into Horde_Timezone_Zone objects.

공개 메소드들

메소드 설명
__construct ( array $params = [] ) Constructor.
getMonth ( string $month ) : integer Returns the month number of a month name.
getRule ( string $rule ) : Horde_Timezone_Rule Returns an object representing a set of named transition rules.
getZone ( string $zone ) : Horde_Timezone_Zone Returns an object representing an invidual timezone.

보호된 메소드들

메소드 설명
_download ( ) Downloads a timezone database.
_extractAndParse ( ) Unpacks the downloaded timezone database and parses all files.
_parse ( string $file ) Parses a file from the timezone database.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( array $params = [] )
$params array List of optional class parameters. Possible options: - location: (string) Location of the timezone database, defaults to ftp.iana.org/tz/tzdata-latest.tar.gz. - client: (Horde_Http_Client) A preconfigured HTTP client for downloading via HTTP. - temp: (string) Temporary directory. - cache: (Horde_Cache) A cache object. - cachettl: (integer) Cache lifetime in seconds, defaults to 7 days.

_download() 보호된 메소드

Downloads a timezone database.
protected _download ( )

_extractAndParse() 보호된 메소드

Unpacks the downloaded timezone database and parses all files.
protected _extractAndParse ( )

_parse() 보호된 메소드

Parses a file from the timezone database.
protected _parse ( string $file )
$file string A file location.

getMonth() 공개 정적인 메소드

Returns the month number of a month name.
public static getMonth ( string $month ) : integer
$month string A month name.
리턴 integer The month's number.

getRule() 공개 메소드

Maps to a list Rule entries of the same name in the timezone database.
public getRule ( string $rule ) : Horde_Timezone_Rule
$rule string A rule name.
리턴 Horde_Timezone_Rule A rule object.

getZone() 공개 메소드

Maps to a "Zone" entry in the timezone database. Works with zone aliases and other common timezone names too.
public getZone ( string $zone ) : Horde_Timezone_Zone
$zone string A timezone name.
리턴 Horde_Timezone_Zone A timezone object.

프로퍼티 상세

$_months 보호되어 있는 정적으로 프로퍼티

List to map month descriptions used in the timezone database.
protected static array $_months
리턴 array

$_params 보호되어 있는 프로퍼티

Any configuration parameters for this class.
protected array $_params
리턴 array

$_rules 보호되어 있는 프로퍼티

List of all Rule entries parsed into Horde_Timezone_Rule objects.
protected array $_rules
리턴 array

$_tmpfile 보호되어 있는 프로퍼티

File location of the downloaded timezone database.
protected string $_tmpfile
리턴 string

$_zones 보호되어 있는 프로퍼티

List of all Zone entries parsed into Horde_Timezone_Zone objects.
protected array $_zones
리턴 array