Re: Q on Class and EXTEND

From: Date: Wed, 03 Sep 2003 17:58:45 +0000
Subject: Re: Q on Class and EXTEND
Groups: php.general 
Request: Send a blank email to php-general+get-161581@lists.php.net to get a copy of this message
jsWalter wrote: > What I am trying to do is EXTEND the PEAR::Auth Class with new properties > and methods. > > But I still want to use the original instantiation call... > > $myAuth =& Auth(); > > So, I don't think I can rename the orginal Class in this case. > > I'm just being particular. > > Or do I have to create my new EXTENDED Class and then add code to PEAR::Auth > to make it work as if it is always just Auth? (I was told I could not do > that) You rename the PEAR::Auth class to something like Auth2. Then, you create your new class and call it Auth. The new Auth class will extend the old one. Then you include your new methods in the new class. Your old code will still continue to work. ---John Holmes...

« previous php.general (#161581) next »