Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:1480 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50883 invoked from network); 13 May 2003 15:47:39 -0000 Received: from unknown (HELO jedi.webgate.bg) (212.50.2.189) by pb1.pair.com with SMTP; 13 May 2003 15:47:39 -0000 Received: from andreywin (nik.office.webgate.bg [192.168.1.22]) by jedi.webgate.bg (8.12.9/8.9.3) with SMTP id h4DFnxuM006809; Tue, 13 May 2003 18:49:59 +0300 Message-ID: <013501c31966$faf67400$1601a8c0@andreywin> To: "Ptker" , References: Date: Tue, 13 May 2003 18:47:38 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="hz-gb-2312" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2720.3000 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Subject: Re: [PHP-DEV] Registering multi classes in one PHP extension From: andrey@webgate.bg ("Andrey Hristov") Add a constructor for myapp class in the C code. It should be named myapp. The in the constructor - do getThis() and add property using the add_property_zva() macro. The zval have to a instance of mylib class (use object_init_ex()). Hope this helps, Andrey ----- Original Message ----- From: "Ptker" To: Sent: Tuesday, May 13, 2003 6:38 PM Subject: [PHP-DEV] Registering multi classes in one PHP extension > Hi. > > Any manual about registering multi classes in one PHP extension? > Simple example:(register two classes named myapp and mylib) > INIT_CLASS_ENTRY(myapp_class, "myapp", myapp_class_functions); > myapp_ptr = zend_register_internal_class(&myapp_class TSRMLS_CC); > > INIT_CLASS_ENTRY(mylib_class, "mylib", mylib_class_functions); > mylib_ptr = zend_register_internal_class(&mylib_class TSRMLS_CC); > > Now I want write the code in php like following: > ... > $myapp = new myapp(); > $myapp->mylib->dosomething(); > ... > ?> > The member mylib of myapp is registered in C code, also is an object by mylib class. How to do? > I read some code in ext/(like pear) that contaings that function, but I can hardly understand that code. > > Any manual or tutorial about that topic? > > Thanks. >