phpDocumentor Swift
[ class tree: Swift ] [ index: Swift ] [ all elements ]

Class: SwiftCache

Source Location: /classes/SwiftCache.php

Class SwiftCache

Class Overview

Holds functions to buffer output from PHP files and store into cache with the specified key and expiration time.

Located in /classes/SwiftCache.php [line 42]



		
		
		
		

Methods

[ Top ]
Method Summary
SwiftCache   __construct()   Creates a new SwiftCache object using the provided $cache_dir.
string   getCache()   Returns the cache stored with the provided $cache_key if the cache is not older then the provided $cache_exp_time. If no cache exists or the cache is expired then the function returns null.
void   startCache()   Begin storing all output into a buffer until stopCache() is called.
string   stopCache()   Stop buffering output from previous call to startCache() and store buffer into cache with the provided $cache_key. Returns the stored cache on success, and returns false on error.

[ Top ]
Methods
Constructor __construct  [line 52]

  SwiftCache __construct( string $cache_dir  )

Creates a new SwiftCache object using the provided $cache_dir.

Parameters:
string   $cache_dir:  The directory to store all chached files.

API Tags:
Return:  The new SwiftCache object
Access:  public


[ Top ]
getCache  [line 66]

  string getCache( string $cache_key, [int $cache_exp_time = 600]  )

Returns the cache stored with the provided $cache_key if the cache is not older then the provided $cache_exp_time. If no cache exists or the cache is expired then the function returns null.

Parameters:
string   $cache_key:  An alphanumeric key to reference the stored cache.
int   $cache_exp_time:  The expiration time (in seconds) of the cache. Default = 600

API Tags:
Return:  The stored cache as a string. Returns null if cache does not exist or is expired.
Access:  public


[ Top ]
startCache  [line 92]

  void startCache( )

Begin storing all output into a buffer until stopCache() is called.


API Tags:
Access:  public


[ Top ]
stopCache  [line 104]

  string stopCache( string $cache_key  )

Stop buffering output from previous call to startCache() and store buffer into cache with the provided $cache_key. Returns the stored cache on success, and returns false on error.

Parameters:
string   $cache_key:  An alphanumeric key to reference the stored cache.

API Tags:
Return:  The stored cache as a string.
Access:  public


[ Top ]

Documentation generated on Tue, 08 Oct 2013 05:37:15 +0200 by phpDocumentor 1.4.4