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:

le="color: #000000"><?php $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

Donat-O-Meter

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

Latest GitHub Commits