Example #1
0
 protected static function getSphinxConnIndexFromCache()
 {
     self::$sphinxCache = kCacheManager::getSingleLayerCache(kCacheManager::CACHE_TYPE_SPHINX_STICKY_SESSIONS);
     if (!self::$sphinxCache) {
         return false;
     }
     self::$stickySessionKey = self::getStickySessionKey();
     $preferredIndex = self::$sphinxCache->get(self::$stickySessionKey);
     if ($preferredIndex === false) {
         return false;
     }
     self::$cachedConnIndex = (int) $preferredIndex;
     //$preferredIndex returns from self::$sphinxCache->get(..) in type string
     return $preferredIndex;
 }