protected function webKitBuildToSafariVer($version)
    {
        $verParts = explode('.', $version);

        //We need a 3 parts version (version 2 will becomes 2.0.0)
        while (count($verParts) < 3) {
            $verParts[] = 0;
        }
        foreach ($verParts as $i => $currPart) {
            $verParts[$i] = $this->parseInt($currPart);
        }

        switch ($verParts[0]) {
            case 419: $result = '2.0.4';
                break;

            case 418:
                if ($verParts[1] >= 8) {
                    $result = '2.0.4';
                } else {
                    $result = '2.0.3';
                }
                break;

            case 417: $result = '2.0.3';
                break;

            case 416: $result = '2.0.2';
                break;

            case 412:
                if ($verParts[1] >= 7) {
                    $result = '2.0.1';
                } else {
                    $result = '2.0';
                }
                break;

            case 312:
                if ($verParts[1] >= 8) {
                    $result = '1.3.2';
                } else {
                    if ($verParts[1] >= 5) {
                        $result = '1.3.1';
                    } else {
                        $result = '1.3';
                    }
                }
                break;

            case 125:
                if ($this->compareVersions('5.4', $verParts[1] . '.' . $verParts[2]) == -1) {
                    $result = '1.2.4'; //125.5.5+
                } else {
                    if ($verParts[1] >= 4) {
                        $result = '1.2.3';
                    } else {
                        if ($verParts[1] >= 2) {
                            $result = '1.2.2';
                        } else {
                            $result = '1.2';
                        }
                    }
                }
                break;

            //WebKit 100 can be either Safari 1.1 (Safari build 100) or 1.1.1 (Safari build 100.1)
            //for this reason, check the Safari build before the WebKit build.
            case 100: $result = '1.1.1';
                break;

            case 85:
                if ($verParts[1] >= 8) {
                    $result = '1.0.3';
                } else {
                    if ($verParts[1] >= 7) {
                        //WebKit 85.7 can be either Safari 1.0 (Safari build 85.5) or 1.0.2 (Safari build 85.7)
                        //for this reason, check the Safari build before the WebKit build.
                        $result = '1.0.2';
                    } else {
                        $result = '1.0';
                    }
                }
                break;

            case 73: $result = '0.9';
                break;
            case 51: $result = '0.8.1';
                break;
            case 48: $result = '0.8';
                break;

            default: $result = '';
        }

        return $result;
    }
protected function webKitBuildToSafariVer($version)
    {
        $verParts = explode('.', $version);

        //We need a 3 parts version (version 2 will becomes 2.0.0)
        while (count($verParts) < 3) {
            $verParts[] = 0;
        }
        foreach ($verParts as $i => $currPart) {
            $verParts[$i] = $this->parseInt($currPart);
        }

        switch ($verParts[0]) {
            case 419: $result = '2.0.4';
                break;

            case 418:
                if ($verParts[1] >= 8) {
                    $result = '2.0.4';
                } else {
                    $result = '2.0.3';
                }
                break;

            case 417: $result = '2.0.3';
                break;

            case 416: $result = '2.0.2';
                break;

            case 412:
                if ($verParts[1] >= 7) {
                    $result = '2.0.1';
                } else {
                    $result = '2.0';
                }
                break;

            case 312:
                if ($verParts[1] >= 8) {
                    $result = '1.3.2';
                } else {
                    if ($verParts[1] >= 5) {
                        $result = '1.3.1';
                    } else {
                        $result = '1.3';
                    }
                }
                break;

            case 125:
                if ($this->compareVersions('5.4', $verParts[1] . '.' . $verParts[2]) == -1) {
                    $result = '1.2.4'; //125.5.5+
                } else {
                    if ($verParts[1] >= 4) {
                        $result = '1.2.3';
                    } else {
                        if ($verParts[1] >= 2) {
                            $result = '1.2.2';
                        } else {
                            $result = '1.2';
                        }
                    }
                }
                break;

            //WebKit 100 can be either Safari 1.1 (Safari build 100) or 1.1.1 (Safari build 100.1)
            //for this reason, check the Safari build before the WebKit build.
            case 100: $result = '1.1.1';
                break;

            case 85:
                if ($verParts[1] >= 8) {
                    $result = '1.0.3';
                } else {
                    if ($verParts[1] >= 7) {
                        //WebKit 85.7 can be either Safari 1.0 (Safari build 85.5) or 1.0.2 (Safari build 85.7)
                        //for this reason, check the Safari build before the WebKit build.
                        $result = '1.0.2';
                    } else {
                        $result = '1.0';
                    }
                }
                break;

            case 73: $result = '0.9';
                break;
            case 51: $result = '0.8.1';
                break;
            case 48: $result = '0.8';
                break;

            default: $result = '';
        }

        return $result;
    }
protected function webKitBuildToSafariVer ( $ version ) { $ verParts = explode ( '.' , $ version ) ; //We need a 3 parts version (version 2 will becomes 2.0.0) while ( count ( $ verParts ) < 3 ) { $ verParts [ ] = 0 ; } foreach ( $ verParts as $ i => $ currPart ) { $ verParts [ $ i ] = $ this -> parseInt ( $ currPart ) ; } switch ( $ verParts [ 0 ] ) { case 419 : $ result = '2.0.4' ; break ; case 418 : if ( $ verParts [ 1 ] >= 8 ) { $ result = '2.0.4' ; } else { $ result = '2.0.3' ; } break ; case 417 : $ result = '2.0.3' ; break ; case 416 : $ result = '2.0.2' ; break ; case 412 : if ( $ verParts [ 1 ] >= 7 ) { $ result = '2.0.1' ; } else { $ result = '2.0' ; } break ; case 312 : if ( $ verParts [ 1 ] >= 8 ) { $ result = '1.3.2' ; } else { if ( $ verParts [ 1 ] >= 5 ) { $ result = '1.3.1' ; } else { $ result = '1.3' ; } } break ; case 125 : if ( $ this -> compareVersions ( '5.4' , $ verParts [ 1 ] . '.' . $ verParts [ 2 ] ) == - 1 ) { $ result = '1.2.4' ; //125.5.5+ } else { if ( $ verParts [ 1 ] >= 4 ) { $ result = '1.2.3' ; } else { if ( $ verParts [ 1 ] >= 2 ) { $ result = '1.2.2' ; } else { $ result = '1.2' ; } } } break ; //WebKit 100 can be either Safari 1.1 (Safari build 100) or 1.1.1 (Safari build 100.1) //for this reason, check the Safari build before the WebKit build. case 100 : $ result = '1.1.1' ; break ; case 85 : if ( $ verParts [ 1 ] >= 8 ) { $ result = '1.0.3' ; } else { if ( $ verParts [ 1 ] >= 7 ) { //WebKit 85.7 can be either Safari 1.0 (Safari build 85.5) or 1.0.2 (Safari build 85.7) //for this reason, check the Safari build before the WebKit build. $ result = '1.0.2' ; } else { $ result = '1.0' ; } } break ; case 73 : $ result = '0.9' ; break ; case 51 : $ result = '0.8.1' ; break ; case 48 : $ result = '0.8' ; break ; default : $ result = '' ; } return $ result ; }
Convert a WebKit build number to a Safari version number.
@access protected
@param string $version A string representing the version number.
@link http://web.archive.org/web/20080514173941/http://developer.apple.com/internet/safari/uamatrix.html
@return string Returns the Safari version string. If the version can't be determined, an empty string is
returned.
Convert a WebKit build number to a Safari version number .