Set a cache object.
This API expects it can call "set($key, $value)" and "get($key)" and wont try to do anything else.

@param object $cache An object with get and set methods.
504306
public function set_cache_layer($cache) {
        if (!method_exists($cache, 'set') || !method_exists($cache, 'get')) {
            throw new \Exception("Invalid cache layer - must have set and get.");
        }

        $this->_cache = $cache;
    }
616320
protected void putToCache(String cacheName, String key, Object value) {
        putToCache(cacheName, key, value, 0);
    }
761904
public static function set(string $key, $value = null, int $expiration = 0): ?Cache
    {
        if (!self::$instance) {
            return null;
        }

        self::$instance->engine->set($key, $value, $expiration);

        return self::$instance;
    }
1150082
public function setCache($cache)
    {
        $this->cache = $cache;
        if ($this->isBool($cache) && $cache === false) {
            $this->cache = $cache;
        } else {
            if (is_object($cache)) {
                if ($this->isInstanceOf($cache, CacheStorage::class)) {
                    $this->cache = $cache;
                } else {
                    throw new RouterException('$cache must either be a boolean or instance of ' . CacheStorage::class . '.');
                }
            } else {
                $this->cache = $this->cache($cache);
            }
        }
    }
212070
public function setCache(Mustache_Cache $cache)
    {
        if (isset($this->logger) && $cache->getLogger() === null) {
            $cache->setLogger($this->getLogger());
        }

        $this->cache = $cache;
    }
1341759
public function setObject(ICacheable $cacheable)
    {
        if (!$this->isDisabled()) {
            $path = $this->resolvePath($cacheable->getCacheKey(), true);
            file_put_contents($path, $cacheable->getCacheValue());
        }
    }
458731
public function setCache($cache, $namespace = null)
    {
        if($cache && ObjectRegistryCache::isSupported())
        {
            $this->__registry = new ObjectRegistryCache();

            if($namespace) {
                $this->__registry->setNamespace($namespace);
            }
        }
        else
        {
            if(!$this->__registry instanceof ObjectRegistry) {
                $this->__registry = new ObjectRegistry();
            }
        }

        return $this;
    }
432528
public function setFlushableCache(SwatDBCacheNsFlushable $cache)
    {
        foreach ($this->objects as $object) {
            if ($object instanceof SwatDBFlushable) {
                $object->setFlushableCache($cache);
            }
        }
    }
686427
public function setCacheEnable($set)
    {
        $this->cacheEnable = $set;
        $log = $set ? 'true' : 'false';
        $this->logger->debug('LRUcache: enable/disable: ' . $log );
        return true;
    }
663975
function cacheSet(key, options, val) {
    if (shouldCache(options)) {
      return;
    }

    if (self.options.cache === 'memory') {
      self.cache[key] = val;
      return;
    }

    self.options.cache.set(key, val);
  }
200518
function use_cache ( $key = '' )
		{
			if (empty($_POST))
			{
				$this->cache_filename  =  $this->cache_dir . 'cache_' . md5($_SERVER['REQUEST_URI'] . serialize($key)) . '.ser';
				if (($_SERVER['HTTP_CACHE_CONTROL'] != 'no-cache')  &&  ($_SERVER['HTTP_PRAGMA'] != 'no-cache')  &&  @is_file($this->cache_filename))
				{
					if ((time() - filemtime($this->cache_filename)) < $this->cache_lifetime)
					{
						readfile($this->cache_filename);
						exit;
					}
				}
				ob_start( array( &$this, 'cache_callback' ) );
			}
		}
525901
protected function setCache()
    {
        if ($this->cache) {
            $cacheFile = $this->getCacheFile();
            file_put_contents($cacheFile, $this->templateOutput);
        }
    }
1313694
public function set($key, $object, $timeout = 86400){
        return ($this->memcache) ? $this->memcache->set($this->prefix . '_' . $key, $object, $timeout) : false;
    }
516162
public static function setCacheDriver(Cache $cache = null, $namespace = null)
    {
        self::setCache(self::$cacheDriver, $cache, $namespace);
    }
344258
public function set(string $key, $value)
    {
        $array = &$this->input;
        $keys = explode('.', $key);

        while (count($keys) > 1) {
            $k = array_shift($keys);
            if (!isset($array[$k]) || ! is_array($array[$k])) {
                $array[$k] = [];
            }
            $array = &$array[$k];
        }

        $array[array_shift($keys)] = $value;
        $this->cache[$key] = &$value;
    }
384501
public function update_cache($key, $data)
    {
        if ($cache = $this->get_cache_engine()) {
            $cache->set($key, $data);
        }
    }
770739
public function setCache(FrontendInterface $cache)
    {
        $this->cache = $cache;
        $this->cacheIdentifier = $this->cache->getIdentifier();
    }