FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » GLOBALS.php "Bug"??
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
GLOBALS.php "Bug"?? [message #165087] Sat, 23 April 2011 11:43 Go to previous message
Dayo is currently offline  Dayo   Bahrain
Messages: 101
Registered: April 2011
Karma:
Senior Member
I have been facing an issue with calling GLOBALS.php externally and in summary, the issue is that the various variables are initialised in GLOBALS.php based on the assumption that the file is always included within free standing procedural code.

For instance, assume a variable $XYZ = 123 is loaded in GLOBALS.php

When I include GLOBALS.php from within a function in an external application, Variable $XYZ is no longer global in scope but is now local to my function simply because of the way the application is structured.

If I then later try to use fudapi.inc for instance, references to $GLOBALS['XYZ'] will return a null value.

It seems to me that there are some pretty significant, if not day to day, structural issues that need attention.

Stuff like the "globals", db.inc etc should be put into classes and they can they be referenced everywhere simply by $Config->XYZ or $db->abc after a class_exists test to check in they have been loaded before. Even this can be done away with if a set of classes is loaded early in the flow in index.php for every call.

Anyway, this would be a fundamental change if agreed to and probably one for a bigger point release.

As an interim, perhaps $XYZ = 123 could be written as $GLOBALS['XYZ'] = 123 in GLOBALS.php as an interim step.

Not thought about the implications though

[Updated on: Sat, 23 April 2011 11:44]

Report message to a moderator

[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: SQL Error has occurred...
Next Topic: NNTP Import Subject with Non-Ascii Characters
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 11:28:51 GMT 2024

Total time taken to generate the page: 0.04014 seconds