\Klutz

Klutz Base Class.

Copyright 2002-2017 Horde LLC (http://www.horde.org/)

Summary

Methods
Properties
Constants
Klutz()
_convertDay()
_sortComics()
listEnabled()
listByDriver()
comicObject()
getProperty()
$days
$image_types
$comics
$sort
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$days

$days : array

Used to translate between literal dow and numeric dow (sun = 0, 7)

Type

array

$image_types

$image_types : array

MIME types for images based on the return value from getimagesize

Type

array

$comics

$comics : array

Array of comics and their associated attributes

Type

array

$sort

$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).

Type

integer

Methods

Klutz()

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. :)

Parameters

integer $sort

Sorting method to use

_convertDay()

_convertDay(string  $a) : string

Convert a user-passed string into a three-letter, lowercased day abbr.

Parameters

string $a

The string to convert

Returns

string —

A three-letter abbreviation for the requested day, or the first three letters of the passed string lowercased.

_sortComics()

_sortComics(string  $a, string  $b) : integer

Comparse two comics and return -1, 0, or 1 based on the $sort member variable

Parameters

string $a

The index of the first comic

string $b

The index of the second comic

Returns

integer —

@see strcmp

listEnabled()

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.

Parameters

array $list

The list to extract from (default is all comics, but smaller arrays are okay).

\timestamp $date

If passed in, check the $days array to make sure the comic should appear today.

Returns

array —

A list of comic indecies

listByDriver()

listByDriver(string  $driver, array  $list = null) : array

Return a list of comics that use the given fetch driver

Parameters

string $driver

The driver to check for

array $list

The list to filter by driver (default all comics)

Returns

array —

A list of the comics passed in that have been filtered based on driver

comicObject()

comicObject(string  $index) : object

Return a Klutz_Comic for the given index

Parameters

string $index

The index key for the desired comic

Returns

object —

A Klutz_Comic object for the given index

getProperty()

getProperty(string  $index, string  $property) : mixed

Return the requested property for the requested comic

Parameters

string $index

The index key for the desired comic

string $property

The desired property

Returns

mixed —

The value of $property for $index