public static function getInstance() { if (is_null(self::$instance)) { $prefs = Preferences::getInstance(); if (!$prefs) { die_error('get Preferences failed', __FILE__, __LINE__); } $mods_enable = $prefs->get('general', 'module_enable'); if (!in_array('UserDB', $mods_enable)) { die_error(_('UserDB module must be enabled'), __FILE__, __LINE__); } $mod_app_name = 'UserDB_' . $prefs->get('UserDB', 'enable'); self::$instance = new $mod_app_name(); } return self::$instance; }
public static function getInstance() { if (!self::$instance instanceof self) { self::$instance = new self(); } return self::$instance; }