Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78920 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40211 invoked from network); 17 Nov 2014 07:42:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Nov 2014 07:42:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=pthreads@pthreads.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=pthreads@pthreads.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pthreads.org from 209.85.212.179 cause and error) X-PHP-List-Original-Sender: pthreads@pthreads.org X-Host-Fingerprint: 209.85.212.179 mail-wi0-f179.google.com Received: from [209.85.212.179] ([209.85.212.179:63740] helo=mail-wi0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D9/40-35814-FF6A9645 for ; Mon, 17 Nov 2014 02:42:57 -0500 Received: by mail-wi0-f179.google.com with SMTP id ex7so8078893wid.12 for ; Sun, 16 Nov 2014 23:42:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:content-type:mime-version:content-transfer-encoding; bh=1ih77epxLg0Rh3z0Ef2rpT+DbPa9Qh9b69xBIXHrlfg=; b=Qr41oarH0dDV4UfdAkAUCY3HS+dhtrGBCGp+/7o3FlSy7jH2dt5ZAGq2Px8Smdg7yZ oJAMYcZMJre/jzMI2yCk3THJz7PNzk4lxJ7IskGT9uOxqqYLtsAvBnDeTT7sAdv6pb08 CbsoSrgCHcFDCakERDMIRXq70JbS2ZHQbHkQvdIsSnOzf8kzliXoWLfMBiJlF/HzTXd4 JSz8V+/AqbfBhGhwTri3pEZkVQg4J0NyRVbcPThVN2RX1X28x7gqpUNWSi6I8SyXkKvK /w/D//0yX70nTY0tWDlQby/jxgEmJReaWgcWF/YuQeVABQZcWqGqh9gncJmdU5TTNj59 R29w== X-Gm-Message-State: ALoCoQlOT5NE1Kyyucr0j3fPVMUS95iOHt0krXAOevpL/Je8aHo4U4WJuvkX5unRnnOmbj9ndmTz X-Received: by 10.180.90.237 with SMTP id bz13mr29025171wib.15.1416210172437; Sun, 16 Nov 2014 23:42:52 -0800 (PST) Received: from [192.168.1.67] (host86-164-152-41.range86-164.btcentralplus.com. [86.164.152.41]) by mx.google.com with ESMTPSA id ft8sm27455116wjb.17.2014.11.16.23.42.51 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 16 Nov 2014 23:42:51 -0800 (PST) Message-ID: <1416210170.27517.1.camel@localhost.localdomain> To: Florian Margaine Cc: PHP Internals Date: Mon, 17 Nov 2014 07:42:50 +0000 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] SAPI refactoring From: pthreads@pthreads.org (Joe Watkins) 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. Cheers Joe