com web/pecl: we do not support old browser since long, get rid of that too: include/browser.php include/pear-prepend.php templates/packages.html
| From: | Pierre Joye | Date: | Mon, 30 Mar 2015 05:02:14 +0000 |
| Subject: | com web/pecl: we do not support old browser since long, get rid of that too: include/browser.php include/pear-prepend.php templates/packages.html | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-21981@lists.php.net to get a copy of this message | ||
Commit: 16c18d31f3feb7b936ffb44d2e1c4d649f97e759
Author: Pierre Joye <pierre.php@gmail.com> Mon, 30 Mar 2015 07:02:14 +0200
Parents: 023eea61b308de8fd4eed0681943878768b49b02
Branches: master
Link: http://git.php.net/?p=web/pecl.git;a=commitdiff;h=16c18d31f3feb7b936ffb44d2e1c4d649f97e759
Log:
we do not support old browser since long, get rid of that too
Changed paths:
D include/browser.php
M include/pear-prepend.php
M templates/packages.html
diff --git a/include/browser.php b/include/browser.php deleted file mode 100755 index fbddcaa..0000000 --- a/include/browser.php +++ /dev/null @@ -1,158 +0,0 @@ -<?php -/* - +----------------------------------------------------------------------+ - | PEAR Web site version 1.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 2001-2003 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Richard Heyes | - +----------------------------------------------------------------------+ - $Id$ -*/ - -/** -* Based on PEAR::Net_UserAgent_Detect -*/ - -class browser -{ - /** - * Array that stores all of the flags for the vendor and version of - * the different browsers. The flags key values are show in the array. - * @var array $browser - */ - var $browser = array('ns', 'ns2', 'ns3', 'ns4', 'ns4up', 'nav', 'ns6', 'ns6up', 'gecko', 'ie', 'ie3', 'ie4', 'ie4up', 'ie5', 'ie5_5', 'ie5up', 'ie6', 'ie6up', 'opera', 'opera2', 'opera3', 'opera4', 'opera5', 'opera5up', 'aol', 'aol3', 'aol4', 'aol5', 'aol6', 'aol7', 'webtv', 'aoltv', 'tvnavigator', 'hotjava', 'hotjava3', 'hotjava3up'); - - /** - * The leading identifier is the very first term in the user agent string, which is - * used to identify clients which are not Mosaic-based browsers. - * @var string $leadingIdentifier - */ - var $leadingIdentifier = ''; - - /** - * The full version of the client as supplied by the very first numbers in the user agent - * @var float $version - */ - var $version = 0; - - /** - * The major part of the client version, which is the integer value of the version. - * @var integer $majorVersion - */ - var $majorVersion = 0; - - /** - * The minor part of the client version, which is the decimal parts of the version - * @var float $subVersion - */ - var $subVersion = 0; - - /** - * Constructor - * - * @param - */ - function browser($in_useragent = null) - { - $this->detect($in_useragent); - } - - /** - * Detect the user agent and prepare flags, features and quirks based on what is found - * - * This is the core of the Net_UserAgent_Detect class. It moves its way through the user agent - * string setting up the flags based on the vendors and versions of the browsers, determining - * the OS and setting up the features and quirks owned by each of the relevant clients. - * - * @access public - * @param string (optional) user agent override - * @return void - */ - function detect($in_userAgent = null) - { - // Detemine what user agent we are using - if (is_null($in_userAgent)) { - if (isset($GLOBALS['HTTP_SERVER_VARS']['HTTP_USER_AGENT'])) { - $this->userAgent = $GLOBALS['HTTP_SERVER_VARS']['HTTP_USER_AGENT']; - } else { - $this->userAgent = ''; - } - } else { - $this->userAgent = $in_userAgent; - } - - // Get the lowercase version for case-insensitive searching - $agt = strtolower($this->userAgent); - - // Initialize the flag arrays - $brwsr =& $this->browser; - $brwsr = array_flip($brwsr); - - // Get the type and version of the client - preg_match(";^([[:alpha:]]+)[ /\(]*[[:alpha:]]*([\d]*)\.([\d\.]*);", $agt, $matches); - @list(, $this->leadingIdentifier, $this->majorVersion, $this->subVersion) = $matches; - if (empty($this->leadingIdentifier)) { - $this->leadingIdentifier = 'Unknown'; - } - - $this->version = $this->majorVersion . '.' . $this->subVersion; - - $brwsr['konq'] = (strpos($agt, 'konqueror') !== false); - $brwsr['text'] = (strpos($agt, 'links') !== false) || (strpos($agt, 'lynx') !== false) || (strpos($agt, 'w3m') !== false); - $brwsr['ns'] = (strpos($agt, 'mozilla') !== false) && !(strpos($agt, 'spoofer') !== false) && !(strpos($agt, 'compatible') !== false) && !(strpos($agt, 'hotjava') !== false) && !(strpos($agt, 'opera') !== false) && !(strpos($agt, 'webtv') !== false) ? 1 : 0; - $brwsr['ns2'] = $brwsr['ns'] && $this->majorVersion == 2; - $brwsr['ns3'] = $brwsr['ns'] && $this->majorVersion == 3; - $brwsr['ns4'] = $brwsr['ns'] && $this->majorVersion == 4; - $brwsr['ns4up'] = $brwsr['ns'] && $this->majorVersion >= 4; - // determine if this is a Netscape Navigator - $brwsr['nav'] = $brwsr['ns'] && ((strpos($agt, ';nav') !== false) || ((strpos($agt, '; nav') !== false))); - $brwsr['ns6'] = !$brwsr['konq'] && $brwsr['ns'] && $this->majorVersion == 5; - $brwsr['ns6up'] = $brwsr['ns6'] && $this->majorVersion >= 5; - $brwsr['gecko'] = (strpos($agt, 'gecko') !== false); - $brwsr['ie'] = (strpos($agt, 'msie') !== false) && !(strpos($agt, 'opera') !== false); - $brwsr['ie3'] = $brwsr['ie'] && $this->majorVersion < 4; - $brwsr['ie4'] = $brwsr['ie'] && $this->majorVersion == 4 && (strpos($agt, 'msie 4') !== false); - $brwsr['ie4up'] = $brwsr['ie'] && $this->majorVersion >= 4; - $brwsr['ie5'] = $brwsr['ie'] && $this->majorVersion == 4 && (strpos($agt, 'msie 5.0') !== false); - $brwsr['ie5_5'] = $brwsr['ie'] && $this->majorVersion == 4 && (strpos($agt, 'msie 5.5') !== false); - $brwsr['ie5up'] = $brwsr['ie'] && !$brwsr['ie3'] && !$brwsr['ie4']; - $brwsr['ie5_5up'] = $brwsr['ie'] && !$brwsr['ie3'] && !$brwsr['ie4'] && !$brwsr['ie5']; - $brwsr['ie6'] = $brwsr['ie'] && $this->majorVersion == 4 && (strpos($agt, 'msie 6.') !== false); - $brwsr['ie6up'] = $brwsr['ie'] && !$brwsr['ie3'] && !$brwsr['ie4'] && !$brwsr['ie5'] && !$brwsr['ie5_5']; - $brwsr['opera'] = (strpos($agt, 'opera') !== false); - $brwsr['opera2'] = (strpos($agt, 'opera 2') !== false) || (strpos($agt, 'opera/2') !== false); - $brwsr['opera3'] = (strpos($agt, 'opera 3') !== false) || (strpos($agt, 'opera/3') !== false); - $brwsr['opera4'] = (strpos($agt, 'opera 4') !== false) || (strpos($agt, 'opera/4') !== false); - $brwsr['opera5'] = (strpos($agt, 'opera 5') !== false) || (strpos($agt, 'opera/5') !== false); - $brwsr['opera5up'] = $brwsr['opera'] && !$brwsr['opera2'] && !$brwsr['opera3'] && !$brwsr['opera4']; - - $brwsr['aol'] = (strpos($agt, 'aol') !== false); - $brwsr['aol3'] = $brwsr['aol'] && $brwsr['ie3']; - $brwsr['aol4'] = $brwsr['aol'] && $brwsr['ie4']; - $brwsr['aol5'] = (strpos($agt, 'aol 5') !== false); - $brwsr['aol6'] = (strpos($agt, 'aol 6') !== false); - $brwsr['aol7'] = (strpos($agt, 'aol 7') !== false); - $brwsr['webtv'] = (strpos($agt, 'webtv') !== false); - $brwsr['aoltv'] = $brwsr['tvnavigator'] = (strpos($agt, 'navio') !== false) || (strpos($agt, 'navio_aoltv') !== false); - $brwsr['hotjava'] = (strpos($agt, 'hotjava') !== false); - $brwsr['hotjava3'] = $brwsr['hotjava'] && $this->majorVersion == 3; - $brwsr['hotjava3up'] = $brwsr['hotjava'] && $this->majorVersion >= 3; - - /** - * Setup easy access to the above variables - */ - foreach ($brwsr as $key => $value) { - $this->{'is_' . $key} = $value; - } - } -} -?> diff --git a/include/pear-prepend.php b/include/pear-prepend.php index 53481cb..bd47d72 100644 --- a/include/pear-prepend.php +++ b/include/pear-prepend.php @@ -91,10 +91,3 @@ init_auth_user(); if (!empty($_GET['logout']) && $_GET['logout'] === '1') { auth_logout(); } - -/** -* Browser detection -*/ -require_once "browser.php"; -$_browser = &new browser(); -?> diff --git a/templates/packages.html b/templates/packages.html index 07545fd..1002443 100755 --- a/templates/packages.html +++ b/templates/packages.html @@ -119,15 +119,13 @@ <td valign="top"><a href="/package/<?php echo $p['name']; ?>"><strong><?php echo $p['name']; ?></strong></td> <td valign="top"><?php echo $p['summary']; ?></td> <td valign="top"> - <?php if($_browser->is_ie5up) { ?> - <a href="#" onclick="toggleMoreInfo(<?php echo "'".$p['name']."'"; ?>,<?php echo $p['id']; ?>); return false" onmouseover="window.status = 'View more info about <?php echo $p['name']; ?>'; return true" onmouseout="window.status = ''" title="View more info about <?php echo $p['name']; ?>"> - <img src="gifs/moreinfo.gif" border="0" /> - </a> - <?php } ?> + <a href="#" onclick="toggleMoreInfo(<?php echo "'".$p['name']."'"; ?>,<?php echo $p['id']; ?>); return false" onmouseover="window.status = 'View more info about <?php echo $p['name']; ?>'; return true" onmouseout="window.status = ''" title="View more info about <?php echo $p['name']; ?>"> + <img src="gifs/moreinfo.gif" border="0" /> + </a> </td> </tr> - <tr <?php if($_browser->is_ie5up || $defaultMoreInfoVis == 'none') { ?> style="display: <?php echo $defaultMoreInfoVis; ?>" <?php } ?> id="moreInfo_<?php echo $p['id']; ?>"> + <tr <?php if($defaultMoreInfoVis == 'none') { ?> style="display: <?php echo $defaultMoreInfoVis; ?>" <?php } ?> id="moreInfo_<?php echo $p['id']; ?>"> <td> </td> <td colspan="3" class="moreInfo"> @@ -135,9 +133,7 @@ <tr> <td><span class="moreInfoText">More information</span></td> <td align="right"> - <?php if($_browser->is_ie5up) { ?> - <a href="javascript: toggleMoreInfo(<?php echo "'".$p['name']."'"; ?>,<?php echo $p['id']; ?>)"><img class="closeButton" src="gifs/close.gif" border="0" /></a> - <?php } ?> + <a href="javascript: toggleMoreInfo(<?php echo "'".$p['name']."'"; ?>,<?php echo $p['id']; ?>)"><img class="closeButton" src="gifs/close.gif" border="0" /></a> </td> </tr> </table> @@ -161,7 +157,7 @@ </td> </tr> - <tr <?php if($_browser->is_ie5up || $defaultMoreInfoVis == 'none') { ?> style="display: <php echo $defaultMoreInfoVis; ?>" <?php } ?> id="moreInfo_<?php echo $p['id']; ?>_spacer"><td colspan="5"> </td></tr> + <tr <?php if($defaultMoreInfoVis == 'none') { ?> style="display: <php echo $defaultMoreInfoVis; ?>" <?php } ?> id="moreInfo_<?php echo $p['id']; ?>_spacer"><td colspan="5"> </td></tr> <?php } ?> </table> </td>
diff --git a/include/browser.php b/include/browser.php deleted file mode 100755 index fbddcaa..0000000 --- a/include/browser.php +++ /dev/null @@ -1,158 +0,0 @@ -<?php -/* - +----------------------------------------------------------------------+ - | PEAR Web site version 1.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 2001-2003 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Richard Heyes | - +----------------------------------------------------------------------+ - $Id$ -*/ - -/** -* Based on PEAR::Net_UserAgent_Detect -*/ - -class browser -{ - /** - * Array that stores all of the flags for the vendor and version of - * the different browsers. The flags key values are show in the array. - * @var array $browser - */ - var $browser = array('ns', 'ns2', 'ns3', 'ns4', 'ns4up', 'nav', 'ns6', 'ns6up', 'gecko', 'ie', 'ie3', 'ie4', 'ie4up', 'ie5', 'ie5_5', 'ie5up', 'ie6', 'ie6up', 'opera', 'opera2', 'opera3', 'opera4', 'opera5', 'opera5up', 'aol', 'aol3', 'aol4', 'aol5', 'aol6', 'aol7', 'webtv', 'aoltv', 'tvnavigator', 'hotjava', 'hotjava3', 'hotjava3up'); - - /** - * The leading identifier is the very first term in the user agent string, which is - * used to identify clients which are not Mosaic-based browsers. - * @var string $leadingIdentifier - */ - var $leadingIdentifier = ''; - - /** - * The full version of the client as supplied by the very first numbers in the user agent - * @var float $version - */ - var $version = 0; - - /** - * The major part of the client version, which is the integer value of the version. - * @var integer $majorVersion - */ - var $majorVersion = 0; - - /** - * The minor part of the client version, which is the decimal parts of the version - * @var float $subVersion - */ - var $subVersion = 0; - - /** - * Constructor - * - * @param - */ - function browser($in_useragent = null) - { - $this->detect($in_useragent); - } - - /** - * Detect the user agent and prepare flags, features and quirks based on what is found - * - * This is the core of the Net_UserAgent_Detect class. It moves its way through the user agent - * string setting up the flags based on the vendors and versions of the browsers, determining - * the OS and setting up the features and quirks owned by each of the relevant clients. - * - * @access public - * @param string (optional) user agent override - * @return void - */ - function detect($in_userAgent = null) - { - // Detemine what user agent we are using - if (is_null($in_userAgent)) { - if (isset($GLOBALS['HTTP_SERVER_VARS']['HTTP_USER_AGENT'])) { - $this->userAgent = $GLOBALS['HTTP_SERVER_VARS']['HTTP_USER_AGENT']; - } else { - $this->userAgent = ''; - } - } else { - $this->userAgent = $in_userAgent; - } - - // Get the lowercase version for case-insensitive searching - $agt = strtolower($this->userAgent); - - // Initialize the flag arrays - $brwsr =& $this->browser; - $brwsr = array_flip($brwsr); - - // Get the type and version of the client - preg_match(";^([[:alpha:]]+)[ /\(]*[[:alpha:]]*([\d]*)\.([\d\.]*);", $agt, $matches); - @list(, $this->leadingIdentifier, $this->majorVersion, $this->subVersion) = $matches; - if (empty($this->leadingIdentifier)) { - $this->leadingIdentifier = 'Unknown'; - } - - $this->version = $this->majorVersion . '.' . $this->subVersion; - - $brwsr['konq'] = (strpos($agt, 'konqueror') !== false); - $brwsr['text'] = (strpos($agt, 'links') !== false) || (strpos($agt, 'lynx') !== false) || (strpos($agt, 'w3m') !== false); - $brwsr['ns'] = (strpos($agt, 'mozilla') !== false) && !(strpos($agt, 'spoofer') !== false) && !(strpos($agt, 'compatible') !== false) && !(strpos($agt, 'hotjava') !== false) && !(strpos($agt, 'opera') !== false) && !(strpos($agt, 'webtv') !== false) ? 1 : 0; - $brwsr['ns2'] = $brwsr['ns'] && $this->majorVersion == 2; - $brwsr['ns3'] = $brwsr['ns'] && $this->majorVersion == 3; - $brwsr['ns4'] = $brwsr['ns'] && $this->majorVersion == 4; - $brwsr['ns4up'] = $brwsr['ns'] && $this->majorVersion >= 4; - // determine if this is a Netscape Navigator - $brwsr['nav'] = $brwsr['ns'] && ((strpos($agt, ';nav') !== false) || ((strpos($agt, '; nav') !== false))); - $brwsr['ns6'] = !$brwsr['konq'] && $brwsr['ns'] && $this->majorVersion == 5; - $brwsr['ns6up'] = $brwsr['ns6'] && $this->majorVersion >= 5; - $brwsr['gecko'] = (strpos($agt, 'gecko') !== false); - $brwsr['ie'] = (strpos($agt, 'msie') !== false) && !(strpos($agt, 'opera') !== false); - $brwsr['ie3'] = $brwsr['ie'] && $this->majorVersion < 4; - $brwsr['ie4'] = $brwsr['ie'] && $this->majorVersion == 4 && (strpos($agt, 'msie 4') !== false); - $brwsr['ie4up'] = $brwsr['ie'] && $this->majorVersion >= 4; - $brwsr['ie5'] = $brwsr['ie'] && $this->majorVersion == 4 && (strpos($agt, 'msie 5.0') !== false); - $brwsr['ie5_5'] = $brwsr['ie'] && $this->majorVersion == 4 && (strpos($agt, 'msie 5.5') !== false); - $brwsr['ie5up'] = $brwsr['ie'] && !$brwsr['ie3'] && !$brwsr['ie4']; - $brwsr['ie5_5up'] = $brwsr['ie'] && !$brwsr['ie3'] && !$brwsr['ie4'] && !$brwsr['ie5']; - $brwsr['ie6'] = $brwsr['ie'] && $this->majorVersion == 4 && (strpos($agt, 'msie 6.') !== false); - $brwsr['ie6up'] = $brwsr['ie'] && !$brwsr['ie3'] && !$brwsr['ie4'] && !$brwsr['ie5'] && !$brwsr['ie5_5']; - $brwsr['opera'] = (strpos($agt, 'opera') !== false); - $brwsr['opera2'] = (strpos($agt, 'opera 2') !== false) || (strpos($agt, 'opera/2') !== false); - $brwsr['opera3'] = (strpos($agt, 'opera 3') !== false) || (strpos($agt, 'opera/3') !== false); - $brwsr['opera4'] = (strpos($agt, 'opera 4') !== false) || (strpos($agt, 'opera/4') !== false); - $brwsr['opera5'] = (strpos($agt, 'opera 5') !== false) || (strpos($agt, 'opera/5') !== false); - $brwsr['opera5up'] = $brwsr['opera'] && !$brwsr['opera2'] && !$brwsr['opera3'] && !$brwsr['opera4']; - - $brwsr['aol'] = (strpos($agt, 'aol') !== false); - $brwsr['aol3'] = $brwsr['aol'] && $brwsr['ie3']; - $brwsr['aol4'] = $brwsr['aol'] && $brwsr['ie4']; - $brwsr['aol5'] = (strpos($agt, 'aol 5') !== false); - $brwsr['aol6'] = (strpos($agt, 'aol 6') !== false); - $brwsr['aol7'] = (strpos($agt, 'aol 7') !== false); - $brwsr['webtv'] = (strpos($agt, 'webtv') !== false); - $brwsr['aoltv'] = $brwsr['tvnavigator'] = (strpos($agt, 'navio') !== false) || (strpos($agt, 'navio_aoltv') !== false); - $brwsr['hotjava'] = (strpos($agt, 'hotjava') !== false); - $brwsr['hotjava3'] = $brwsr['hotjava'] && $this->majorVersion == 3; - $brwsr['hotjava3up'] = $brwsr['hotjava'] && $this->majorVersion >= 3; - - /** - * Setup easy access to the above variables - */ - foreach ($brwsr as $key => $value) { - $this->{'is_' . $key} = $value; - } - } -} -?> diff --git a/include/pear-prepend.php b/include/pear-prepend.php index 53481cb..bd47d72 100644 --- a/include/pear-prepend.php +++ b/include/pear-prepend.php @@ -91,10 +91,3 @@ init_auth_user(); if (!empty($_GET['logout']) && $_GET['logout'] === '1') { auth_logout(); } - -/** -* Browser detection -*/ -require_once "browser.php"; -$_browser = &new browser(); -?> diff --git a/templates/packages.html b/templates/packages.html index 07545fd..1002443 100755 --- a/templates/packages.html +++ b/templates/packages.html @@ -119,15 +119,13 @@ <td valign="top"><a href="/package/<?php echo $p['name']; ?>"><strong><?php echo $p['name']; ?></strong></td> <td valign="top"><?php echo $p['summary']; ?></td> <td valign="top"> - <?php if($_browser->is_ie5up) { ?> - <a href="#" onclick="toggleMoreInfo(<?php echo "'".$p['name']."'"; ?>,<?php echo $p['id']; ?>); return false" onmouseover="window.status = 'View more info about <?php echo $p['name']; ?>'; return true" onmouseout="window.status = ''" title="View more info about <?php echo $p['name']; ?>"> - <img src="gifs/moreinfo.gif" border="0" /> - </a> - <?php } ?> + <a href="#" onclick="toggleMoreInfo(<?php echo "'".$p['name']."'"; ?>,<?php echo $p['id']; ?>); return false" onmouseover="window.status = 'View more info about <?php echo $p['name']; ?>'; return true" onmouseout="window.status = ''" title="View more info about <?php echo $p['name']; ?>"> + <img src="gifs/moreinfo.gif" border="0" /> + </a> </td> </tr> - <tr <?php if($_browser->is_ie5up || $defaultMoreInfoVis == 'none') { ?> style="display: <?php echo $defaultMoreInfoVis; ?>" <?php } ?> id="moreInfo_<?php echo $p['id']; ?>"> + <tr <?php if($defaultMoreInfoVis == 'none') { ?> style="display: <?php echo $defaultMoreInfoVis; ?>" <?php } ?> id="moreInfo_<?php echo $p['id']; ?>"> <td> </td> <td colspan="3" class="moreInfo"> @@ -135,9 +133,7 @@ <tr> <td><span class="moreInfoText">More information</span></td> <td align="right"> - <?php if($_browser->is_ie5up) { ?> - <a href="javascript: toggleMoreInfo(<?php echo "'".$p['name']."'"; ?>,<?php echo $p['id']; ?>)"><img class="closeButton" src="gifs/close.gif" border="0" /></a> - <?php } ?> + <a href="javascript: toggleMoreInfo(<?php echo "'".$p['name']."'"; ?>,<?php echo $p['id']; ?>)"><img class="closeButton" src="gifs/close.gif" border="0" /></a> </td> </tr> </table> @@ -161,7 +157,7 @@ </td> </tr> - <tr <?php if($_browser->is_ie5up || $defaultMoreInfoVis == 'none') { ?> style="display: <php echo $defaultMoreInfoVis; ?>" <?php } ?> id="moreInfo_<?php echo $p['id']; ?>_spacer"><td colspan="5"> </td></tr> + <tr <?php if($defaultMoreInfoVis == 'none') { ?> style="display: <php echo $defaultMoreInfoVis; ?>" <?php } ?> id="moreInfo_<?php echo $p['id']; ?>_spacer"><td colspan="5"> </td></tr> <?php } ?> </table> </td>