php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #14710 Please either change include/require/virtual directive, or create new one!
Submitted: 2001-12-27 01:13 UTC Modified: 2002-01-28 21:21 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: nospamo at nospamo dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.0.6 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
8 + 27 = ?
Subscribe to this entry?

 
 [2001-12-27 01:13 UTC] nospamo at nospamo dot com
I have been searching the php.net forums, bug tracker, etc for a way to do the following, and perhaps misread the "virtual" php operator, but in any case:

Php needs to include SSI functionality in regards to using relative paths on files being included, eg:

If I have a php file, "$HOME/htdocs/static/header.php", and have a tree structure below "htdocs", I cannot find a legit way to include header.php in a relative fashion, eg "include /header.php".  "../../../../header.php" or "/full/path/to/header.php" are not solutions I am looking for :)

That being said, "virtual" seems to encompass what I am looking to do at a cursory glance, but i'm concerned that I may lose some functionality down the road.  From the current php.net manual on the "virtual" function:

"virtual() cannot be used to include a document which is itself a PHP file."

Please, please, PLEASE either create a new directive/option:
 (<? php ssi("/static/header.php") ?>

... or modify the existing ones.

If virtual *is* intended to be the fix, please update the documentation as it is either outdated or misleading (to me anyhew :)

Basically, I need full php functionality *AND* the ability to include other php files in a fully relative nature (EXACTLY like SSI is currently implemented).

Thanks!

Further diags:

If I try the following:

<?php include ("/static/header.php"); ?>

I get:

Warning: Failed opening '/static/header.php' for inclusion (include_path='.:/web/htdocs/user/static') in /web/htdocs/user/index.php on line 0

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 16:01:29 2024 UTC