Net_URL don't use $_SERVER
| From: | Roberto Bertó | Date: | Mon, 20 Jan 2003 04:57:20 +0000 |
| Subject: | Net_URL don't use $_SERVER | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-12611@lists.php.net to get a copy of this message | ||
Hi all,
I was looking for Net_URL code to add UrlParser on it and I found a way
to integrate it, something like:
$url = &new Net_URL('http://www.example.com/fruit/pear/color/green/',
true,true);
Where the last param is to tell to Net_URL to parse things and return
fruit=pear and color=green.
Also, the putGlobal. putPost and putAll things can be added too.
Also, I found that $_SERVER isn't being used, since it users
$HTTP_SERVER_VARS, so it just work on the old PHP versions. Right? So,
what about this patch?
[darkelder@desphp Net_URL]$ cvs diff URL.php
Index: URL.php
===================================================================
RCS file: /repository/pear/Net_URL/URL.php,v
retrieving revision 1.21
diff -u -r1.21 URL.php
--- URL.php 4 Jan 2003 11:55:53 -0000 1.21
+++ URL.php 20 Jan 2003 03:44:47 -0000
@@ -108,6 +108,11 @@
{
global $HTTP_SERVER_VARS;
+ // new PHP versions
+ if (!is_array($HTTP_SERVER_VARS)) {
+ $HTTP_SERVER_VARS = &$_SERVER;
+ }
+
/**
* Figure out host/port
*/
@@ -315,4 +320,4 @@
return $return;
}
}
-?>
\ No newline at end of file
+?>
--
Atenciosamente,
---------------------------------------------------------
Roberto Berto - roberto@desenvolve.com.br
Gerente de Contas / Desenvolve
Hospedagem a R$ 7,60 por mês, com toda a nossa qualidade!
Confira: http://www.desenvolve.com.br
DESENVOLVE Soluções de Internet
http://www.desenvolve.com.br
TEL/FAX: 51 32270599 Rua Duque de Caxias, 1594 conj. 204
CEP 90010-281 - Porto Alegre - RS
---------------------------------------------------------