close
Phork Manual Table of Contents
Phork Framework User Guide 1.3.4

CacheFactory

Filepath: phork/php/cache/CacheFactory.class.php

The CacheFactory loads the cache configuration and instantiates and registers the correct type of cache adaptor object based on the config. This is used in the bootstrap.


Example

if (AppConfig::get('CacheEnabled')) {
    AppLoader::includeClass('php/cache/', 'CacheFactory');
    $objCacheFactory = new CacheFactory('cache');
    AppRegistry::register('Cache', $objCacheFactory->init());
}