Cache helper method
@return Mixed
16159
public function cache(){

        $args = \func_get_args();

        switch(\count($args)){
        case 1:
            return $this->helper('cache')->read($args[0]);
        case 2:
            return $this->helper('cache')->write($args[0], $args[1]);
        }

        return null;
    }
1073821
public function getCache()
    {
        if (null === self::$cache) {
            if (!empty($this->appConfig['cache']['driver'])) {
                // Options definition.
                if (empty($this->appConfig['cache']['options'])) {
                    $options = array();
                } else {
                    $options = $this->appConfig['cache']['options'];
                }

                // Driver definition.
                if ('memcached' !== $this->appConfig['cache']['driver']) {
                    $className = $this->appConfig['cache']['driver'];
                } else {
                    $className = '\Towel\Cache\TowelMemcached';
                }

                // Driver instantiation
                $cacheDriver = new $className();
                $cacheDriver->setOptions($options);
            }

            self::$cache = new TowelCache($cacheDriver);
        }

        return self::$cache;
    }
944348
protected function get_metacache() {
        if (!isset($this->metacache)) {
            $properties = array('dbfamily' => $this->get_dbfamily(), 'settings' => $this->get_settings_hash());
            $this->metacache = cache::make('core', 'databasemeta', $properties);
        }
        return $this->metacache;
    }
976181
public function getCache()
    {
        if (!$this->config->getCache()) {
            // This will be removed eventually. The default cache will be instantiated directly in the config class.
            $this->config->setCache(CacheFactory::get($this->config->getCacheType(), $this->config->getCacheOptions()));
        }

        return $this->config->getCache();
    }
630443
public function getCache()
    {
        if (!$this->cache) {
            $options = isset($this->options['cache']) ? $this->options['cache'] : [];
            foreach (static::defaultOptions()['cache'] as $k=>$v) {
                if (!isset($options[$k])) {
                    $options[$k] = $v;
                }
            }
            if (!file_exists($options['path'])) {
                $options['path'] = Config::getStoragePath() . trim($options['path'], '\\/');
            }
            
            $this->cache = new Cache($options); 
        }
        
        return $this->cache;
    }
399949
public function getCached()
    {
        $cache = $this->cache->get('config');
        if ($cache === false) {
            $cache = $this->notCached;
            $this->cache->set('config', $cache);
        }
        return $cache;
    }
194625
public function getCacheDir() {
    if (true === $this->_checkCacheDir()) {
      $filename = $this->getCache();
      $filename = preg_replace('/[^0-9a-z\.\_\-]/i', '', strtolower($filename));
      return $this->getCachePath() . $this->_getHash($filename) . $this->getExtension();
    }
  }
22924
public function getCached()
    {
        $cached = $this->cache->get(
            $this->getCacheKey(),
            []
        );

        return $this->formatCache($cached);
    }
611889
protected function get_cache()
    {
        if (!$this->cache) {
            $this->load_config();

            $rcmail = rcube::get_instance();
            $ttl    = 12 * 60 * 60; // default: 12 hours
            $ttl    = $rcmail->config->get('database_attachments_cache_ttl', $ttl);
            $type   = $rcmail->config->get('database_attachments_cache', 'db');
            $prefix = self::PREFIX;

            // Add session identifier to the prefix to prevent from removing attachments
            // in other sessions of the same user (#1490542)
            if ($id = session_id()) {
                $prefix .= $id;
            }

            // Init SQL cache (disable cache data serialization)
            $this->cache = $rcmail->get_cache($prefix, $type, $ttl, false);
        }

        return $this->cache;
    }
1107343
public function cache_driver()
	{
		if ( ! $this->_cache)
		{
			$adapter = new DCache_Adapter\File(
				realpath(__DIR__.'../../../'.static::CACHE_DIR)
			);
			$adapter->setOption('ttl', static::CACHE_LIFETIME);
			$this->_cache = new DCache\Cache($adapter);
		}

		return $this->_cache;
	}
1256769
public function clearCache()
    {
        if ($this->Using === 'APCu') {
            return $this->Modified = apcu_clear_cache();
        }
        if ($this->Using === 'Memcached') {
            return ($this->WorkingData->flush() && ($this->Modified = true));
        }
        if ($this->Using === 'Redis') {
            return ($this->WorkingData->flushDb() && ($this->Modified = true));
        }
        if ($this->Using === 'PDO') {
            $PDO = $this->WorkingData->prepare(self::clearQuery);
            if ($PDO !== false && $PDO->execute()) {
                return ($PDO->rowCount() > 0 && $this->Modified = true);
            }
            return false;
        }
        if (is_array($this->WorkingData)) {
            $this->WorkingData = [];
            return $this->Modified = true;
        }
        return false;
    }
806498
public function getCache()
    {
        // make sure filters are parsed again if cache expired
        if (!$this->isValidFile($this->path)) {
            return false;
        }

        $data = unserialize(file_get_contents($this->path));

        return $data;
    }
298442
protected function getCacheDir()
    {
        $cacheDir = $this->container->getParameter("kernel.cache_dir");
        $cacheDir = rtrim($cacheDir, '/');
        $cacheDir .= '/' . self::FEED_CACHE_DIR . '/';

        return $cacheDir;
    }
1125107
public function getCache() {
        if($this->cacheBackend == null) {
            $this->cacheBackend = Zend_Cache::factory('Core', 'Apc', array('automatic_serialization' => true));
        }
        return $this->cacheBackend;
    }
758841
public function getCacheSystem()
    {
        if (is_null($this->cache)) {
            $this->cache = new \Gregwar\Cache\Cache();
            $this->cache->setCacheDirectory($this->cacheDir);
        }

        return $this->cache;
    }
648236
private function cachedAllPerStore() {
		if (!isset($this->{__METHOD__})) {
			$this->{__METHOD__} = array_merge($this->cachedI(), $this->cachedObjectsI());
		}
		return $this->{__METHOD__};
	}
430770
public function clearCache() {
		$cachePath = Yii::getAlias('@webroot/' . $this->cachePath);
		//remove dir
		FileHelper::removeDirectory($cachePath);
		//creat dir
		return FileHelper::createDirectory($cachePath, 0755);
	}