php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #32611 This is more of a request then a bug really
Submitted: 2005-04-06 23:17 UTC Modified: 2006-11-11 02:01 UTC
From: dj_oldfield at yahoo dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.3.10 OS: MANY
Private report: No CVE-ID: None
 [2005-04-06 23:17 UTC] dj_oldfield at yahoo dot com
Description:
------------
I currently work with 4.3 because I have trouble getting phpMyAdmin to work with 5.x.

In regular development environments ( and as a contract developer ) I frequently work on code that is intended to run a development environment and a live environment.  In doing so, many of the files that I use are interacting with a different directory structure.  To fully take advantage of the NIX based advantages... file based templates are a MUST... especially with PHPs automatic formatting of strings ( WHICH IS REALLY COOL FROM A PROGRAMMERS PERSPECTIVE! ).  

The problem is... that filesystem functions require full knowledge of the working specifications of the filesystem... which for the moment... I am actually making a script to auto-fix.  I think that it would be nice to have new versions of require, include, and file_get_contents functions which are configured directly to the root directory for the website... E.G.

include_from_root
require_from_root
file_get_contents_from_root

where the root directory is scanned from it's contents.  I fear that writting wrapper functions would be in poor convention and could create erroneos results, so I wanted to take this idea to the source.  Considering that many people are using PHP on a hosted source... it would stand to reason that this functionality would make php code more portable... and therefore enable easier handling of php scripts.

Finally... include_path would be different on a per-site basis.  Can you make it so that php can watch for "WEBSITE ROOT DIRECTORIES" having their own php.ini file?  This way... hosted solutions would be better able to cater to a more open work environment.

Reproduce code:
---------------
// the desired code:
include_from_root( '_includes/some_file.php' );
require_from_root( '_includes/some_other_file.php' );
$file_text = file_get_contents_from_root( '_includes/source_file' );
//... code here
print( $file_text );

Expected result:
----------------
// in hopes to return data from:::
this text came from /usr/websites/www.website.com/_htdocs/_includes/some_file.php
this text came from /usr/websites/www.website.com/_htdocs/_includes/some_other_file.php
this text came from /usr/websites/www.website.com/_htdocs/_includes/source_file.php

Actual result:
--------------
// NOT APPLICABLE

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-11 02:01 UTC] tony2001@php.net
.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 13:01:33 2024 UTC