示例#1
0
 /**
  * @see parent
  *
  * @param Bronto_Api $api
  */
 public function onBeforeLogin($api)
 {
     if ($this->hasSetSession()) {
         $this->unsSessionId();
         Mage::helper('bronto_common')->writeDebug('Session ID expired for token: ' . $this->getToken());
         $this->_setOnce = false;
     } else {
         try {
             parent::load($api->getToken());
             if ($this->hasSessionId()) {
                 $api->setSessionId($this->getSessionId());
                 Mage::helper('bronto_common')->writeDebug('Hitting API sessionId cache for token: ' . $this->getToken());
                 $this->_setOnce = true;
             }
         } catch (Exception $e) {
             // Swallow read exceptions, in case of FTP install
             Mage::helper('bronto_common')->writeError('Failed to read from api session table: ' . $e->getMessage());
         }
     }
 }