PHP Класс Klutz, horde

Copyright 2002-2016 Horde LLC (http://www.horde.org/)
Автор: Marcus I. Ryan ([email protected])
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$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