Configuration file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eric Kincl

    Configuration file

    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
  • Eric Kincl

    #2
    Re: Configuration file

    Eric Kincl wrote:
    [color=blue]
    > 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[/color]

    Forgot to mention/ask--
    Is it possible to do dynamic definitions with "define()"? Such as:
    define("DOCUMEN T_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

    Comment

    Working...