Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78921 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45483 invoked from network); 17 Nov 2014 08:00:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Nov 2014 08:00:43 -0000 Authentication-Results: pb1.pair.com smtp.mail=florian@margaine.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=florian@margaine.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain margaine.com from 209.85.213.180 cause and error) X-PHP-List-Original-Sender: florian@margaine.com X-Host-Fingerprint: 209.85.213.180 mail-ig0-f180.google.com Received: from [209.85.213.180] ([209.85.213.180:49252] helo=mail-ig0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 13/61-35814-82BA9645 for ; Mon, 17 Nov 2014 03:00:41 -0500 Received: by mail-ig0-f180.google.com with SMTP id h15so4726065igd.7 for ; Mon, 17 Nov 2014 00:00:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=geyZBrMpIcfuDVlzq6hizIQPsb1jNz6qzfSKmrqS2eM=; b=QNSoy666JttdUFStIZbJfG6yQw1RXnFg/FOCEKkp9kN/QDDSP/K1GDJ+dmo6wQls1Q 6OyUW5uq/3JIzLG03mFabJ5LMdzl66A4sgRKzX3rBCZFjosVxZzRdcjyWQkrHoRf8YWE QJR6h1+UDner35H2CyXyPeH/GnSLVNiWQ2Y63qzodqqjsewNZQ6sdVQWG9JR+tDCREFR DMnXyTNUHEQZ2OTxTi9DR4vib7lRW6RQmQCRyN/n2laJA7MThUR0bgw7jpQo/k67ARE8 o4Qo36f6geRDEo89vUT3+iXU9FgbYCzBQMkKXs4lDNadsNikwtO3yyoaEswncCOetb/+ F+VA== X-Gm-Message-State: ALoCoQlbxOB/sYw1YECPyQkbv1SVi6RTK5hTFEunLRvHQ4v3mEdWI4fKW5u3DvZj0dnsVkA8FJsL X-Received: by 10.50.111.110 with SMTP id ih14mr23704395igb.38.1416211237805; Mon, 17 Nov 2014 00:00:37 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.31.149 with HTTP; Mon, 17 Nov 2014 00:00:17 -0800 (PST) X-Originating-IP: [82.122.88.156] In-Reply-To: <1416210170.27517.1.camel@localhost.localdomain> References: <1416210170.27517.1.camel@localhost.localdomain> Date: Mon, 17 Nov 2014 09:00:17 +0100 Message-ID: To: Joe Watkins Cc: PHP Internals Content-Type: multipart/alternative; boundary=089e0149bb86c1b91b0508095ffe Subject: Re: [PHP-DEV] SAPI refactoring From: florian@margaine.com (Florian Margaine) --089e0149bb86c1b91b0508095ffe Content-Type: text/plain; charset=UTF-8 Hi Joe, On Mon, Nov 17, 2014 at 8:42 AM, Joe Watkins wrote: > On Sat, 2014-11-15 at 11:16 +0100, Florian Margaine wrote: > > Hi list, > > > > As of today, most of the SAPIs have a lot of code duplication with > > regards to HTTP headers parsing/handling. > > > > I'm about to completely duplicate a function from one SAPI to the > > other to add a feature to fpm (`getallheaders()`, see > > https://github.com/php/php-src/pull/523), and I'd like to avoid that. > > > > Should I create a `sapi/main/` folder for common functions across the > > SAPIs? Or should each SAPI remain completely independent from each > > other, even if it means duplicating code? > > > > Regards, > > > > Morning Florian, > > There is already a place to put shared SAPI code. > > main/SAPI.h > main/SAPI.c > > There is also a SAPI_API decl that you will need to use. > Thanks! > > Cheers > Joe > > Cheers, -- Florian Margaine --089e0149bb86c1b91b0508095ffe--