roundcubemail/program/lib/Roundcube/rcube.php
public function get_cache_shared($name, $packed=true)
    {
        $shared_name = "shared_$name";

        if (!array_key_exists($shared_name, $this->caches)) {
            $opt  = strtolower($name) . '_cache';
            $type = $this->config->get($opt);
            $ttl  = $this->config->get($opt . '_ttl');

            if (!$type) {
                // cache is disabled
                return $this->caches[$shared_name] = null;
            }

            if ($ttl === null) {
                $ttl = $this->config->get('shared_cache_ttl', '10d');
            }

            $this->caches[$shared_name] = new rcube_cache_shared($type, $name, $ttl, $packed);
        }

        return $this->caches[$shared_name];
    }
public function get_cache_shared($name, $packed=true)
    {
        $shared_name = "shared_$name";

        if (!array_key_exists($shared_name, $this->caches)) {
            $opt  = strtolower($name) . '_cache';
            $type = $this->config->get($opt);
            $ttl  = $this->config->get($opt . '_ttl');

            if (!$type) {
                // cache is disabled
                return $this->caches[$shared_name] = null;
            }

            if ($ttl === null) {
                $ttl = $this->config->get('shared_cache_ttl', '10d');
            }

            $this->caches[$shared_name] = new rcube_cache_shared($type, $name, $ttl, $packed);
        }

        return $this->caches[$shared_name];
    }
public function get_cache_shared ( $ name , $ packed = true ) { $ shared_name = "shared_$name" ; if ( ! array_key_exists ( $ shared_name , $ this -> caches ) ) { $ opt = strtolower ( $ name ) . '_cache' ; $ type = $ this -> config -> get ( $ opt ) ; $ ttl = $ this -> config -> get ( $ opt . '_ttl' ) ; if ( ! $ type ) { // cache is disabled return $ this -> caches [ $ shared_name ] = null ; } if ( $ ttl === null ) { $ ttl = $ this -> config -> get ( 'shared_cache_ttl' , '10d' ) ; } $ this -> caches [ $ shared_name ] = new rcube_cache_shared ( $ type , $ name , $ ttl , $ packed ) ; } return $ this -> caches [ $ shared_name ] ; }
Initialize and get shared cache object

@param string $name   Cache identifier
@param bool   $packed Enables/disables data serialization

@return rcube_cache_shared Cache object
Initialize and get shared cache object