seek_quarry
[ class tree: seek_quarry ] [ index: seek_quarry ] [ all elements ]

Class: FileCache

Source Location: /lib/file_cache.php

Class Overview


Library of functions used to implement a simple file cache This might be used on systems that don't have memcache


Author(s):

  • Chris Pollett

Variables

Constants

Methods



Class Details

[line 50]
Library of functions used to implement a simple file cache This might be used on systems that don't have memcache



Tags:

author:  Chris Pollett


[ Top ]


Class Variables

$dir_name =

[line 56]

Folder name to use for this FileCache


Type:   string


[ Top ]



Class Methods


constructor __construct [line 74]

FileCache __construct( string $dir_name)

Creates the directory for the file cache, sets how frequently all items in the cache expire



Parameters:

string   $dir_name   folder name of where to put the file cache

[ Top ]

method checksum [line 142]

int checksum( string $key)

Makes a 0 - self::NUMBER_OF_BINS value out of the provided key



Tags:

return:  value between 0 and self::NUMBER_OF_BINS


Parameters:

string   $key   to convert to a random value between
  1. - self::NUMBER_OF_BINS

[ Top ]

method get [line 93]

mixed get( string $key)

Retrieve data associated with a key that has been put in the cache



Tags:

return:  the data associated with the key if it exists, false otherwise


Parameters:

string   $key   the key to look up

[ Top ]

method set [line 109]

void set( string $key, mixed $value)

Stores in the cache a key-value pair



Parameters:

string   $key   to associate with value
mixed   $value   to store

[ Top ]


Class Constants

NUMBER_OF_BINS =  24

[line 66]

Total number of bins to cycle between


[ Top ]

SECONDS_IN_A_BIN =  3600

[line 61]

How many seconds a bin is vulnerable to be deleted as expired


[ Top ]



Documentation generated by phpDocumentor 1.4.3