Exemple #1
0
 /**
  * Determines if we have configured our API key, that we have requests to
  * send, and processes them.
  */
 public static function send()
 {
     try {
         if (!function_exists('curl_version')) {
             throw new BattleNetAPI_Exception('It appears that cURL is not enabled. Please check your server configuration.');
         }
         if (!self::haveKey()) {
             throw new BattleNetAPI_Exception('An API key is required to interact with the Battle.net API services. If you do not have a key, please create one at <a href="https://dev.battle.net/" target="_blank">https://dev.battle.net/</a>.');
         }
         self::$totalRequests = count(self::$requests);
         if (self::$totalRequests == 0) {
             throw new BattleNetAPI_Exception('There were no requests to be sent.');
         }
         self::processRequests();
     } catch (BattleNetAPI_Exception $exception) {
         $exception->showMessage();
     }
 }