Re: Extending internal classes like mysqli

From: Date: Fri, 21 May 2004 16:23:07 +0000
Subject: Re: Extending internal classes like mysqli
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-9999@lists.php.net to get a copy of this message
Hello Bert, some of the internal classas cannot be extended and unfortunatley they are not marked as 'final' right now. For you that means you need to extend it by a proxy class that reimplements the original class protocol and uses the original class as a property. Friday, May 21, 2004, 2:52:08 PM, you wrote: > Good afternoon! > Could anyone explain what we're supposed to do with internal classes > like the mysqli class. > In an article on Zend.com > (http://www.zend.com/php5/articles/php5-mysqli.php) the fact that the > object oriented interface can be extended is brought as a major feature. > But it seems that it's impossible to extend the mysqli class, see my bug > at http://bugs.php.net/bug.php?id=28430. > What I want is this. I need some custom logging for my database layer. > So I want to extend the mysqli class and overwrite one or two methods > and add some custom methods. > Shouldn't I be able to just do: > class foo extends mysqli > { > } > $foo = new foo(); > Right now this doesn't work - the variable $foo->thread_id isn't > available for example. > Is this intended behaviour? > Bert Slagter -- Best regards, Marcus mailto:helly@php.net

« previous php.internals (#9999) next »