public function getString() { $config = Config::getInstance(); if ($this->value != '') { return '/' . trim($config->image_uploads_path, '/') . '/' . str_replace('/', '~~', $this->value); } return ''; }
public function __construct() { $config = Config::getInstance(); $this->prefix = $config->get('cache_prefix', 'ATC::'); // check for availability if (!function_exists('apc_store')) { throw new \Exception("The APC extension for PHP doesn't appear to be installed."); } }
public function __construct() { $config = Config::getInstance(); $this->path = rtrim($config->get('cache_file_path', APPLICATION_PATH . '/../tmp/'), '/') . '/'; // check for file permissions if (!is_dir($this->path)) { throw new \Exception("Cache directory was not found: " . $this->path); } else { if (!is_writable($this->path)) { throw new \Exception('Cache directory is not writable: ' . $this->path); } } }
public function __construct() { $config = Config::getInstance(); $this->base = $config->get('cache_prefix', 'ATC::'); // check for availability if (!class_exists('Memcached')) { throw new \Exception("The Memcached extension for PHP doesn't appear to be installed."); } $this->memcached = new \Memcached(); // get stored key prefix $prefix = $this->memcached->fetch($this->base . 'prefix'); if ($prefix === false) { $prefix = time(); $this->memcached->store($this->base . 'prefix', $prefix); } $this->prefix = $this->base . $prefix . '::'; }