示例#1
0
 /**
  * Ping API for connectivity test, and return result object.
  *
  * @author Vova Feldman (@svovaf)
  * @since  1.0.9
  *
  * @param null|string $unique_anonymous_id
  * @param bool        $is_update False if new plugin installation.
  *
  * @return object
  */
 function ping($unique_anonymous_id = null, $is_update = false)
 {
     return is_null($unique_anonymous_id) ? $this->_api->Ping() : $this->_call('ping.json?' . http_build_query(array('uid' => $unique_anonymous_id, 'is_update' => $is_update)));
 }
示例#2
0
 /**
  * Ping API for connectivity test, and return result object.
  *
  * @author   Vova Feldman (@svovaf)
  * @since    1.0.9
  *
  * @param null|string $unique_anonymous_id
  * @param array       $params
  *
  * @return object
  */
 function ping($unique_anonymous_id = null, $params = array())
 {
     $this->_logger->entrance();
     if (self::is_temporary_down()) {
         return $this->get_temporary_unavailable_error();
     }
     $pong = is_null($unique_anonymous_id) ? Freemius_Api::Ping() : $this->_call('ping.json?' . http_build_query(array_merge(array('uid' => $unique_anonymous_id), $params)));
     if ($this->is_valid_ping($pong)) {
         return $pong;
     }
     if (self::should_try_with_http($pong)) {
         // Fallback to HTTP, since HTTPS fails.
         Freemius_Api::SetHttp();
         self::$_options->set_option('api_force_http', true, true);
         $pong = is_null($unique_anonymous_id) ? Freemius_Api::Ping() : $this->_call('ping.json?' . http_build_query(array_merge(array('uid' => $unique_anonymous_id), $params)));
         if (!$this->is_valid_ping($pong)) {
             self::$_options->set_option('api_force_http', false, true);
         }
     }
     return $pong;
 }
 /**
  * Ping API for connectivity test, and return result object.
  *
  * @author Vova Feldman (@svovaf)
  * @since  1.0.9
  *
  *
  * @return object
  */
 function ping()
 {
     return $this->_api->Ping();
 }
示例#4
0
 /**
  * Ping API for connectivity test, and return result object.
  *
  * @author Vova Feldman (@svovaf)
  * @since  1.0.9
  *
  * @param null|string $unique_anonymous_id
  *
  * @return object
  */
 function ping($unique_anonymous_id = null)
 {
     return is_null($unique_anonymous_id) ? $this->_api->Ping() : $this->_call('ping.json?uid=' . $unique_anonymous_id);
 }