By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 1,057 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

Configuration file

P: n/a
Hey, once again...

What is the best way to do a configuration file? I want it to be easy to
edit and contain a lot of defined values. (But not nessasarily use
"define"). I have seen it as an array before, and have used that, but I
have to do "global $config" for every function that uses it. Is there an
easier way? Should I be doing it some other way? Ideally I would like a C
syntax DEFINE, the only reason I'm not using define() is because I don't
like the way it looks - it makes it a bit more confusing to change.

Thanks, once again, in advance,
-Eric Kincl
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Eric Kincl wrote:
Hey, once again...

What is the best way to do a configuration file? I want it to be easy to
edit and contain a lot of defined values. (But not nessasarily use
"define"). I have seen it as an array before, and have used that, but I
have to do "global $config" for every function that uses it. Is there an
easier way? Should I be doing it some other way? Ideally I would like a
C syntax DEFINE, the only reason I'm not using define() is because I don't
like the way it looks - it makes it a bit more confusing to change.

Thanks, once again, in advance,
-Eric Kincl


Forgot to mention/ask--
Is it possible to do dynamic definitions with "define()"? Such as:
define("DOCUMENT_ROOT", $_SERVER['DOCUMENT_ROOT']);
I would like to do this so that in my code I don't always have to keep
typing it in. I'm lazy :)
-Eric Kincl
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.