Re: [PHP4BETA] additional headers in include and require functions
| From: | Faisal Nasim | Date: | Mon, 08 May 2000 11:00:01 +0000 |
| Subject: | Re: [PHP4BETA] additional headers in include and require functions | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-14665@lists.php.net to get a copy of this message | ||
How about this:
$blah [ "Author" ] = "etc name";
$blah [ "Another header" ] = "etc thingy!";
# this needs to be created
register_http_header ( $blah );
include ( 'http://etc.com/abcd.php' );
$fp = fopen ( 'http://www.foo.com' , 'r'
);
# assuming they both call a general php_* function to make the
# http connection
each socket function can check to see if a headers hash is registered.
I hope they call a general function to make http connections, so it
wouldn't be tough to implement. If there is a registered headers
hash ...... you know what happens. :)
And this won't cause any incompability either if a script already has
$http_heads blah blah.
Faisal.
----- Original Message -----
From: "Adam Kropielnicki" <adasz@cnt.pl>
To: <stas@zend.com>
Cc: <php4beta@lists.php.net>
Sent: Monday, May 08, 2000 3:27 PM
Subject: Re: [PHP4BETA] additional headers in include and require functions
| Hi
|
| > AK>> $http_heads["My head"]="adasz";
| > AK>> $http_heads["My head2"]="adasz2";
| > AK>> include("http://adasz.cnt.pl/gethead.php3");
| >
| > Very nice idea. However: shouldn't $http_heads be a parameter? Making
| > special-purpose hardcoded-name variables are generally very bad idea,
and
| > could break a lot of code. Also, it's harder to understand.
| >
| Think of it like $HTTP_GET_VARS & co, there are already hardcoded
| variables in PHP. And this patch doesn't break compatibility with existing
| files. If you used a parameter, how would you use it? Make a special
| funcion? Then you would break your scripts if used on different version of
| PHP.
| This is just a proposal, maybe there is better way?
|
| > But I think such feature is very useful and should be added to
| > fopen-wrapped calls, if possible. Though, I think including code from
| > non-authenticated foreighn site is very *bad* idea, but this idea could
be
| > used for better things.
| >
| or intranets for example.
|
| --
| Adam
| --
| _/ _/ _/_/_/ ----- Adam Kropielnicki, adasz@wp.pl -----
| _/ _/ _/ _/ _/ Wirtualna Polska SA http://www.wp.pl
| _/_/_/_/ _/_/_/
| _/ _/ _/ --------==* Moja WP: http://moja.wp.pl
*==----------
|
|
|
| --
| PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
| To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net
| For additional commands, e-mail: php4beta-help@lists.php.net
| To contact the list administrators, e-mail: php4beta-admin@lists.php.net
|
|