Example #1
0
 /**
  * Set AWS 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 AWS server time)
  * @return void
  */
 public static function setTimeCorrectionOffset($offset = 0)
 {
     if ($offset == 0) {
         $rest = new Assets_S3Request('HEAD');
         $rest = $rest->getResponse();
         $awstime = $rest->headers['date'];
         $systime = time();
         $offset = $systime > $awstime ? -($systime - $awstime) : $awstime - $systime;
     }
     self::$__timeOffset = $offset;
 }