Class Swift_Cache_Disk

Description

Caches data in files on disk - this is the best approach if possible

Located in /Swift/Cache/Disk.php (line 19)

Swift_Cache
   |
   --Swift_Cache_Disk
Variable Summary
static string $save_path
array $open
string $prefix
Method Summary
static void setSavePath ([string $path = "/tmp"])
Swift_Cache_Disk __construct ()
void __destruct ()
void clear (string $key)
boolean has (string $key)
string read (string $key, [int $size = null])
void write (string $key, string $data)
Variables
static string $save_path = "/tmp" (line 35)

The save path on disk

  • access: protected
array $open = array() (line 25)

Open file handles

  • access: protected
string $prefix (line 30)

The prefix to prepend to files

  • access: protected
Methods
static method setSavePath (line 48)

Set the save path of the disk - this is a global setting and called statically!

  • access: public
static void setSavePath ([string $path = "/tmp"])
  • string $path: The path to a writable directory
Constructor __construct (line 40)

Ctor

  • access: public
Swift_Cache_Disk __construct ()
Destructor __destruct (line 122)

Dtor.

Clear out cached data at end of script execution or cache destruction

  • access: public
void __destruct ()
clear (line 72)

Clear the cached data (unlink)

  • access: public
void clear (string $key)
  • string $key: The cache key

Redefinition of:
Swift_Cache::clear()
Clear out the buffer for $key
has (line 81)

Check if data is cached for $key

  • access: public
boolean has (string $key)
  • string $key: The cache key

Redefinition of:
Swift_Cache::has()
Check if there is something in the cache for $key
read (line 91)

Read data from the cache for $key

  • access: public
string read (string $key, [int $size = null])
  • string $key: The cache key
  • int $size: The number of bytes to read

Redefinition of:
Swift_Cache::read()
Read bytes from the cached buffer and seek forward in the buffer
write (line 57)

Write data to the cache

  • access: public
void write (string $key, string $data)
  • string $key: The cache key
  • string $data: The data to write

Redefinition of:
Swift_Cache::write()
Append bytes to the cache buffer identified by $key

Inherited Methods

Inherited From Swift_Cache

Swift_Cache::clear()
Swift_Cache::getOutputStream()
Swift_Cache::has()
Swift_Cache::read()
Swift_Cache::write()

Documentation generated on Wed, 26 Mar 2008 20:33:06 +1100 by phpDocumentor 1.3.1