Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68558 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20829 invoked from network); 17 Aug 2013 23:08:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Aug 2013 23:08:31 -0000 Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.192.177 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.192.177 mail-pd0-f177.google.com Received: from [209.85.192.177] ([209.85.192.177:51777] helo=mail-pd0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4A/77-18114-E6200125 for ; Sat, 17 Aug 2013 19:08:31 -0400 Received: by mail-pd0-f177.google.com with SMTP id y10so3517159pdj.8 for ; Sat, 17 Aug 2013 16:08:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=O1cOA4bB2HhLmEc1OTDrFWLNkASsoKhUVvb6j9077lM=; b=OZ/Zp6WRvdDmcuNBqIjl3g3WuINaT0dEnuIMvknXVeDTrwXIrIRExkqTVrYLri5QPj oHWtN5iyzPneHFkBawQvTVFZWcjYGiKyQ5fSFpg8IfKdXVDCYbIbqs+1eg0MD2eocaSC JFhFSTBLpAsqB9FYD8vFwb3HdThFtf7F3AwgdfdxORl33i1tRO8bUTsWUPUIIlMMdy+K EbMwVuemL2aPzovBkemC728/oE2gUYPRuTLcgIKGnznYvCKRYYGaJmbEGAnyHLoUphmC 4WahgVibF+091U/OllDQJUmZtCCWS92p6HvCGIj5vaqtiryDJ7qV2xMSIstTJxmANeZH Kplw== X-Gm-Message-State: ALoCoQmv9q141fGjQx7v9nos8yO0cJw4LHaD66vjlqe5grtnBG80hlj3/efhsybEWBgS9/dyYsOh MIME-Version: 1.0 X-Received: by 10.66.240.67 with SMTP id vy3mr4971941pac.141.1376688506694; Fri, 16 Aug 2013 14:28:26 -0700 (PDT) Sender: php@golemon.com Received: by 10.70.24.33 with HTTP; Fri, 16 Aug 2013 14:28:26 -0700 (PDT) X-Originating-IP: [173.252.71.189] In-Reply-To: References: Date: Fri, 16 Aug 2013 14:28:26 -0700 X-Google-Sender-Auth: 7tujftta7lOP1ryPWIPz1nbXZlo Message-ID: To: J David Cc: PHP internals Content-Type: multipart/alternative; boundary=047d7b15ab7f687eaa04e417455e Subject: Re: [PHP-DEV] Interest in a "null" SAPI for embedding? From: pollita@php.net (Sara Golemon) --047d7b15ab7f687eaa04e417455e Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Ah, I see. I wasn't taking "null" quite literally enough. :) That sounds pretty awesome to me. Assuming the implementation looks good you'd get my vote. On Fri, Aug 16, 2013 at 11:03 AM, J David wrote: > On Fri, Aug 16, 2013 at 12:40 PM, Sara Golemon wrote: > > Apart from managing lifecycles, the SAPI is also resposible for things > like > > directing I/O between the host application, how does null-sapi handle > this? > > It doesn't. It provides no SAPI functionality at all (hence "null"). > > Its only purpose is to allow building SAPIs separately from building > PHP by leaving all that stuff out. The sapi_module_struct and all its > callbacks -- including but not limited to I/O handling -- are provided > later by the externally-built SAPI. > > This offers several benefits: > - it makes embedding PHP easier and more flexible. > - it allows new SAPIs to be developed and distributed independently of > the PHP source tree (i.e. as part of a web server or as a separate > package) > - it (hypothetically) makes SAPIs modular and able to be selected at > runtime rather than build time > - (therefore) it allows multiple SAPIs to coexist in a single installatio= n > > Obviously our use case is the first/second. > > The last two benefits are hypothetical, since they would require > existing SAPIs to be tweaked. > > E.g. currently the CLI SAPI and the apache2 SAPI can coexist, but they > do so by building the entire PHP runtime into both =85/bin/php and > =85/apache/libexec/mod_php5.so. If they were tweaked to build with > null-sapi: > > - the "main" build would be null-sapi which produces only libphp5.so > with no SAPI code > - the CLI and apache2handler SAPI's would be built after/separately > from the "main" build, like extensions > - the CLI binary and mod_php5.so would both link to the same shared > libphp5.so at runtime, instead of the current approach where they both > contain the entirety of PHP. > > Modifying the existing SAPI's would be a bigger step and may not be > desirable for other reasons. It isn't something we have pursued or > consider necessary; the first two benefits were sufficient for us to > justify doing this. But the issue of building multiple competing > SAPIs from one tree does come up from time to time, so if you want to, > imagine a possible bright future world of arbitrary happily coexisting > SAPIs. :) > > Thanks! > --047d7b15ab7f687eaa04e417455e--