Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44586 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10147 invoked from network); 1 Jul 2009 18:17:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jul 2009 18:17:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=mike503@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mike503@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.184 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: mike503@gmail.com X-Host-Fingerprint: 209.85.212.184 mail-vw0-f184.google.com Received: from [209.85.212.184] ([209.85.212.184:52075] helo=mail-vw0-f184.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 89/24-24906-828AB4A4 for ; Wed, 01 Jul 2009 14:17:12 -0400 Received: by vwj14 with SMTP id 14so503142vwj.29 for ; Wed, 01 Jul 2009 11:17:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=JP1csZn+fBn7OWcOgxPiQqwYZGMG2EBsiwJmGzJ2XSs=; b=Dbxnfm+HU8px3e4HMQ70utmTtTR1kJZ3hmpLGpijB5TA7ZSA+N3OYANyhCswMRfK0L +dyBrjppfo6SI5kP3GpioNQHd6Hu9SQ0JFd/JenT0f7c3sHhYKUK0n+MDGRe/zVmmH45 rsVbHSPxmMUHCi96Zu+TaH1WCjsB62C5zWAi8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=xKfn4zJPkv5lGTHAuXUlPTD2VeVgWabh6+m8UlwR5RQz8PxcwA9O8q9ju5fzkUbX94 D5WhC2uGGKLv/Kvol9oAqgAYl5DI6deYpUNK7ten/XQEVlGAR6pKPFLrfVRnEMF24FAH RWrTZmBXjzuSb+2TEuTw0h/NzMBjJ2aseq7Kc= MIME-Version: 1.0 Received: by 10.220.91.208 with SMTP id o16mr7140763vcm.25.1246472226997; Wed, 01 Jul 2009 11:17:06 -0700 (PDT) In-Reply-To: References: Date: Wed, 1 Jul 2009 11:17:05 -0700 Message-ID: To: Gelu Kelunden Cc: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] CGI and FastCGI SAPI From: mike503@gmail.com (Michael Shadle) 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 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 > >