Req #25437 [Opn->Csd]: virtual() behaviour for php-files
| From: | krakjoe@php.net | Date: | Sun, 08 Jan 2017 06:09:04 +0000 |
| Subject: | Req #25437 [Opn->Csd]: virtual() behaviour for php-files | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-206381@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=25437&edit=1
ID: 25437
Updated by: krakjoe@php.net
Reported by: jonas dot info at gmx dot net
Summary: virtual() behaviour for php-files
-Status: Open
+Status: Closed
Type: Feature/Change Request
Package: Apache related
Operating System: Win32; all?
PHP Version: 4.3.3
-Assigned To:
+Assigned To: krakjoe
Block user comment: N
Private report: N
New Comment:
This has been open for a decade, hasn't generated any conversation and so there would appear to
be no appetite for this change. The explanation is probably that virtual is an extremely surprising
function that everyone avoids.
Closing.
Previous Comments:
------------------------------------------------------------------------
[2003-09-08 16:20:33] jonas dot info at gmx dot net
Description:
------------
i have tested the virtual("file2.php"); feature in php 4.3.3. now it behaves like an
include in every way.
but i think it would be better to parse the script as there were no calling script, so it were
called through apache, so that the variable $test would not be changed in the called script and the
$_SERVER["PHP_SELF"] has to be the called script, not the calling.
so it would be good to add a new parameter to virtual() to set some ini options for the called
script (espacially the "open_basedir" and "safe_mode" options, or in the apache
per directory settings of the called script) to allow customers to add there own php scripts in a
kind of more controlled environement.
Reproduce code:
---------------
<!-- called.php -->
<?php
echo("this is: " . $_SERVER["PHP_SELF"] . "<br>");
$test = "variable has changed";
?>
<!-- per_include.php -->
include:<br>
<?php
$test = "variable set";
include("called.php");
echo($test);
?>
<!-- per_virtual.php -->
virtual:<br>
<?php
$test = "variable set";
virtual("called.php");
echo($test);
?>
Expected result:
----------------
include:
this is: /path/per_include.php
variable has changed
virtual:
this is: /path/called.php
variable set
Actual result:
--------------
include:
this is: /path/per_include.php
variable has changed
virtual:
this is: /path/per_virtual.php
variable has changed
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=25437&edit=1