From deb2b8d0804d1d25a3f28266747ce9041495b372 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Fri, 12 Jul 2013 10:17:32 +0200 Subject: Allow to load config files for different environments (#1487311); keep (non-default) filename in URLs throughout the webmail app --- program/lib/Roundcube/rcube.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'program/lib/Roundcube/rcube.php') diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php index 05a94f3be..ce97cd0a5 100644 --- a/program/lib/Roundcube/rcube.php +++ b/program/lib/Roundcube/rcube.php @@ -105,13 +105,14 @@ class rcube * This implements the 'singleton' design pattern * * @param integer Options to initialize with this instance. See rcube::INIT_WITH_* constants + * @param string Environment name to run (e.g. live, dev, test) * * @return rcube The one and only instance */ - static function get_instance($mode = 0) + static function get_instance($mode = 0, $env = '') { if (!self::$instance) { - self::$instance = new rcube(); + self::$instance = new rcube($env); self::$instance->init($mode); } @@ -122,10 +123,10 @@ class rcube /** * Private constructor */ - protected function __construct() + protected function __construct($env = '') { // load configuration - $this->config = new rcube_config; + $this->config = new rcube_config($env); $this->plugins = new rcube_dummy_plugin_api; register_shutdown_function(array($this, 'shutdown')); -- cgit v1.2.3