Get global handle for memcache access

@return object Memcache
438097
public function get_memcache()
    {
        if (!isset($this->memcache)) {
            // no memcache support in PHP
            if (!class_exists('Memcache')) {
                $this->memcache = false;
                return false;
            }

            $this->memcache     = new Memcache;
            $this->memcache_init();

            // test connection and failover (will result in $this->mc_available == 0 on complete failure)
            $this->memcache->increment('__CONNECTIONTEST__', 1);  // NOP if key doesn't exist

            if (!$this->mc_available) {
                $this->memcache = false;
            }
        }

        return $this->memcache;
    }
1280647
public function getMemcacheConnection(array $options = [])
    {
        $options = array_replace(['host' => 'localhost', 'port' => 11211], $options);
        if (null !== $cache = $this->getConnection('memcache', $options)) {
            return $cache;
        }

        if (!extension_loaded('memcache')) {
            throw new RuntimeException('The Memcache cache requires the Memcache extension.');
        }

        $memcache = new \Memcache();
        $memcache->addServer($options['host'], $options['port']);

        $key = sprintf("%s:%s", $options['host'], $options['port']);
        $stats = @$memcache->getExtendedStats();

        if (!isset($stats[$key]) || false === $stats[$key]) {
            throw new RuntimeException(sprintf("Memcache instance with host '%s' and port '%s' is not reachable.", $options['host'], $options['port']));
        }

        return $this->setConnection('memcache', $options, $memcache);
    }
130672
public static MemcachedManagerBuilder memcacheAddOn() {
        final String memcacheServers = System.getenv("MEMCACHE_SERVERS");
        return memcachedConfig()
                .username(System.getenv("MEMCACHE_USERNAME"))
                .password(System.getenv("MEMCACHE_PASSWORD"))
                .url(memcacheServers == null ? DEFAULT_URL : memcacheServers);
    }
1223870
protected function _getSchemaCache()
    {
        try {
            $connection = ConnectionManager::get($this->params['connection']);

            return new SchemaCache($connection);
        } catch (RuntimeException $e) {
            $this->abort($e->getMessage());
        }
    }
268829
public function getAccessToken() {
        if (!is_null($this->_cachedAccessToken) &&
            $this->_cachedAccessToken->isValid()) {
            return $this->_cachedAccessToken;
        }

        $this->_cachedAccessToken = $this->acquireAccessToken();
        return $this->_cachedAccessToken;
    }
1036659
public function getHandle()
    {
        if(!$handle = $this->getProperty($this->getIdentityKey())) {
            $handle = parent::getHandle();
        }

        return $handle;
    }
1006200
function getDictionary()
    {
        if (isset($this->local_dictionary)){
            return $this->local_dictionary;
        }else
        if ($this->parent){
            return $this->parent->getDictionary();
        }else{
            self::loadGlobalDictionary();
            return self::$global_dictionary;
        }
    }
781901
private function get_access_token() {
        global $SESSION;
        if (isset($SESSION->{self::SESSIONKEY}) && $SESSION->{self::SESSIONKEY}) {
            $this->client->setAccessToken($SESSION->{self::SESSIONKEY});
            return $SESSION->{self::SESSIONKEY};
        }
        return null;
    }
1017165
protected function _getCatCache()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        // first look at the local cache
        $aLocalCatCache = $myConfig->getGlobalParameter('aLocalCatCache');

        // if local cache is not set - loading from file cache
        if (!$aLocalCatCache) {
            $sLocalCatCache = \OxidEsales\Eshop\Core\Registry::getUtils()->fromFileCache('aLocalCatCache');
            if ($sLocalCatCache) {
                $aLocalCatCache = $sLocalCatCache;
            } else {
                $aLocalCatCache = null;
            }
            $myConfig->setGlobalParameter('aLocalCatCache', $aLocalCatCache);
        }

        return $aLocalCatCache;
    }
289337
public function getContextHash()
    {
        if ($this->areAuthorizationChecksDisabled()) {
            return self::CONTEXT_HASH_UNINITIALIZED;
        }
        if (!$this->isInitialized()) {
            if (!$this->canBeInitialized()) {
                return self::CONTEXT_HASH_UNINITIALIZED;
            }
            $this->initialize();
        }

        if ($this->contextHash !== null) {
            return $this->contextHash;
        }

        $contextHashSoFar = implode('|', array_keys($this->getRoles()));

        $this->withoutAuthorizationChecks(function () use (&$contextHashSoFar) {
            foreach ($this->globalObjects as $globalObjectsRegisteredClassName) {
                if (is_subclass_of($globalObjectsRegisteredClassName, CacheAwareInterface::class)) {
                    $globalObject = $this->objectManager->get($globalObjectsRegisteredClassName);
                    $contextHashSoFar .= '<' . $globalObject->getCacheEntryIdentifier();
                }
            }
        });

        $this->contextHash = md5($contextHashSoFar);

        return $this->contextHash;
    }
714443
public function getGlobals()
    {
        if (!$this->runtimeInitialized && !$this->extensionInitialized) {
            return $this->initGlobals();
        }

        if (null === $this->globals) {
            $this->globals = $this->initGlobals();
        }

        return $this->globals;
    }
8105
private function getDwnlCustomer()
    {
        if (is_null($this->cacheDwnlCust)) {
            $custId = $this->session->getCustomerId();
            $this->cacheDwnlCust = $this->daoDwnlCust->getById($custId);
        }
        return $this->cacheDwnlCust;
    }
988375
public function getCache()
    {
        if (null == $this->cache) {
            $this->setCache(Cache::get(Cache::CACHE_MEMORY));
        }
        return $this->cache;
    }
9891
public function getHandle()
    {
        if (isset($this->_identity_key)) {
            $handle = $this->getProperty($this->_identity_key);
        } else {
            $handle = parent::getHandle();
        }

        return $handle;
    }
1305854
private function cachedAllGlobal() {
		if (!isset($this->{__METHOD__})) {
			$this->{__METHOD__} = array_merge($this->cachedGlobalI(), $this->cachedGlobalObjectsI());
		}
		return $this->{__METHOD__};
	}
324809
public function getMemcached()
    {
        if ($this->_cache === null) {
            if (!extension_loaded('memcached')) {
                throw new InvalidConfigException('MemCached requires PHP memcached extension to be loaded.');
            }

            $this->_cache = $this->persistentId !== null ? new \Memcached($this->persistentId) : new \Memcached;
            if ($this->username !== null || $this->password !== null) {
                $this->_cache->setOption(\Memcached::OPT_BINARY_PROTOCOL, true);
                $this->_cache->setSaslAuthData($this->username, $this->password);
            }
            if (!empty($this->options)) {
                $this->_cache->setOptions($this->options);
            }
        }

        return $this->_cache;
    }
117175
public function getCached()
    {
        return $this->app['cache']->remember($this->config('cache.key'), $this->config('cache.lifetime'), function () {
            return $this->toCollection()->toArray();
        });
    }