.

ConstantCacheManager Class Reference
[Controller]

Cache manager that returns a constant value as cache id. More...

Inheritance diagram for ConstantCacheManager:
ICacheManager MimeCacheManager NoCacheCacheManager SimpleCacheManager SuccessCacheManager

List of all members.

Public Member Functions

  __construct ($cache_id, $duration=7200, $header_manager=false)
  Constructor.
  get_cache_header_manager ()
  Get cache header manager.
  get_cache_id ()
  Return a chache id.
  get_creation_datetime ()
  Returns the datetime this cache has been created.
  get_expiration_datetime ()
  Returns the datetime this cache expires.
  initialize ($page_data)
  Initialize this instance.
  set_cache_duration ($seconds)
  Set Cache duration in seconds.
  set_cache_header_manager (ICacheHeaderManager $manager)
  Set cache header manager.
  set_cache_id ($id)
  Sets the cache id.
  set_creation_datetime ($datetime)
  Sets the datetime this cache has been created.
  set_expiration_datetime ($datetime)
  Sets the expiration datetime this cache expires.

Detailed Description

Cache manager that returns a constant value as cache id.

Author:
Gerd Riesselmann

Definition at line 8 of file constantcachemanager.cls.php.


Constructor & Destructor Documentation

ConstantCacheManager::__construct ( cache_id,
duration = 7200,
header_manager = false  
)

Constructor.

Parameters:
mixed  $cache_id
int  $duration Cache duration , defaults to 2 hours
ICacheHeaderManager  $header_manager Defaults to NoCacheCacheHeaderManager

Definition at line 40 of file constantcachemanager.cls.php.

00040                                                                                           {
00041                 $this->set_cache_id($cache_id);
00042                 $this->set_cache_duration($duration);
00043                 $this->set_creation_datetime(time());
00044                 if (empty($header_manager)) { $header_manager = CacheHeaderManagerFactory::create(Config::get_value(Config::CACHEHEADER_CLASS_UNCACHED)); }  
00045                 $this->set_cache_header_manager($header_manager);
00046         }

Member Function Documentation

ConstantCacheManager::get_cache_header_manager (  ) 

Get cache header manager.

Returns:
ICacheHeaderManager

Implements ICacheManager.

Definition at line 125 of file constantcachemanager.cls.php.

00125                                                    {
00126                 return $this->header_manager;
00127         }       
ConstantCacheManager::get_cache_id (  ) 

Return a chache id.

Implements ICacheManager.

Reimplemented in SuccessCacheManager.

Definition at line 55 of file constantcachemanager.cls.php.

00055                                        {
00056                 return $this->cache_id; 
00057         }
ConstantCacheManager::get_creation_datetime (  ) 

Returns the datetime this cache has been created.

Returns:
timestamp

Implements ICacheManager.

Definition at line 91 of file constantcachemanager.cls.php.

00091                                                 {
00092                 return $this->creation;
00093         }
ConstantCacheManager::get_expiration_datetime (  ) 

Returns the datetime this cache expires.

Returns:
timestamp

Implements ICacheManager.

Definition at line 73 of file constantcachemanager.cls.php.

00073                                                   {
00074                 return $this->expiration;
00075         }
ConstantCacheManager::initialize ( page_data  ) 

Initialize this instance.

Parameters:
PageData  $page_data
Returns:
void

Implements ICacheManager.

Reimplemented in SuccessCacheManager.

Definition at line 48 of file constantcachemanager.cls.php.

00048                                                {
00049                 // Do nothing here
00050         }
ConstantCacheManager::set_cache_duration ( seconds  ) 

Set Cache duration in seconds.

Parameters:
int  $seconds

Implements ICacheManager.

Definition at line 109 of file constantcachemanager.cls.php.

00109                                                      {
00110                 $this->expiration = time() + $seconds;
00111         }
ConstantCacheManager::set_cache_header_manager ( ICacheHeaderManager manager  ) 

Set cache header manager.

Implements ICacheManager.

Definition at line 116 of file constantcachemanager.cls.php.

00116                                                                                {
00117                 $this->header_manager = $manager;               
00118         }
ConstantCacheManager::set_cache_id ( id  ) 

Sets the cache id.

Parameters:
mixed  $id

Implements ICacheManager.

Definition at line 64 of file constantcachemanager.cls.php.

00064                                           {
00065                 $this->cache_id = $id;
00066         }
ConstantCacheManager::set_creation_datetime ( datetime  ) 

Sets the datetime this cache has been created.

Parameters:
timestamp  $datetime

Implements ICacheManager.

Definition at line 100 of file constantcachemanager.cls.php.

00100                                                          {
00101                 $this->creation = $datetime;
00102         }       
ConstantCacheManager::set_expiration_datetime ( datetime  ) 

Sets the expiration datetime this cache expires.

Parameters:
timestamp  $datetime

Implements ICacheManager.

Definition at line 82 of file constantcachemanager.cls.php.

00082                                                            {
00083                 $this->expiration = $datetime;
00084         }

The documentation for this class was generated from the following file: