ID: 41356
User updated by: simon at connexon dot com
Reported By: simon at connexon dot com
-Status: Open
+Status: Closed
Bug Type: SOAP related
Operating System: Windows
PHP Version: 5.2.2
New Comment:
using $GLOBALS instead of global seems to fix the problem
Previous Comments:
------------------------------------------------------------------------
[2007-05-10 17:18:22] simon at connexon dot com
Description:
------------
For our application we use a $db which represents the database
connection object.
In the class, instead of creating a new object every time, we do :
global $db, which retrieves the database connection from outside the
class.
That works good!
However, when we call that class from a soap server, for some reason it
does not get the $db variable (its blank)...
Reproduce code:
---------------
// Code
$db = new MySQL();
// class
class X extends A
{
public function __construct($params)
{
global $db;
$this->db = $db;
$this->init($params);
}
Expected result:
----------------
that the global $db; in the constructor contains the db connection
Actual result:
--------------
blank variable
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41356&edit=1