Re: CGI and FastCGI SAPI
| From: | Michael Shadle | Date: | Wed, 01 Jul 2009 18:17:05 +0000 |
| Subject: | Re: CGI and FastCGI SAPI | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-44586@lists.php.net to get a copy of this message | ||
I think it would be a good idea to also include PHP-FPM in your investigation.
On Wed, Jul 1, 2009 at 11:02 AM, Gelu Kelunden<gelu.kelu@gmail.com> wrote:
> Hi,
>
> I'm trying to understand how difficult it is to create a new SAPI, so I
> started to poke my nose inside the "cgi" SAPI source code. I saw that
> "cgi_main.c" implements both the CGI and the FastCGI protocols and I kinda
> got lost inside all those if-else lines (I tried to take out the FastCGI
> code and failed miserably). I'm wondering if it's not better to have 2
> different SAPIs, one for CGI and for FastCGI.
>
> Advantages of this "split" would be:
> - the source code will be more readable without all those if-else statements
> - we would have 2 executables that do 2 different jobs, unlike now where
> php-cgi does both; each executable could then be further optimized for the
> exact job they are performing
>
> Disadvantages I see:
> - maintaning 2 SAPI implementaion would require more work (since CGI and
> FastCGI both share most of the SAPI code, any change would have to be
> replicated twice)
> - break backward compatibility (where php-cgi handles both CGI and FastCGI)
>
> Thank you for your time,
> Gelu
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>