Prado\I18N\core\MessageCache::__construct PHP 메소드

__construct() 공개 메소드

Create a new Translation cache.
public __construct ( string $cacheDir )
$cacheDir string Directory to store the cache files.
    public function __construct($cacheDir)
    {
        $cacheDir = $cacheDir . '/';
        if (!is_dir($cacheDir)) {
            throw new Exception('The cache directory ' . $cacheDir . ' does not exists.' . 'The cache directory must be writable by the server.');
        }
        if (!is_writable($cacheDir)) {
            throw new Exception('The cache directory ' . $cacheDir . ' must be writable ' . 'by the server.');
        }
        $options = array('cacheDir' => $cacheDir, 'lifeTime' => $this->getLifeTime(), 'automaticSerialization' => true);
        $this->cache = new TCache_Lite($options);
    }