#41356 [NEW]: Cannot retrieve global from a class in a soap server

From: Date: Thu, 10 May 2007 17:18:22 +0000
Subject: #41356 [NEW]: Cannot retrieve global from a class in a soap server
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-112489@lists.php.net to get a copy of this message
From:             simon at connexon dot com
Operating system: Windows
PHP version:      5.2.2
PHP Bug Type:     SOAP related
Bug description:  Cannot retrieve global from a class in a soap server

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 bug report at http://bugs.php.net/?id=41356&edit=1
-- 
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41356&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41356&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41356&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=41356&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=41356&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=41356&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=41356&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=41356&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=41356&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=41356&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=41356&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=41356&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=41356&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41356&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=41356&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=41356&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=41356&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41356&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=41356&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=41356&r=mysqlcfg


Thread (2 messages)

« previous php.bugs (#112489) next »