NYCPHP Meetup

NYPHP.org

[nycphp-talk] How do you do the equivalent of $PHP_SELF for PHP scripts not in docroot?

Joel De Gan joel at tagword.com
Tue May 18 16:15:30 EDT 2004


On Tue, 2004-05-18 at 14:24, Phillip Powell wrote:
> Here's the problem.  Suppose that my company wants to market this 
> product out to another client, Foo Industries.  That would mean that the 
> folks that get my application will have to literally MANUALLY change the 
> lines in index.php from 'acme' to 'foo' or whatever the folder name will 
> be for that client.  This is, of course, quite a major-league hassle to 
> ask for.  And frankly, I just can't think of any system I want to use 
> that would be able to automate the process so that the code in index.php 
> can remain fairly "static" and not needing to be physically altered from 
> client to client.
> 
> If anyone can think of how I might be able to approach this, I'm all ears.

Well, how most generally do it is via a define, in a config.
define("APPPATH", "/var/www/html/project");

Then in code that includes this file with this and other settings.
You call defined vals like so

include APPPATH ."/file.php";

Does that answer the question?
getcwd() is what I usually use to set this all programmatically.

-- 
joeldg - developer, Intercosmos media group.
http://lucifer.intercosmos.net




More information about the talk mailing list