Newbie writing a PHP extension

From: Date: Fri, 13 Jul 2001 13:28:43 +0000
Subject: Newbie writing a PHP extension
Groups: php.dev 
Request: Send a blank email to php-dev+get-59961@lists.php.net to get a copy of this message
Hi, I've decided to write an extension to interface to id3lib (http://id3lib.sf.net/). I've created my new extension (using ext_skel) and I understand what's going on in the stub that it creates. I've even modified the config.m4 file to detect whether id3lib is installed properly. id3lib is a C++ library. I would like to create PHP objects to directly interface to the C++ classes within the library. I found the PHP docs about developing extensions to be very sparse, and directed mainly for PHP 3. Is there anywhere which has proper docs dealing with PHP 4? I've found the API docs at Zend, but there doesn't seem to be a way of downloading them (this is a requirement for me). This library being C++, does its own memory allocation. Should I worry and try to write operator new() and operator delete() replacements and static-link the library, or just not bother and use the library as is? Another thing is garbage collection. How can I get PHP to tell me to free the memory dealing with my objects when they get cleaned up? Do I need to record all allocations and free things in my PHP_RSHUTDOWN function? Not only is this my first PHP extension, but it is also my first proper Linux project. I've been programming C/C++ on Mac for a good few years, and programming PHP for over a year now. I know roughly how the build process works, but I'm sure there are more things I should know. Does anyone have suggestions on books to buy that would cover programming non-GUI programs and libraries, and the build process (building configure scripts and Makefiles)? Thanks, -- Chris Boot bootc@worldnet.fr "Modem error handling really su~c%dk,s.^D^D&x@R*cCKo#?CB,*o#?C!!b %o#? NO CARRIER

« previous php.dev (#59961) next »