コード例 #1
0
 /**
  * Activate the license
  */
 protected function activate_license()
 {
     try {
         $activation = $this->api->activate_license();
     } catch (API_Exception $e) {
         $this->notices->add($e->getMessage(), 'warning');
         return;
     }
     $this->license->activation_key = $activation->key;
     $this->license->activated = true;
     $this->license->save();
     $this->notices->add($activation->message, 'info');
 }
コード例 #2
0
 /**
  * Fetch array of available updates from remote server
  *
  * @return array
  */
 protected function fetch_updates()
 {
     if (is_array($this->available_updates)) {
         return $this->available_updates;
     }
     // fetch remote info
     try {
         $remote_plugins = $this->api->get_plugins($this->extensions);
     } catch (API_Exception $e) {
         return array();
     }
     // filter remote plugins, we only want the ones with an update available
     $this->available_updates = $this->filter_remote_plugins($remote_plugins);
     return $this->available_updates;
 }