Exemplo n.º 1
0
 /**
  * Constructor.
  *
  * It checks the availability of apccache.
  *
  * @param array $options
  *
  * @throws LiquidException if APC cache extension is not loaded or is disabled.
  */
 public function __construct(array $options = array())
 {
     parent::__construct($options);
     if (!extension_loaded('apc')) {
         throw new LiquidException('LiquidCacheApc requires PHP apc extension to be loaded.');
     }
 }
Exemplo n.º 2
0
 /**
  * Constructor.
  *
  * It checks the availability of cache directory.
  *
  * @param array $options
  *
  * @throws LiquidException if Cachedir not exists.
  */
 public function __construct(array $options = array())
 {
     parent::__construct($options);
     if (isset($options['cache_dir']) && is_writable($options['cache_dir'])) {
         $this->path = realpath($options['cache_dir']) . DIRECTORY_SEPARATOR;
     } else {
         throw new LiquidException('Cachedir not exists or not writable');
     }
 }