Re: Interested in Abstract Extension API and Dependency Interface

[email protected] (shire) Wed, 25 Mar 2009 13:17:07 -0700
Newsgroups php.gsoc
Message-ID <[email protected]>
Hello Varuna,

Varuna Jayasiri wrote:
> Hi,
>
> I'm Varuna Jayasiri, a second year undergraduate student at University
> of Moratuwa, Sri Lanka.
>
> I read the description about the proposed idea in the GSOC 2009 idea
> list. Although I have experience with C/C++ and PHP, I haven't worked on
> (developed) extensions for PHP.  So can you please help me find soe web
> resources (I went through source code of two extensions :) ) where I can
> find more information, regarding PHP extensions and present problems, so
> that I can prepare a better application and make sure that I can
> complete the project before I apply :).
>

I would recommend doing some more searching around on the mailing lists, this is a question that comes up regularly.  Here's a recent one with some links:

http://markmail.org/message/rm732fkj7yls35fg

Specifically:

http://devzone.zend.com/public/view/tag/extension
http://talks.php.net/index.php/Internals
http://talks.somabo.de/

Sarah's book is the best current written source for this subject: Extending and Embedding PHP

You should try to familiarize yourself with the README files in the sources here http://cvs.php.net/viewvc.cgi/php-src/


And lastly definitely do some more research into the existing extensions, much of PHP's knowledge simply comes from looking at the source.  Be familiar with building extensions (phpize, configure, autoconf scripts etc) and installing/debugging them as well as building PHP from source etc.  (some gdb macros exist in php-src/.gdbinit).

  
> Also, in order to deal with the problem of load order, is it fine to
> have two rounds of extension initialisation:
> 1. First to collect the API structures and dependancies of all
> extensions and
> 2. Then to initialise only the extensions where all
> (required)dependancies are available.
>

While this is one possibility it's not ideal, I would like to avoid two module initialization phases, however on some level this probably has to occur to accomplish the goals.  I think the ability to set a callback in the module init phase for those extensions that need this feature is a slightly better solution.  This is a good area for more research into better possibilities. ;-)

Once you've had time to review the above details and decide if this project is something you want to pursue, it would be good to have you submit a detailed proposal.


Thanks,

-shire