News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Zend Developer Zone:
Wrapping C++ Classes in a PHP Extension
April 23, 2009 @ 10:21:50

On the Zend Developer Zone a new tutorial has been posted looking at taking your pre-existing C++ functionality and wrapping it in a PHP extension to be used directly in your code.

In this tutorial I am going to walk you through creating a PHP extension called "vehicles" which will expose a single class called "Car" (obviously in the real-world, your extensions will expose many classes, but I'm trying to keep things simple). The extension will be built for PHP 5. I am only going to give instructions for building the extension in a UNIX-like environment, although most of what I cover should apply to Windows extension development as well.

The tutorial walks you through everything - how the file layout should look, making a build system, the contents of his files (the sample extension lets you do things to the Car like shift gears and brake) and how to combine the C++ code with the build process to create a shared module you can include right in your php.ini.

0 comments voice your opinion now!
module shared phpize buildfile tutorial c extension cplusplus class


blog comments powered by Disqus

Similar Posts

Zend Developer Zone: Dynamically Generating PDF Files with PHP and Haru

JoomlaBlogger.net: How to understand Joomla templates in five easy steps

Joshua Eichorn\'s Blog: ZActiveRecord can\'t work?

Sameer Borate's Blog: NewYork Times Bestseller API access in PHP

Johannes Schluter's Blog: A hidden gem in PHP 5.3: fileinfo


Community Events

Don't see your event here?
Let us know!


interview extension language voicesoftheelephpant laravel release version podcast library api series wordpress introduction opinion example php7 community unittest framework laravel5

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework