src/iOSbuild.php
public static function getCalendarUA($min = '5.0') {
    if (strpos($min, '.') === false && ctype_digit($min)) {
      $mins[0] = $min;
      $mins[1] = 0;
    }
    else {
      $mins = explode('.', $min);
    }
    $builds   = array();
    $versions = array();
    $n        = 0;
    self::populate();
    foreach (self::$BuildVer as $code => $val) {
      $parts = explode('.', $val);
      if ($parts[0] >= $mins[0] && $parts[1] >= $mins[1]) {
        $builds[$n]   = $code;
        $versions[$n] = $val;
        $n++;
      }
    }
    $ran = mt_rand(0, $n - 1);
    $ver = preg_replace('/b\d+$/', '', $versions[$ran]);
    return 'iOS/' . $ver . ' (' . $builds[$ran] . ') dataaccessd/1.0';
  }
public static function getCalendarUA($min = '5.0') {
    if (strpos($min, '.') === false && ctype_digit($min)) {
      $mins[0] = $min;
      $mins[1] = 0;
    }
    else {
      $mins = explode('.', $min);
    }
    $builds   = array();
    $versions = array();
    $n        = 0;
    self::populate();
    foreach (self::$BuildVer as $code => $val) {
      $parts = explode('.', $val);
      if ($parts[0] >= $mins[0] && $parts[1] >= $mins[1]) {
        $builds[$n]   = $code;
        $versions[$n] = $val;
        $n++;
      }
    }
    $ran = mt_rand(0, $n - 1);
    $ver = preg_replace('/b\d+$/', '', $versions[$ran]);
    return 'iOS/' . $ver . ' (' . $builds[$ran] . ') dataaccessd/1.0';
  }
public static function getCalendarUA ( $ min = '5.0' ) { if ( strpos ( $ min , '.' ) === false && ctype_digit ( $ min ) ) { $ mins [ 0 ] = $ min ; $ mins [ 1 ] = 0 ; } else { $ mins = explode ( '.' , $ min ) ; } $ builds = array ( ) ; $ versions = array ( ) ; $ n = 0 ; self :: populate ( ) ; foreach ( self :: $ BuildVer as $ code => $ val ) { $ parts = explode ( '.' , $ val ) ; if ( $ parts [ 0 ] >= $ mins [ 0 ] && $ parts [ 1 ] >= $ mins [ 1 ] ) { $ builds [ $ n ] = $ code ; $ versions [ $ n ] = $ val ; $ n ++ ; } } $ ran = mt_rand ( 0 , $ n - 1 ) ; $ ver = preg_replace ( '/b\d+$/' , '' , $ versions [ $ ran ] ) ; return 'iOS/' . $ ver . ' (' . $ builds [ $ ran ] . ') dataaccessd/1.0' ; }
Returns a randomly chosen iOS Calendar User Agent string.
@param  string $min .... minimum version
Format: 'MAJOR.MINOR' (1 dot only)
@return string
@throws \Exception
Returns a randomly chosen iOS Calendar User Agent string .