original_string: public static function check($force = false, $interval = null)
      {
          if (!SettingsPiwik::isAutoUpdateEnabled()) {
              return;
          }
  
          if ($interval === null) {
              $interval = self::CHECK_INTERVAL;
          }
  
          $lastTimeChecked = Option::get(self::LAST_TIME_CHECKED);
          if ($force
              || $lastTimeChecked === false
              || time() - $interval > $lastTimeChecked
          ) {
              // set the time checked first, so that parallel Piwik requests don't all trigger the http requests
              Option::set(self::LAST_TIME_CHECKED, time(), $autoLoad = 1);
  
              $latestVersion = self::getLatestAvailableVersionNumber();
              $latestVersion = trim((string) $latestVersion);
              if (!preg_match('~^[0-9][0-9a-zA-Z_.-]*$~D', $latestVersion)) {
                  $latestVersion = '';
              }
  
              Option::set(self::LATEST_VERSION, $latestVersion);
          }
      }
code: public static function check($force = false, $interval = null)
      {
          if (!SettingsPiwik::isAutoUpdateEnabled()) {
              return;
          }
  
          if ($interval === null) {
              $interval = self::CHECK_INTERVAL;
          }
  
          $lastTimeChecked = Option::get(self::LAST_TIME_CHECKED);
          if ($force
              || $lastTimeChecked === false
              || time() - $interval > $lastTimeChecked
          ) {
              // set the time checked first, so that parallel Piwik requests don't all trigger the http requests
              Option::set(self::LAST_TIME_CHECKED, time(), $autoLoad = 1);
  
              $latestVersion = self::getLatestAvailableVersionNumber();
              $latestVersion = trim((string) $latestVersion);
              if (!preg_match('~^[0-9][0-9a-zA-Z_.-]*$~D', $latestVersion)) {
                  $latestVersion = '';
              }
  
              Option::set(self::LATEST_VERSION, $latestVersion);
          }
      }
code_tokens: public static function check ( $ force = false , $ interval = null ) { if ( ! SettingsPiwik :: isAutoUpdateEnabled ( ) ) { return ; } if ( $ interval === null ) { $ interval = self :: CHECK_INTERVAL ; } $ lastTimeChecked = Option :: get ( self :: LAST_TIME_CHECKED ) ; if ( $ force || $ lastTimeChecked === false || time ( ) - $ interval > $ lastTimeChecked ) { // set the time checked first, so that parallel Piwik requests don't all trigger the http requests Option :: set ( self :: LAST_TIME_CHECKED , time ( ) , $ autoLoad = 1 ) ; $ latestVersion = self :: getLatestAvailableVersionNumber ( ) ; $ latestVersion = trim ( ( string ) $ latestVersion ) ; if ( ! preg_match ( '~^[0-9][0-9a-zA-Z_.-]*$~D' , $ latestVersion ) ) { $ latestVersion = '' ; } Option :: set ( self :: LATEST_VERSION , $ latestVersion ) ; } }
docstring: Check for a newer version
  
  @param bool $force Force check
  @param int $interval Interval used for update checks
docstring_tokens: Check for a newer version