Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78544 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84850 invoked from network); 1 Nov 2014 13:15:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Nov 2014 13:15:50 -0000 Authentication-Results: pb1.pair.com header.from=damz@damz.org; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=damz@damz.org; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain damz.org designates 209.85.217.182 as permitted sender) X-PHP-List-Original-Sender: damz@damz.org X-Host-Fingerprint: 209.85.217.182 mail-lb0-f182.google.com Received: from [209.85.217.182] ([209.85.217.182:45181] helo=mail-lb0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 64/91-63593-40DD4545 for ; Sat, 01 Nov 2014 08:15:49 -0500 Received: by mail-lb0-f182.google.com with SMTP id f15so8169285lbj.27 for ; Sat, 01 Nov 2014 06:15:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=damz.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=H5KUFMNtlaRxyq/HymT+qtQklRrgfbKX/RjQFS4x1Z4=; b=jUJSbczuEvPyfQXEn85RGDhbfMYPN5F2LJLF6hDHqHvAJHs5y38IzX88itnGHDKGh3 rptYGNlL9FtxBfyGN6iYgP+oZn9UyXZn5CynNZ49uJBuVC1eJUKwQrBRk7z3cQC+qsaV UO/w1ujP8v3L/GlD5D+FwP2tusgjCBznXuUR4= 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:date :message-id:subject:from:to:cc:content-type; bh=H5KUFMNtlaRxyq/HymT+qtQklRrgfbKX/RjQFS4x1Z4=; b=GIhD2rLr9M3/e03XKQzRkwTako1vvCumbdRrjmVMhPK/5/goOAGUAZUtxpy+5Gupos HoWrFZ91BbzQ25dTbPguJQ81/5+nE63EiCvE/6AM/gpBBKeyv8UnVqAaDhoNXJ230aYo MciugzdFEeN/Zh+NKhqHTCFTZl6l68xTtotZqjDrh3sPPypnPmxo5GuXywo5XQDoIaLX kcu77rKe1j8TKGTMsnZ6QqpO2BqPMtTYmSoWOY5tB1szST4xfFF/LrKv4o/zTntZhef/ x0CjZTVBX/wv5KCuFoshbqtgBeV+3HH5dgQAIXpg/CdLQtgTy011t655iAtR+AfkGSTx 2Jvw== X-Gm-Message-State: ALoCoQkasKtvoz+zsSE7G+B0RPdZRPdMTPFWut9oBhxZnxUTLZpHoVHgRZtBVMqpcqmMbWe8hKdO MIME-Version: 1.0 X-Received: by 10.152.37.69 with SMTP id w5mr20520181laj.84.1414847745782; Sat, 01 Nov 2014 06:15:45 -0700 (PDT) Received: by 10.25.12.200 with HTTP; Sat, 1 Nov 2014 06:15:45 -0700 (PDT) X-Originating-IP: [77.134.18.241] In-Reply-To: References: <5452B87B.5040009@garfieldtech.com> <0B797CE3-7AFA-4330-9A98-D3CAFC6D6072@ajf.me> <5453B114.6050400@gmail.com> <5453C250.8090803@gmail.com> <5453D6D5.2070705@garfieldtech.com> Date: Sat, 1 Nov 2014 14:15:45 +0100 Message-ID: To: Andrea Faulds Cc: Larry Garfield , "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] New Standardized HTTP Interface From: damz@damz.org (Damien Tournoud) On Sat, Nov 1, 2014 at 1:40 PM, Andrea Faulds wrote: > > On 31 Oct 2014, at 18:37, Larry Garfield wrote: > > IF internals wanted to add implementation, not just improving streams, something like the following would be much more useful: > > > > $request = http_get_request(PHP_STDIN); // or something > > > > Where $request is an object that implements the PSR-7 RequestInterface (or at least the read-only parts of it), or something similar. Then implementers can compose that object however they want. > > [...] > > This sums up my thoughts on this very well. Nobody needs to change how we parse the data. We just need better access to the results of the parsing. Alternatively, what I would see as extremely useful would be to be able to expose the "main loop" of the SAPI. Have a way (via an ini mechanism) to register a callback that is executed when a requests start processing. Essentially, similar to what is provided by WSGI (for Python) and Rack (for Ruby). The default implementation would be something like: (with this callback executed in the scope of the new request) But you could override any of it if you wanted to, and that would pave the way nicely to more advanced PHP SAPIs (possibly evented) down the road. Damien