cvs: pear /HTTP HTTP.php package.xml

From: Date: Fri, 03 Aug 2001 08:30:15 +0000
Subject: cvs: pear /HTTP HTTP.php package.xml
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-412@lists.php.net to get a copy of this message
ssb Fri Aug 3 04:30:15 2001 EDT Modified files: /pear/HTTP HTTP.php package.xml Log: * preparing a "real" 1.0 release (tagging with V_1_0_RELEASE) Index: pear/HTTP/HTTP.php diff -u pear/HTTP/HTTP.php:1.3 pear/HTTP/HTTP.php:1.4 --- pear/HTTP/HTTP.php:1.3 Thu Apr 19 15:38:38 2001 +++ pear/HTTP/HTTP.php Fri Aug 3 04:30:15 2001 @@ -17,15 +17,13 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: HTTP.php,v 1.3 2001/04/19 19:38:38 kaltoft Exp $ +// $Id: HTTP.php,v 1.4 2001/08/03 08:30:15 ssb Exp $ // // HTTP utility functions. // -if (!empty($GLOBALS['USED_PACKAGES']['HTTP'])) return; -$GLOBALS['USED_PACKAGES']['HTTP'] = true; - -class HTTP { +class HTTP +{ /** * Format a date according to RFC-XXXX (can't remember the HTTP * RFC number off-hand anymore, shame on me). This function @@ -37,9 +35,10 @@ * * @author Stig Bakken <ssb@fast.no> */ - function Date($time) { - $y = ini_get("y2k_compliance") ? "Y" : "y"; - return gmdate("D, d M $y H:i:s", $time); + function Date($time) + { + $y = ini_get("y2k_compliance") ? "Y" : "y"; + return gmdate("D, d M $y H:i:s", $time); } /** @@ -66,47 +65,48 @@ * * @author Stig Bakken <ssb@fast.no> */ - function negotiateLanguage(&$supported, $default = 'en_US') { - global $HTTP_SERVER_VARS; - - /* If the client has sent an Accept-Language: header, see if - * it contains a language we support. - */ - if (isset($HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE'])) { - $accepted = split(',[[:space:]]*', $HTTP_ACCEPT_LANGUAGE); - for ($i = 0; $i < count($accepted); $i++) { - if (eregi('^([a-z]+);[[:space:]]*q=([0-9\.]+)', $accepted[$i], &$arr)) { - $q = (double)$arr[2]; - $l = $arr[1]; - } else { - $q = 42; - $l = $accepted[$i]; - } - if (!empty($supported[$l]) && ($q > 0.0)) { - if ($q == 42) { - return $l; - } - $candidates[$l] = $q; - } - } - if (isset($candidates)) { - arsort($candidates); - reset($candidates); - return key($candidates); - } - } - - /* Check for a valid language code in the top-level domain of - * the client's host address. - */ - if (ereg("\.[^\.]+$", $HTTP_SERVER_VARS['REMOTE_HOST'], &$arr)) { - $lang = strtolower($arr[1]); - if (!empty($supported[$lang])) { - return $lang; - } - } + function negotiateLanguage(&$supported, $default = 'en_US') + { + global $HTTP_SERVER_VARS; + + /* If the client has sent an Accept-Language: header, see if + * it contains a language we support. + */ + if (isset($HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE'])) { + $accepted = split(',[[:space:]]*', $HTTP_ACCEPT_LANGUAGE); + for ($i = 0; $i < count($accepted); $i++) { + if (eregi('^([a-z]+);[[:space:]]*q=([0-9\.]+)', $accepted[$i], &$arr)) { + $q = (double)$arr[2]; + $l = $arr[1]; + } else { + $q = 42; + $l = $accepted[$i]; + } + if (!empty($supported[$l]) && ($q > 0.0)) { + if ($q == 42) { + return $l; + } + $candidates[$l] = $q; + } + } + if (isset($candidates)) { + arsort($candidates); + reset($candidates); + return key($candidates); + } + } + + /* Check for a valid language code in the top-level domain of + * the client's host address. + */ + if (ereg("\.[^\.]+$", $HTTP_SERVER_VARS['REMOTE_HOST'], &$arr)) { + $lang = strtolower($arr[1]); + if (!empty($supported[$lang])) { + return $lang; + } + } - return $default; + return $default; } } ?> Index: pear/HTTP/package.xml diff -u pear/HTTP/package.xml:1.3 pear/HTTP/package.xml:1.4 --- pear/HTTP/package.xml:1.3 Thu Apr 19 16:06:04 2001 +++ pear/HTTP/package.xml Fri Aug 3 04:30:15 2001 @@ -11,13 +11,14 @@ </Maintainer> <Release> <Version>1.0</Version> - <Date>2001-04-15</Date> + <Date>2001-08-03</Date> <Notes> This is the initial independent release of the HTTP package. </Notes> </Release> <FileList> - <Dir>/</Dir> - <File>HTTP.php</File> + <Dir Name="/"> + <File role="php">HTTP.php</File> + </Dir> </FileList> </Package>

« previous php.pear.cvs (#412) next »