Hi Silvia,

@ 8:44:09 AM on 11/21/01, Silvia Mahiques wrote:

> The code file (xxxx.php) that has this first reference is:

>     $global_var = new one_class();


> If I include this file (xxxx.php) in another php file, a new instance is
> created again, and I want a unique instance in all project.


You should only need to do this (unless I've misunderstood):

if(!defined('ONE_CLASS'))
{
   define('ONE_CLASS', 1);
   $global_var = new one_class();
}

That should only create one instance.

--
 -Brian Clark | PGP is spoken here: 0xE4D0C7C8
  Please, DO NOT carbon copy me on list replies.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to