Changeset 5935
- Timestamp:
- 09/18/2017 08:21:04 PM (7 years ago)
- Location:
- sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/browsers.php
r5934 r5935 8 8 9 9 /** 10 * Browser current version numbers.10 * Returns current version numbers for all browsers. 11 11 * 12 12 * These are for major release branches, not full build numbers. 13 13 * Firefox 3.6, 4, etc., not Chrome 11.0.696.65. 14 * 15 * @return array Associative array of browser names with their respective 16 * current (or somewhat current) version number. 14 17 */ 15 18 function get_browser_current_versions() { … … 23 26 } 24 27 28 /** 29 * Returns browser data for a given browser. 30 * 31 * @param string|false $browser The name of the browser. Default false. 32 * @return false|array { 33 * Array of data about the browser. False if the browser is unknown. 34 * 35 * @type string $name Name of the browser. 36 * @type string $wikipedia Wikipedia name for the browser. 37 * @type int|float $normalized How should browser version number be 38 * normalized? 1 == just first number, else 39 * include second number (i.e. decimal value) 40 * @type string $url The home URL for the browser. 41 * @type string $img_src The non-HTTPs URL for the browser's logo image. 42 * @type string $img_src_ssl The HTTPS URL for the browser's logo image. 43 * } 44 */ 25 45 function browsehappy_api_get_browser_data( $browser = false ) { 26 46 -
sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/index.php
r5934 r5935 33 33 } 34 34 35 /** 36 * Logs anonymized user-agent data. 37 * 38 * @param string $ua The user-agent string. 39 * @param array $data Parsed user-agent data. 40 */ 35 41 function bh_record_data( $ua, $data ) { 36 42 global $wpdb; -
sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/parse.php
r5934 r5935 7 7 8 8 /** 9 * Parses a user agent string into its important parts 10 * 11 * @param string $user_agent 12 * 13 * @return array containing platform, name, and version 14 */ 9 * Parses a user agent string into its important parts. 10 * 11 * @param string $user_agent The user agent string for a browser. 12 * @return array { 13 * Array containing data based on the parsing of the user agent. 14 * 15 * @type string $platform The platform running the browser. 16 * @type string $name The name of the browser. 17 * @type string $version The reported version of the browser. 18 * @type string $update_url The URL to obtain the update for the browser. 19 * @type string $img_src The non-HTTPS URL for the browser's logo image. 20 * @type string $img_src_ssl The HTTPS URL for the browser's logo image. 21 * @type string $current_version The current latest version of the browser. 22 * @type bool $upgrade Is there an update available for the browser? 23 * @type bool $insecure Is the browser insecure? 24 * } 25 */ 15 26 function browsehappy_parse_user_agent( $user_agent ) { 16 27 $data = array(); … … 104 115 } 105 116 117 /** 118 * Returns the current version for the given browser. 119 * 120 * @param string $name The name of the browser. 121 * @return string The version for the browser or an empty string if an 122 * unknown browser. 123 */ 106 124 function get_browser_version_from_name( $name ) { 107 125 $versions = get_browser_current_versions();
Note: See TracChangeset
for help on using the changeset viewer.