/**
  * Find clock diff between server and API server, and store the diff locally.
  *
  * @return bool|int False if clock diff didn't change, otherwise returns the clock diff in seconds.
  */
 private function _sync_clock_diff()
 {
     $this->_logger->entrance();
     // Sync clock and store.
     $new_clock_diff = $this->_api->FindClockDiff();
     if ($new_clock_diff === self::$_clock_diff) {
         return false;
     }
     // Update API clock's diff.
     $this->_api->SetClockDiff(self::$_clock_diff);
     // Store new clock diff in storage.
     self::$_options->set_option('api_clock_diff', self::$_clock_diff, true);
     return $new_clock_diff;
 }
Beispiel #2
0
 /**
  * Find clock diff between server and API server, and store the diff locally.
  *
  * @param bool|int $diff
  *
  * @return bool|int False if clock diff didn't change, otherwise returns the clock diff in seconds.
  */
 private function _sync_clock_diff($diff = false)
 {
     $this->_logger->entrance();
     // Sync clock and store.
     $new_clock_diff = false === $diff ? Freemius_Api::FindClockDiff() : $diff;
     if ($new_clock_diff === self::$_clock_diff) {
         return false;
     }
     self::$_clock_diff = $new_clock_diff;
     // Update API clock's diff.
     Freemius_Api::SetClockDiff(self::$_clock_diff);
     // Store new clock diff in storage.
     self::$_options->set_option('api_clock_diff', self::$_clock_diff, true);
     return $new_clock_diff;
 }