RE: [PEAR] new class screwup
| From: | Andy Crain | Date: | Fri, 05 Sep 2003 17:27:45 +0000 |
| Subject: | RE: [PEAR] new class screwup | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-7602@lists.php.net to get a copy of this message | ||
Your extended class inherits getAuth() from the parent Auth class, so
there's no need to override it like this, and you can't override it in
any case, since getAuth() calls a private Auth method (i.e.,
_importGlobalVariable()) and therefore can't be called statically.
Andy
> -----Original Message-----
> From: jsWalter [mailto:jsWalter@torres.ws]
> Sent: Friday, September 05, 2003 3:55 AM
> To: pear-general@lists.php.net
> Subject: [PEAR] new class screwup
>
> I've been building an exended Class to Auth the past few days, and
making
> great progress.
>
> Until tonight.
>
> The class does not work now. :(
>
> I have no idea what I did.
>
> I've reduced my login logic to this...
>
> $objAuth->start();
>
> if ($objAuth->getAuth())
> header("Location:success.php");
> else
> echo '<div>Unsuccessful attempt, please try again.<p
> /></div>';
>
> ... display my login screen...
>
>
> I have reduced getAuth() to this...
>
> function getAuth()
> {
> // call PEAR::Auth getAuth() method
> Auth::getAuth();
> }
>
> A simple pass through!
>
> The script logic tells me it failed!
>
> But! If I 'X' out the method name like this...
>
> function XXgetAuth()
> {
> // call PEAR::Auth getAuth() method
> Auth::getAuth();
> }
>
> Making my script logic call back to the orginal getAuth() method in
Auth,
> I
> get the success page!
>
> I really don't understand that!
>
> Not one bit.
>
> I guess I don't understand OOP-PHP as well as I thought I did.
>
> Any ideas?
>
> Walter
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php