Prado\Caching\TCache::init PHP Méthode

init() public méthode

This method initializes the cache key prefix and registers the cache module with the application if the cache is primary.
public init ( $config )
    public function init($config)
    {
        if ($this->_prefix === null) {
            $this->_prefix = $this->getApplication()->getUniqueID();
        }
        if ($this->_primary) {
            if ($this->getApplication()->getCache() === null) {
                $this->getApplication()->setCache($this);
            } else {
                throw new TConfigurationException('cache_primary_duplicated', get_class($this));
            }
        }
    }

Usage Example

Exemple #1
0
 * @package Prado\Caching
 */
namespace Prado\Caching;

use Prado\Exceptions\TConfigurationException;
/**
 * TEACache class
 *
All Usage Examples Of Prado\Caching\TCache::init