Class Klutz_Driver
Klutz_Driver:: defines an API for storing and retrieving the comic images
Methods summary
public
object
|
#
factory( string $driver = null, array $params = null )
Gets a concrete Klutz_Driver instance.
Gets a concrete Klutz_Driver instance.
Parameters
- $driver
- <p>The type of concrete Klutz_Driver subclass to
return. The code for the driver is dynamically
included.</p>
- $params
- <p>A hash containing any additional configuration or
connection parameters a subclass might need</p>
Returns
object Klutz_Driver The newly created concrete instance, or
false on error.
|
public
array
|
#
listDates( timestamp $date = null, timestamp $oldest = null, timestamp $newest = null )
Gets a list of the dates for which we have comics between $oldest and
$newest. In the default driver (no backend) this is just a list of
all dates between $oldest and $newest.
Gets a list of the dates for which we have comics between $oldest and
$newest. In the default driver (no backend) this is just a list of
all dates between $oldest and $newest.
Parameters
- $date
- The reference date (default today)
- $oldest
- <p>The earliest possible date to return (default
first of the month)</p>
- $newest
- <p>The latest possible date to return (default
last date of the month)</p>
Returns
array timestamps Dates between $oldest and $newest we have
comics for
|
public
string
|
#
imageSize( string $index, timestamp $date = null )
Get the image dimensions for the requested image.
Get the image dimensions for the requested image.
The image is not stored locally so this function returns an
empty string. Performance hit is too expensive to make this
worth it.
Parameters
- $index
- The index of the comic to check
- $date
- The date of the comic to check (default today)
Returns
string Attributes for an tag giving height and width
|
public
boolean
|
#
imageExists( string $index, timestamp $date = null )
Find out if we already have a local copy of this image.
Find out if we already have a local copy of this image.
Even though we never actually store a local copy, pretend.
Parameters
- $index
- The index of the comic to check
- $date
- The date of the comic to check (default today)
Returns
boolean True
|
public
boolean
|
#
storeImage( string $index, string $image, timestamp $date = null )
Store an image for later retrieval
Store an image for later retrieval
Even though we never actually store a local copy, pretend.
Parameters
- $index
- The index of the comic to retrieve
- $image
- Raw (binary) image data to store
- $date
- $data Date to store it under (default today)
Returns
boolean True
|
public
mixed
|
#
retrieveImage( string $index, timestamp $date = null )
Retrieve an image from storage. Since there is no local storage
this will actually call for the fetching.
Retrieve an image from storage. Since there is no local storage
this will actually call for the fetching.
Parameters
- $index
- The index of the comic to retrieve
- $date
- The date for which we want $comic
Returns
mixed If the image exists locally, return a Klutz_Image object.
If it doesn't, return a string with the URL pointing to
the comic.
|