getting the GLOBALS needed for fudapi [message #35513] |
Wed, 17 January 2007 19:40 |
maarten
Messages: 7 Registered: January 2007
Karma:
|
Junior Member |
|
|
I'm using fudforum_login.php and fudapi.inc.php in a context where I'm confined into function scope, so I'm relying on the technique in __fud_login_common() to read GLOBALS.php, eval it, and then export the ones that matter.
Catch is: the variables exported don't cover all the ones needed by fudapi.inc.php.
For example, when fud_add_user() copies $vals['login'] to the alias, it relies on $GLOBALS['MAX_LOGIN_SHOW'] and will fail if that's not set, and the alias field will stay blank.
I searched fudapi for uses of globals and added these to be exported:
'SERVER_TZ', 'MAX_LOGIN_SHOW', 'POSTS_PER_PAGE',
'WWW_ROOT', 'LOGEDIN_TIMEOUT', 'TMP'
There may be other ones in code called from fudapi? For easier future integration, it'd be great if there was a fool-proof way to get all globals exported correctly.
Simply including GLOBALS.php at the top of fudapi.inc.php won't work for me because fudapi.inc.php is being included inside a function and I have no control over that.
|
|
|