diff options
author | Thomas Bruederli <thomas@roundcube.net> | 2012-06-20 18:39:54 +0200 |
---|---|---|
committer | Thomas Bruederli <thomas@roundcube.net> | 2012-06-20 18:39:54 +0200 |
commit | 6bb44a644ad9a256f2cd154cfbdb7bdfede3fa6a (patch) | |
tree | b753a193d3cf268f41fa9cd95e6d365eae54c164 /program/include/rcube.php | |
parent | 1fe450b5aa830b44fa093d87f0fb71965a9f36cb (diff) |
Initialize rcube instance (with options); no caches without a valid user_id
Diffstat (limited to 'program/include/rcube.php')
-rw-r--r-- | program/include/rcube.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/program/include/rcube.php b/program/include/rcube.php index 1bfe93d6c..3b1601578 100644 --- a/program/include/rcube.php +++ b/program/include/rcube.php @@ -106,12 +106,14 @@ class rcube /** * This implements the 'singleton' design pattern * + * @param integer Options to initialize with this instance. See rcube::INIT_WITH_* constants * @return rcube The one and only instance */ - static function get_instance() + static function get_instance($mode = 0) { if (!self::$instance) { self::$instance = new rcube(); + self::$instance->init($mode); } return self::$instance; @@ -240,8 +242,7 @@ class rcube */ public function get_cache($name, $type='db', $ttl=0, $packed=true) { - if (!isset($this->caches[$name])) { - $userid = $this->get_user_id(); + if (!isset($this->caches[$name]) && ($userid = $this->get_user_id())) { $this->caches[$name] = new rcube_cache($type, $userid, $name, $ttl, $packed); } |