Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10016 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30348 invoked by uid 1010); 21 May 2004 21:37:44 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 30167 invoked by uid 1007); 21 May 2004 21:37:42 -0000 To: internals@lists.php.net, Marcus Boerger Message-ID: <40AE76A2.4050901@procurios.nl> Date: Fri, 21 May 2004 23:37:38 +0200 User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) X-Accept-Language: en MIME-Version: 1.0 References: <20040521125205.72466.qmail@pb1.pair.com> <110719642.20040521182307@marcus-boerger.de> In-Reply-To: <110719642.20040521182307@marcus-boerger.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 80.126.112.196 Subject: Re: [PHP-DEV] Extending internal classes like mysqli From: bert@procurios.nl (Bert Slagter) Hi Marcus, Thanks for your clear answer :). What are the future plans concerning this issue? Will I be able to just extend this class as I want? For which version is that planned? The answers to these questions heavily influence design choices I have to make now. Oh, and I'm curious why the article on Zend.com mentions that extendability is a key feature of mysqli. Even though it cannot be extended.. :) Bert Marcus Boerger wrote: > 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 > > > > >