Trying to set up dev environment for PHP Extension

Joined
Jul 26, 2010
Messages
4
Reaction score
0
Points
1
Hey everyone:

I'm new to these forums so bear with me.

I'm hoping to become the new maintainer for PHP Extension called AMFEXT. I've been in touch with the original maintainer who has recommended a setup using Visual Studio which I am not particularly excited about.

The basic idea is that I want to set up an IDE on my Mac (Eclipse, XCode, or whatever) and develop in a *nix environment. The problem I'm having is that the amfext source code depends very heavily on the PHP source code for a variety of macros and other stuff and it has a variety of scripts (phpize, configure, etc) that auto-generate the Makefile depending on a variety of conditions within your PHP source directories.

I'm not really sure how to 'import' the existing code (and its makefile) into some IDE on my Mac so that it doesn't go rewriting the Makefile or creating all kinds of directory structures or whatever. I just want to see the *one* C source code file in my IDE with all the friendly code highlighting so I can take advantage of all the IDE goodies look function source locators and one-button compilation and stuff. I'm open to using pretty much any IDE that will allow me to do this.

Can anyone suggest how I might go about this? I've been trying to import with Eclipse and XCode and am not having much luck. NOTE this is not a darwin project but a C project.
 
Joined
Oct 3, 2009
Messages
4
Reaction score
0
Points
1
I prefer Netbeans. I use it extensively for Java development, and I know ti has strong C/C++, Ruby, and PHP support as well. Might give it a shot. Sounds like it couldn't hurt any.
 
OP
S
Joined
Jul 26, 2010
Messages
4
Reaction score
0
Points
1
Selection of an IDE is not really the issue here. The issue is how to set up whatever IDE I've chosen. This is difficult because the source code for amfext, written in C, relies on a couple of scripts to auto-generate a Makefile and various other files. These auto-generated makefiles and source files are required to make the extension play nice with the rest of the PHP project which consists of millions of lines of code.

I fiddled around with XCode yesterday and made some progress. I created a new XCode project in the source folder and added amf.h and amf.c to the project. I also added numerous directories to the Header Search Path. This resulted in most of the code errors going away.

However, I'm still getting 'missing symbol: _estrndup'. This should have been found because amf.c includes php.h which includes zend.h which includes zend_alloc.h which contains this:
Code:
ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
 
OP
S
Joined
Jul 26, 2010
Messages
4
Reaction score
0
Points
1
It did occur to me that this problem might be due to a library issue rather than a header issue, but I'm still not sure how to deal with it.

The amf source, unless compiled directly into the huge PHP project, is designed to create a shared library object, amf.so. I understand that PHP its Extensions make use of the Zend Engine's modified memory allocation routines such as estrndup. What is not clear to me is how amf.so should gain access to these routines. Do I need to add a library path in my XCode project? If so, which of the dozens of settings in the Project Settings dialog would be the one where I add this? Also, which folder would it be? I see that apache loads the php5 module from modules/libphp5.so.

Any help would be much appreciated.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top