Class Klutz_Driver

Description

Klutz_Driver:: defines an API for storing and retrieving the comic images

$Horde: klutz/lib/Driver.php,v 1.36 2007/05/26 00:45:32 mrubinsk Exp $

Located in /lib/Driver.php (line 11)


	
			
Direct descendents
Class Description
 class Klutz_Driver_file Klutz Driver implementation for comics as files.
 class Klutz_Driver_sql Klutz Driver implementation for comics as files with SUM info stored in SQL database.
Method Summary
 Klutz_Driver Klutz_Driver ( $params)
 object Klutz_Driver &factory ([string $driver = null], [array $params = null])
 boolean imageExists (string $index, [timestamp $date = null])
 string imageSize (string $index, [timestamp $date = null])
 array listDates ([timestamp $date = null], [timestamp $oldest = null], [timestamp $newest = null])
 mixed retrieveImage (string $index, [timestamp $date = null])
 object Klutz_Driver &singleton ([string $driver = null], [array $params = null])
 boolean storeImage (string $index, string $image, [ $date = null], timestamp $data)
Methods
Constructor Klutz_Driver (line 100)
Klutz_Driver Klutz_Driver ( $params)
  • $params
factory (line 26)

Gets a concrete Klutz_Driver instance.

  • return: The newly created concrete instance, or false on error.
object Klutz_Driver &factory ([string $driver = null], [array $params = null])
  • 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
imageExists (line 177)

Find out if we already have a local copy of this image.

Even though we never actually store a local copy, pretend.

  • return: True
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:
imageSize (line 160)

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.

  • return: Attributes for an <img> tag giving height and width
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:
listDates (line 118)

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.

  • return: timestamps Dates between $oldest and $newest we have comics for
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.
retrieveImage (line 209)

Retrieve an image from storage. Since there is no local storage this will actually call for the fetching.

  • return: If the image exists locally, return a Klutz_Image object. If it doesn't, return a string with the URL pointing to the comic.
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:
singleton (line 76)

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();

  • return: The created concrete instance, or false on error.
object Klutz_Driver &singleton ([string $driver = null], [array $params = null])
  • 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.
storeImage (line 193)

Store an image for later retrieval

Even though we never actually store a local copy, pretend.

  • return: True
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:

Documentation generated on Sun, 30 Jan 2011 05:30:35 +0000 by phpDocumentor 1.4.3