Hi gang:
I'm not big on globals, but that may be better than including a
config file every time a variable is needed. And considering that
these variables are not really variables, but more of the static
variety, then constants are a consideration.
Thanks for all the things to consider.
Che
On Thu, Jun 19, 2008 at 10:04 AM, tedd <[EMAIL PROTECTED]> wrote:
> Hi gang:
>
> More of a question of method rather than of "right" or "wrong" -- of the two
> methods mentioned here, which way would be "better" and why?
>
> 1. Setting $GLOBALS one time as shown here.
>
> At 12:23 AM -0400 6/19/08,
At 5:31 PM +0300 6/19/08, Sancar Saran wrote:
Hi tedd
My final solution was.
class conf {
public static $vals = array(); // config array
...
}
conf::$vals['mysql_host'] = 'localhost';
conf::$vals['mysql_user'] = "[EMAIL PROTECTED]";
you can access anywhere of your script and you won
tedd wrote:
Hi gang:
More of a question of method rather than of "right" or "wrong" -- of the
two methods mentioned here, which way would be "better" and why?
Initially I used to access global variables using the "global" keyword -
function foo()
{
global $bar;
}
However if the functi
On Thu, 2008-06-19 at 18:37 +0300, Sancar Saran wrote:
> Well, after reaching this
>
> $GLOBALS['live']['current']['c']['modules']['traffics']['url'] = 'blah';
>
> I change my mind to use public static variables.
>
> using conf::$vars (or someting like that) was more pratic than using $GLOBALS
Well, after reaching this
$GLOBALS['live']['current']['c']['modules']['traffics']['url'] = 'blah';
I change my mind to use public static variables.
using conf::$vars (or someting like that) was more pratic than using $GLOBALS
directly. You can set config each of your classes.
Regards
Sancar
My preference for years has been like so:
Then, in a general file, I include all files that will need to be
included across all pages like so:
And without writing out all files, as I'm sure your imagination
should suffice, I'll show the database basics. First, in an include
fil
On Thu, 2008-06-19 at 17:31 +0300, Sancar Saran wrote:
> Hi tedd
>
> My final solution was.
>
> class conf {
>
> public static $vals = array(); // config array
> ...
> }
>
> conf::$vals['mysql_host'] = 'localhost';
> conf::$vals['mysql_user'] = "[EMAIL PROTECTED]";
>
> you can access an
On Thu, 2008-06-19 at 10:04 -0400, tedd wrote:
> Hi gang:
>
> More of a question of method rather than of "right" or "wrong" -- of
> the two methods mentioned here, which way would be "better" and why?
>
> 1. Setting $GLOBALS one time as shown here.
>
> At 12:23 AM -0400 6/19/08, Robert Cumming
Hi tedd
My final solution was.
class conf {
public static $vals = array(); // config array
...
}
conf::$vals['mysql_host'] = 'localhost';
conf::$vals['mysql_user'] = "[EMAIL PROTECTED]";
you can access anywhere of your script and you won't need to pollute $GLOBALS.
Regards
Sancar
O
Hi gang:
More of a question of method rather than of "right" or "wrong" -- of
the two methods mentioned here, which way would be "better" and why?
1. Setting $GLOBALS one time as shown here.
At 12:23 AM -0400 6/19/08, Robert Cummings wrote:
And the variables are defined in config.php
--
11 matches
Mail list logo