Bug #18000 Updated: localized http header request includes variable scope

From: Date: Wed, 26 Jun 2002 19:25:09 +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-12159@lists.php.net to get a copy of this message
ID: 18000 Updated by: rasmus@php.net Reported By: code@4arrow.com Status: Bogus Bug Type: Feature/Change Request Operating System: UNIX PHP Version: 4.1.2 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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? ------------------------------------------------------------------------ [2002-06-26 15:00:31] code@4arrow.com You're right about the additional load it would add and yes you can pass variables via the Query string. For me the feature request is more technical in nature than cosmetic patches will cover. When you execute a script and during its run I include'http://samedomain/file.php' There are limitations of scope that are placed on the included local file in comparison to its parent file which to me seems unecessary. This ruins the code flow for me, practically and mentally. I wonder if this is part of the child process limitation in PHP? ------------------------------------------------------------------------ [2002-06-26 14:50:04] rasmus@php.net Oh, and to get your sessions to persist across a url file open, simply pass your SID along. ------------------------------------------------------------------------ [2002-06-26 14:48:51] rasmus@php.net I don't understand why you call this a header http request, but whatever. So you want include 'http://local.domain/file.php' to act like include 'file.php' if local.domain happens to be the a local domain? Seems to me like this is something that you should be checking at the application level. Why use a url when the file is local? We could add a check, but it would add extra dns calls to every url file operation and I don't think it is worth it. ------------------------------------------------------------------------ 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

« previous php.bugs (#12159) next »