API Documentation for: 1.1.1
Show:

IDatabaseCache Class

Namespace: Canteen\Database

Interface for the external database cache, optional

Item Index

Methods

flushContext

(
  • context
)
Boolean

Delete a context (which is a group of related keys)

Parameters:

  • context String

    The name of the context

Returns:

Boolean:

If we successfully deleted the context

read

(
  • key
  • [output=false]
)
Mixed

Read an item back from the cache

Parameters:

  • key String

    The key of the item

  • [output=false] Boolean optional

    If the file should be output directly (better memory management)

Returns:

Mixed:

Return false if we can't read it, or it doesn't exist

save

(
  • key
  • key
  • [context=null]
  • [expires=-1]
  • If
)

Save and item to the server

Parameters:

  • key String

    The key of the item

  • key Mixed

    The value of the item

  • [context=null] String optional

    The optional group context for the cache

  • [expires=-1] Int optional

    How many seconds before this expires, defaults to expiresDefault

  • If Boolean

    we were able to save successfully