1
TheFinni
Xoops core database $GLOBALS
  • 2009/3/31 5:32

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


Would anyone be able to explain why several XOOPS core class files have been edited with a different way to associate to the Database class and connection?

In the newest core 2.3.3 the database connection is now defined as:

$this->db = $GLOBALS['xoopsDB'];

It used to be:

$this->db =& Database::getInstance();

I've read somewhere it's better security wise to avoid $GLOBALS. Is this at all a concern in the new XOOPS core?

2
Catzwolf
Re: Xoops core database $GLOBALS
  • 2009/3/31 6:13

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


The correct call to the database should be the following:

$this->db = &XoopsDatabaseFactory::getDatabaseConnection();


As far as I am concerned, all $GLOBALS calls should be removed the core and people should be made aware of the correct methods of accessing class instances etc.

Catz

Login

Who's Online

262 user(s) are online (150 user(s) are browsing Support Forums)


Members: 0


Guests: 262


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits