Bug #18000 Updated: localized http header request includes variable scope
| From: | code at 4arrow dot com | Date: | Wed, 26 Jun 2002 20:14:36 +0000 |
| Subject: | Bug #18000 Updated: localized http header request includes variable scope | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-12164@lists.php.net to get a copy of this message | ||
ID: 18000
Updated by: code@4arrow.com
Reported By: code@4arrow.com
Status: Bogus
Bug Type: Feature/Change Request
Operating System: UNIX
PHP Version: 4.1.2
New Comment:
No biggie, I was planning on porting my development to Zope eventually
anyways.
Thanks for your attention to detail and quick responses.
Previous Comments:
------------------------------------------------------------------------
[2002-06-26 16:06:31] rasmus@php.net
But if you turn the include into a normal file-system based include as
I illustrated in my_include() then variables are maintained. Locally
included files share the same scope as the script doing the inclusion.
I see no use for what you are asking for, sorry.
------------------------------------------------------------------------
[2002-06-26 15:33:58] code@4arrow.com
Its just a feature request not a direct order.
The feature request is not how to do includes but rather how to
maintain the integrity of variable scopes when including a new http
header request (while wanting all those new variables) inside an
existing header request (while maintaining all those existing variables
into the new header request).
This is not something you can code hack to replicate it is an intrinsic
sub request or child process that would establish user defined optional
prefix based env variable differentials.
------------------------------------------------------------------------
[2002-06-26 15:25:08] rasmus@php.net
Oh, I understand what you are asking for, it just still makes
absolutely no sense to me. Why would you incur the overhead of an
unneccesary HTTP request just for code flow? Wrap your include
function yourself then.
function my_include($url) {
$a = parse_url($url);
if($a['host'] == $_SERVER['SERVER_NAME'] {
$file = $_SERVER['DOCUMENT_ROOT'].$a['path'];
} else $file = $url;
include $file;
}
my_include('http://localdomain/file.php');
That's all. Building this into PHP doesn't make any sense to me.
------------------------------------------------------------------------
[2002-06-26 15:15:59] code@4arrow.com
Specifically, for me as I said it is about code flow and options.
Really as simple as that. Having the ability to include a file with its
full URI that makes a new header request without losing variable scope
(locally) of the previous header request it is inside of would be
beneficial to me and my php development by allowing me to gain more
freedom and options.
Options I think is the key word that this would create for me.
Variables give me options losing them in middle of a run takes away my
options.
If there were to be any considertion for something like this, I would
suggest a PREFIX optional argument that would prepend the newly created
ENV variables from the new and second header request within the same
domain.
Maybe you're not clear on what I am suggesting.
I am requesting the ability to include a full URL and a new header
request within an existing header request on the same domain, same
script execution run, that enables me to have two or more sets of
unique and shared variables without losing variable scope.
------------------------------------------------------------------------
[2002-06-26 15:03:57] rasmus@php.net
But you still haven't answered why you are doing:
include 'http://samedomain/file.php';
This makes no sense to me. Why go through HTTP when the file is
local?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/18000
--
Edit this bug report at http://bugs.php.net/?id=18000&edit=1