Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82196 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89712 invoked from network); 9 Feb 2015 00:02:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Feb 2015 00:02:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=ua.san.alex@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ua.san.alex@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.173 as permitted sender) X-PHP-List-Original-Sender: ua.san.alex@gmail.com X-Host-Fingerprint: 209.85.223.173 mail-ie0-f173.google.com Received: from [209.85.223.173] ([209.85.223.173:33023] helo=mail-ie0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8A/6C-26926-819F7D45 for ; Sun, 08 Feb 2015 19:02:32 -0500 Received: by iecrl12 with SMTP id rl12so12841422iec.0 for ; Sun, 08 Feb 2015 16:02:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Ug6CPysJgNziHSr7n6YPQh4RX7XHR+GsC9Ty9QdundE=; b=BuaDsOC+nUYKvQ5mp73dpvLHZQzkf+nxl9yGFul2J8+MwGUukp+MgsG6RewcWo7M6k lEf9GyT+eLoKnbC67LoJJ88h1EHFg8JFjUjLK4gNHVh8dSoxuppSgkvj8DsaSND7MTXu 9U7kjvLGBKiSS20p1wSwxjcZgAAnrizQU3IwuRk/I4u47cziJf8JVyzROKMzbnBMpE2N hn/bRsmddrdR7zR7x9ZP4EPMuTnM1EjGpDuIN3G3tHu2sQOJXrb6EyEnNAG3XiKeHECK rnnvnKMpLFMP7QScc8GuGL+4PXQgAmibCDeoatoKveig275pxoNFMzEvWBzGX41ENXoU z7zw== MIME-Version: 1.0 X-Received: by 10.107.164.142 with SMTP id d14mr23508848ioj.13.1423440149086; Sun, 08 Feb 2015 16:02:29 -0800 (PST) Received: by 10.50.93.3 with HTTP; Sun, 8 Feb 2015 16:02:29 -0800 (PST) In-Reply-To: <54D7F5D5.4050808@gmail.com> References: <54D7F5D5.4050808@gmail.com> Date: Mon, 9 Feb 2015 02:02:29 +0200 Message-ID: To: Rowan Collins Cc: internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] uWSGI experimental plugin for implementing a WSGI/PSGI/Rack-like interface for PHP From: ua.san.alex@gmail.com ("S.A.N") 2015-02-09 1:48 GMT+02:00 Rowan Collins : > On 08/02/2015 22:48, S.A.N wrote: >> >> Hi internals. >> >> I really hope that in the future PHP 7, there will be new server API. >> May be you interested to know about them, here is the link, I am not >> the author of development: >> https://github.com/unbit/uwsgi-phpsgi/ >> >> But the problem is that in PHP there are no standards for such interfaces. >> Now it is implemented like this: >> >> > >> function application($env) >> { >> return ['200 OK', ['Content-Type' => 'text/plain'], 'Hello, world!']; >> } >> >> ?> >> >> I think this is a good opportunity to review the old interface ($_GET, >> $_POST, ...) and start using the API internal HTTP module. >> >> This all breaks backward compatibility, not $_GET, $_POST, ... >> But this WSGI SAPI will used only new PHP code (not PHP legacy base). >> >> This is a good opportunity to create something new and not be backward >> compatible. >> >> What do you think about this? > > > The problem with creating an event-based API for PHP is that you don't just > have to rethink superglobals, you have to rethink absolutely everything that > currently acts as global state: > > - global variables > - static variables within functions > - class static variables > - dynamic settings (ini_set etc) > - globally registered callbacks (set_error_handler, spl_autoload_register, > etc) > - the counters of include_once() and require_once() > - any function which implicitly fetches data based on some previous action > (e.g. libxml_get_errors) > > If the language is not itself multi-threaded, all of these become > arbitrarily shared once per thread the server spins up and reuses. If it > *is* multi-threaded, you have another set of headaches about how both the > engine and the userland can share and synchronize. > > Not that I don't like the idea, but it's a huge project, with potential for > profoundly affecting the language. > > Regards, > > -- > Rowan Collins > [IMSoP] > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > You're right, but there is no threading issues. One worker synchronously execute requests, but may run parallel many workers.