Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51549 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44689 invoked from network); 2 Mar 2011 23:01:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Mar 2011 23:01:32 -0000 Authentication-Results: pb1.pair.com header.from=keisial@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=keisial@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: keisial@gmail.com X-Host-Fingerprint: 209.85.161.42 mail-fx0-f42.google.com Received: from [209.85.161.42] ([209.85.161.42:52069] helo=mail-fx0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FA/90-40003-94CCE6D4 for ; Wed, 02 Mar 2011 18:01:31 -0500 Received: by fxm20 with SMTP id 20so516208fxm.29 for ; Wed, 02 Mar 2011 15:01:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=WsRpIOrZI5U5eYpG/4qV3gemazDxtjc3iMRbj77vdLs=; b=bBny55XxXPGAlsDXlzEdFlb2eVNo9dWzo1m5b7JnSFeBV2Y+1qFDrNBc5XfJ3zkvTw kevIQN/GlFTpIFa60btkwGVxjDPKWBRrEteICYBRH7vutoRkhInhQ99DI8dxF3n0q7KK rUvbL5LnEVbLbPraJZzP/AS5nW7azFraKVGug= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=paGYEDNY5NenO8o8o96n89zRpybskbRVAcnUQ+ox4qXA4lgGiuqzPet4FKIQuxOYJN C4vMpJV2Uq9tC2uwmohSjTyJf1017/m+Imtcsqw59E+N2lzXEG0fO/64ViztDbO83ZwW 7hNTi2t/jsVnz8/teIcWepZnymaXdFgl/f3/s= Received: by 10.223.62.11 with SMTP id v11mr621293fah.27.1299106887278; Wed, 02 Mar 2011 15:01:27 -0800 (PST) Received: from [192.168.1.26] (126.Red-81-38-140.dynamicIP.rima-tde.net [81.38.140.126]) by mx.google.com with ESMTPS id 21sm290241fav.17.2011.03.02.15.01.25 (version=SSLv3 cipher=OTHER); Wed, 02 Mar 2011 15:01:26 -0800 (PST) Message-ID: <4D6ECD36.1070804@gmail.com> Date: Thu, 03 Mar 2011 00:05:26 +0100 User-Agent: Thunderbird MIME-Version: 1.0 To: Moriyoshi Koizumi CC: PHP Developers Mailing List References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RFC: built-in web server in CLI. From: keisial@gmail.com ("=?ISO-8859-1?Q?=C1ngel_Gonz=E1lez?=") Moriyoshi Koizumi wrote: > Hi, > > Just to let you know that I wrote a RFC about built-in web server > feature with which PHP can serve contents without a help of web > servers. That would be handy for development purpose. > > If interested, have a look at http://wiki.php.net/rfc/builtinwebserver . > > Regards, > Moriyoshi I like the idea. Regarding the patch (https://gist.github.com/835698): I don't see a switch to disable the internal parse on configure. I'd expect the files to be on its own folder inside sapi, even being able to bundle them in a single binary. Why is this needed on WIndows? + ADD_FLAG("LIBS_CLI", "ws2_32.lib"); Surely php will already link with the sockets library for its own functions. The http parser code seems copied from https://github.com/ry/http-parser and it may not be a good idea to modify it downstream, but it seems to do more things than strictly needed by php (eg. there are more methods than those a php server would take use). It also seems to be a hand-coded lexer, so that's much more verbose than a set of rules. The patch looks messy as it splits main in two functions, so it gets hard to follow, but is probably good overall. The change from php_printf to printf in line 3988 looks wrong. Any special reason to disable it on PHP_CLI_WIN32_NO_CONSOLE ?