mapping c++ classes to php classes

php.internals

joerg mauz

23 years ago
hi all, just one simple questions: when I write a c++ extension for php (already done so far) are there any mechanism provided by php to map my c++ classes to php or do I have to write some kind of a php to c++ class wrapper (every member function for the php class will call a native c function that does the job) my self ? any ideas ? thanks in advance cu joerg

Derick Rethans

23 years ago
Hi, On Wed, 28 May 2003, joerg mauz wrote:
> just one simple questions: > > when I write a c++ extension for php (already done so far) are there > any mechanism provided by php to map my c++ classes to php or do I > have to write some kind of a php to c++ class wrapper (every member > function for the php class will call a native c function that does the > job) my self ?
You need to write such a wrapper yourself. regards, Derick
-- "my other box is your windows PC" ------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ International PHP Magazine http://php-mag.net/ -------------------------------------------------------------------------

Per Lundberg

23 years ago
On Wed, 2003-05-28 at 10:03, Derick Rethans wrote:
> On Wed, 28 May 2003, joerg mauz wrote: > > when I write a c++ extension for php (already done so far) are there > > any mechanism provided by php to map my c++ classes to php or do I > > have to write some kind of a php to c++ class wrapper (every member > > function for the php class will call a native c function that does the > > job) my self ? > You need to write such a wrapper yourself.
It would actually be very convenient to have a C++ to PHP class mapping extension, that would seamlessly integrate C++ classes into PHP, making them be callable from PHP code (and the other way around as well would also be very good). This is a bit similar to what gcj is doing; they have a special API called CNI (Cygnus Native Extensions) that makes Java classes be available to C++ classes, and the other way around. It works very well as far as I understand, but of course it is much easier to do it with Java and C++ since they share almost all the syntax and concepts, and they are both compiled environments... PHP is a different baby. :)
-- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.nobolt.com

J Smith

23 years ago
Maybe my original mail didn't get through, but this might help... http://www.tutorbuddy.com/software/phpcpp/ J Joerg Mauz wrote: