PHP 클래스 Klutz, horde

Copyright 2002-2016 Horde LLC (http://www.horde.org/)
저자: Marcus I. Ryan ([email protected])
파일 보기 프로젝트 열기: horde/horde

공개 프로퍼티들

프로퍼티 타입 설명
$comics array Array of comics and their associated attributes
$days array Used to translate between literal dow and numeric dow (sun = 0, 7)
$image_types array MIME types for images based on the return value from getimagesize
$sort integer Sorting method to use. Options are KLUTZ_SORT_NAME (sort by comic title), KLUTZ_SORT_AUTHOR (sort by Author's last name), and KLUTZ_SORT_NOSORT (don't promise any given sorting order).

공개 메소드들

메소드 설명
Klutz ( integer $sort = KLUTZ_SORT_NAME ) Constructor - Parse the /config/comics.php config file and store the results in $comic. Also tries to validate all the data it can and adjust case, etc., to more predictible consistency than humans editing config files can give. :)
_convertDay ( string $a ) : string Convert a user-passed string into a three-letter, lowercased day abbr.
_sortComics ( string $a, string $b ) : integer Comparse two comics and return -1, 0, or 1 based on the $sort member variable
comicObject ( string $index ) : object Return a Klutz_Comic for the given index
getProperty ( string $index, string $property ) : mixed Return the requested property for the requested comic
listByDriver ( string $driver, array $list = null ) : array Return a list of comics that use the given fetch driver
listEnabled ( array $list = null, timestamp $date = null ) : array Return a list of comics that are marked as enabled, and that should appear on a given day if a date is passed in.

메소드 상세

Klutz() 공개 메소드

Constructor - Parse the /config/comics.php config file and store the results in $comic. Also tries to validate all the data it can and adjust case, etc., to more predictible consistency than humans editing config files can give. :)
public Klutz ( integer $sort = KLUTZ_SORT_NAME )
$sort integer Sorting method to use

_convertDay() 공개 메소드

Convert a user-passed string into a three-letter, lowercased day abbr.
public _convertDay ( string $a ) : string
$a string The string to convert
리턴 string A three-letter abbreviation for the requested day, or the first three letters of the passed string lowercased.

_sortComics() 공개 메소드

Comparse two comics and return -1, 0, or 1 based on the $sort member variable
public _sortComics ( string $a, string $b ) : integer
$a string The index of the first comic
$b string The index of the second comic
리턴 integer @see strcmp

comicObject() 공개 메소드

Return a Klutz_Comic for the given index
public comicObject ( string $index ) : object
$index string The index key for the desired comic
리턴 object A Klutz_Comic object for the given index

getProperty() 공개 메소드

Return the requested property for the requested comic
public getProperty ( string $index, string $property ) : mixed
$index string The index key for the desired comic
$property string The desired property
리턴 mixed The value of $property for $index

listByDriver() 공개 메소드

Return a list of comics that use the given fetch driver
public listByDriver ( string $driver, array $list = null ) : array
$driver string The driver to check for
$list array The list to filter by driver (default all comics)
리턴 array A list of the comics passed in that have been filtered based on driver

listEnabled() 공개 메소드

Return a list of comics that are marked as enabled, and that should appear on a given day if a date is passed in.
public listEnabled ( array $list = null, timestamp $date = null ) : array
$list array The list to extract from (default is all comics, but smaller arrays are okay).
$date timestamp If passed in, check the $days array to make sure the comic should appear today.
리턴 array A list of comic indecies

프로퍼티 상세

$comics 공개적으로 프로퍼티

Array of comics and their associated attributes
public array $comics
리턴 array

$days 공개적으로 프로퍼티

Used to translate between literal dow and numeric dow (sun = 0, 7)
public array $days
리턴 array

$image_types 공개적으로 프로퍼티

MIME types for images based on the return value from getimagesize
public array $image_types
리턴 array

$sort 공개적으로 프로퍼티

Sorting method to use. Options are KLUTZ_SORT_NAME (sort by comic title), KLUTZ_SORT_AUTHOR (sort by Author's last name), and KLUTZ_SORT_NOSORT (don't promise any given sorting order).
public int $sort
리턴 integer