public static function getInstance()
 {
     if (self::$instance === null) {
         self::$instance = new self();
     }
     return self::$instance;
 }
示例#2
0
 public function initMiteObjects()
 {
     # do nothing if the user is not logged in
     if (!auth_get_current_user_cookie()) {
         return;
     }
     $this->i_userId = auth_get_current_user_id();
     $this->o_miteRemote = mite::getInstance();
     $this->o_mitePartialsController = mitePartialsController::getInstance();
     # only fill session with user data, if there's a user currently logged in
     if (current_user_get_field(Mantis2mitePlugin::DB_FIELD_CONNECT_VERIFIED)) {
         $this->o_miteUserData = new miteUserData($this, $this->i_userId);
         $this->o_miteRemote->init($this->getDecodedUserValue(self::DB_FIELD_API_KEY), $this->getDecodedUserValue(self::DB_FIELD_ACCOUNT_NAME));
     }
     return true;
 }