Re: GLOBALS.php "cleanup" [message #6841 is a reply to message #6759] |
Fri, 25 October 2002 16:37 |
holstein
Messages: 9 Registered: August 2002 Location: Montreal
Karma:
|
Junior Member |
|
|
With my changes, all the variables declared in GLOBALS.php are effectively changed with the format I described. That way, they are explicitely added to the GLOBALS scope.
Everything is still working right with this change : all the globals are indeed called in the $GLOBALS array. From what I understand (I know way more in Perl than in PHP, so maybe I don't clearly understand peculiarity about the PHP scopes and al.), my changes are not changing anything, but it makes my code work...
What I'm doing to make Fud setup his user cookie at the same time of my cookies is this :
- - - - - - 8<- - - - -
/* set my cookies. I wont bother your with that.. ;o) /*
require_once $_SERVER['DOCUMENT_ROOT'] . '/forum/GLOBALS.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/forum/forum_data/include/theme/lpa/db.inc';
require_once $_SERVER['DOCUMENT_ROOT'] . '/forum/forum_data/include/theme/lpa/cookies.inc';
$fsess = new fud_session;
$fud_uid = $this->dbh->getOne("SELECT id FROM fud_users WHERE login = " . $this->dbh->quote($this->info['username']));
set_referer_cookie($fud_uid);
$fsess->cookie_set_session($fsess->save_session($fud_uid));
- - - - - - 8<- - - - -
As you see, I include what I need to be able to build a fud_session object and call it's cookie_set_session method.
If I leave GLOBALS.php the way it is by default, this won't work because the DBHOST_* globals are not, for a reason I confess I don't clearly understand, recognized by the fud_session object. If I apply my changes and declare all the variable in GLOBALS.php directly in the $GLOBALS array/namespace, everything work. And the forum still work right.
Am I missing something, and my forum is going to explode somewhere I have'nt figure?
|
|
|