Klutz_Driver
Klutz_Driver
( $params)
Gets a concrete Klutz_Driver instance.
-
string
$driver: The type of concrete Klutz_Driver subclass to return. The code for the driver is dynamically included.
-
array
$params: A hash containing any additional configuration or connection parameters a subclass might need
Find out if we already have a local copy of this image.
Even though we never actually store a local copy, pretend.
boolean
imageExists
(string $index, [timestamp $date = null])
-
string
$index: The index of the comic to check
-
timestamp
$date: The date of the comic to check (default today)
Redefined in descendants as:
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.
string
imageSize
(string $index, [timestamp $date = null])
-
string
$index: The index of the comic to check
-
timestamp
$date: The date of the comic to check (default today)
Redefined in descendants as:
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.
array
listDates
([timestamp $date = null], [timestamp $oldest = null], [timestamp $newest = null])
-
timestamp
$date: The reference date (default today)
-
timestamp
$oldest: The earliest possible date to return (default first of the month)
-
timestamp
$newest: The latest possible date to return (default last date of the month)
Redefined in descendants as:
-
Klutz_Driver_file::listDates()
: Get a list of the dates for which we have comics between $oldest and $newest. Only returns dates we have at least one comic for.
-
Klutz_Driver_sql::listDates()
: Get a list of the dates for which we have comics between $oldest and $newest. Only returns dates we have at least one comic for.
Retrieve an image from storage. Since there is no local storage this will actually call for the fetching.
mixed
retrieveImage
(string $index, [timestamp $date = null])
-
string
$index: The index of the comic to retrieve
-
timestamp
$date: The date for which we want $comic
Redefined in descendants as:
Gets a reference to a concrete Klutz_Driver instance.
It will only create a new instance if no Klutz_Driver instance with the same parameters currently exists.
This should be used if multiple storage sources are required.
This method must be invoked as follows:
$var = &Klutz_Driver::singleton();
-
string
$driver: The type of concrete Klutz_Driver subclass to return. The code for the driver is dynamically included.
-
array
$params: A hash containing any additional configuration or connection parameters a subclass might need.
Store an image for later retrieval
Even though we never actually store a local copy, pretend.
boolean
storeImage
(string $index, string $image, [ $date = null], timestamp $data)
-
string
$index: The index of the comic to retrieve
-
string
$image: Raw (binary) image data to store
-
timestamp
$data: Date to store it under (default today)
-
$date
Redefined in descendants as: