PHP, PECL and PEAR provides more functionality than you can shake a stick at. Sometimes though you need to add functionality that is not yet provided by the core language or any extension. For example using IO or a C library that is not yet supported, or carrying out some processor intensive computation. In these cases you need to resort to writing your own C extension.
This tutorial comprehensively covers writing PHP extensions in C. It starts with setting up a build environment. It then introduces the basics of C extension development and work through an full example. The example will explain the various PHP data types and how PHP function arguments are handled in C. The tutorial will then move on to more sophisticated areas of extension development such as writing a stream wrapper, implementing PHP classes and using external C libraries. The tutorial will also look at using C++ rather than C as the extension language. It will cover the requirement of thread safety in extensions and explain the macros provided by PHP to support this. Finally it will talk about documentation and the facilities provided by the PHP site for PECL writers such as PECL database and SVN server.
Good workshop. Melanie started directly with a hands-on experience in compiling a simple extension. Since writing (and understanding) extensions need a certain amount of php internal knowledge, a lot of time was spend on some dry theory (not necessarily a bad thing though!) Melanie knows her stuff and a lot of background information was presented during the workshop.
Really would have liked it to have a classical creation of writing your own extension (for example: creating a string-reverse function, own stream wrapper etc).
Great workshop Melanie explained it very well, although the slides could use some work. Most of them were hard to read, but luckily you had code samples to go with it and read along. She even managed to make a few of us laugh, and thats an impressive accomplishment!
Great tutorial! Melanie covered everything, from the most basic 'hello world' PHP extension to actually explaining how to deal with stuff like ZVALs, hash tables, classes and objects. The learning curve is a bit steep if you've never actually written a PHP extension (like myself) but Melanie explained everything in a very clear way.
Now I've done the tutorial I don't have the feeling that I can write an extension without having an example next to it quite yet, but at least I now know what's going on when I look at the sourcecode of existing extensions, and I know where I can find the building blocks to create my own extension :). Great tutorial overall, I'd recommend it to anyone who wants to learn how to write PHP extensions.
Melanie knows her stuff, so there was a lot of great technical content in here. She's also good at answering questions on the fly while keeping the flow of the presentation. This was particularly useful, as I don't think (as an audience) we quite had the C skills she was initially expecting.
Learned a lot, definitely made the right choice of workshop to attend.
Execellent tutorial session, handled expertly by Melanie- logically stepping through the issues in a clear methodical manner. The subject matter is hard to convey traditionally, but Mel ensured all the relevent dependencies where touched upon in a timely manner. Glad I attended!
Great talk and enjoyable day! Have come out of it feeling that I should be able to navigate my way around the PHP source with a little more understanding of how things work.
Melanie clearly knows her stuff, and was available to answer questions that people had.
If you want to know more about how PHP works and how you can extend it, definitely a good tutorial to attend.
Know of an event happening? Let us know! We love to get the word out about events the community would be interested in and you can help us spread the word!
Jun 10, 2010, 13:10 by jthijssen
Good workshop. Melanie started directly with a hands-on experience in compiling a simple extension. Since writing (and understanding) extensions need a certain amount of php internal knowledge, a lot of time was spend on some dry theory (not necessarily a bad thing though!) Melanie knows her stuff and a lot of background information was presented during the workshop.
Really would have liked it to have a classical creation of writing your own extension (for example: creating a string-reverse function, own stream wrapper etc).