# \cms_cache_handler

This class provides static methods for setting up an app wide cache handler.

to allow caching data for a limited amount of time.

## Summary

Methods
Properties
Constants
get_instance()
set_driver()
get_driver()
clear()
get()
exists()
erase()
set()
can_cache()
No public properties found
TYPE_ANY
TYPE_PAGE
TYPE_CONTENT
TYPE_MODULE
TYPE_TEMPLATE
TYPE_STYLESHEET
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

File
  lib/class.cms_cache_handler.php
Package
  \CGExtensions
Class hierarchy
  \cms_cache_handler

## Tags

todo |

## Constants

### TYPE_ANY

    TYPE_ANY

#

## Tags

todo |

### TYPE_PAGE

    TYPE_PAGE

#

## Tags

todo |

### TYPE_CONTENT

    TYPE_CONTENT

#

## Tags

todo |

### TYPE_MODULE

    TYPE_MODULE

#

## Tags

todo |

### TYPE_TEMPLATE

    TYPE_TEMPLATE

#

## Tags

todo |

### TYPE_STYLESHEET

    TYPE_STYLESHEET

#

## Tags

todo |

## Methods

### get_instance()

    get_instance()

Get the global instance of the cms_cache_handler object

#

static final

## Tags

todo |

### set_driver()

    set_driver(\cms_cache_driver $driver)

Set the cache driver into this object.

#### Parameters

\cms_cache_driver | $driver |

#

final

## Tags

todo |

### get_driver()

    get_driver() : \cms_cache_driver

Return the cache driver for this object

#### Returns

\cms_cache_driver

#

final

## Tags

todo |

### clear()

    clear(string $group)

A wrapper to clear the cache (for a specified cache group) independent of the driver.

the cache driver may have a default group.

#### Parameters

string | $group |

#

final

## Tags

todo |

### get()

    get(string $key, string $group)

A wrapper to retrieve a cached driver independent of the driver.

the cache driver may have a default group.

#### Parameters

string | $key | the cache key.
string | $group |

#

final

## Tags

todo |

### exists()

    exists(string $key, string $group)

A wrapper method to test if an item exists in the cache. Independent of the driver.

the cache driver may have a default group.

#### Parameters

string | $key | the cache key.
string | $group |

#

final

## Tags

todo |

### erase()

    erase(string $key, string $group)

A wrapper method to remove an item from the cache. Independent of the driver.

the cache driver may have a default group.

#### Parameters

string | $key | the cache key.
string | $group |

#

final

## Tags

todo |

### set()

    set(string $key, string $value, string $group)

A wrapper method to store data into the cache. Independent of the driver.

the cache driver may have a default group.

#### Parameters

string | $key | the cache key.
string | $value | The data to store.
string | $group |

#

final

## Tags

todo |

### can_cache()

    can_cache() : bool

This method tests if an item can be stored in the cache for a request.

This is because at certain times (i.e: during module installation, or in a stylesheet request) it may be inappropriate or unable to store data as the cache would be invalidated by a higher level function.

#### Returns

bool

#

static final

## Tags

todo |

### class.cms_cache_handler.php