Esempio n. 1
0
 /**
  * Set SCS time correction offset (use carefully)
  *
  * This can be used when an inaccurate system time is generating
  * invalid request signatures.  It should only be used as a last
  * resort when the system time cannot be changed.
  *
  * @param string $offset Time offset (set to zero to use SCS server time)
  * @return void
  */
 public static function setTimeCorrectionOffset($offset = 0)
 {
     if ($offset == 0) {
         $rest = new SCSRequest('HEAD');
         $rest = $rest->getResponse();
         $awstime = $rest->headers['date'];
         $systime = time();
         $offset = $systime > $awstime ? -($systime - $awstime) : $awstime - $systime;
     }
     self::$__timeOffset = $offset;
 }