Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70023 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92413 invoked from network); 6 Nov 2013 01:06:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Nov 2013 01:06:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=ingwie2000@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ingwie2000@googlemail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.215.178 as permitted sender) X-PHP-List-Original-Sender: ingwie2000@googlemail.com X-Host-Fingerprint: 209.85.215.178 mail-ea0-f178.google.com Received: from [209.85.215.178] ([209.85.215.178:64706] helo=mail-ea0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B1/00-26738-E1699725 for ; Tue, 05 Nov 2013 20:06:38 -0500 Received: by mail-ea0-f178.google.com with SMTP id a10so1502094eae.23 for ; Tue, 05 Nov 2013 17:06:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:content-type:subject:message-id:date:to:mime-version; bh=OvpaTyUiKEj00PEIRF0zypYBS0+BNzyVuJ/Ai2VRUI8=; b=u65ySqk9g1HIQuEZPO9/Bch/Y7I45H6xcYuESJ3oRCIo66bakQ1mZ6LsC3rnaTE9+b DPtpQlpcFNKIu/9ZgSNZyQ4GJhkU9lDqtYc2WzYjhBsSYDmxdpDX/bZxMN17y3l10UaX qCtfrjGegqw+o6l4r4mYrPY8d3I+I1GeELrz1VRon0SbfqE4hS687GoN7qnETRezovGf saSFsoLrRFrjEn2klF6FqQIhV08LHbe2wGvf9GlWyr8JqwVg0FIf61WmuA8y3DToioCa lA/aum3zqO1JnBaZQx+IrVYt41wT8/fdT5pvlV2z4Mo+iPt4TLhIMamXAgWvioCNDnB3 Moqg== X-Received: by 10.14.5.133 with SMTP id 5mr45722eel.84.1383699995631; Tue, 05 Nov 2013 17:06:35 -0800 (PST) Received: from [172.20.10.2] ([89.204.130.37]) by mx.google.com with ESMTPSA id z2sm54359235eee.7.2013.11.05.17.06.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Nov 2013 17:06:35 -0800 (PST) Content-Type: multipart/alternative; boundary="Apple-Mail=_4FB51E44-88A0-47B4-9B99-14D5A2CE6BE9" Message-ID: <60B9BBE0-BC3F-490A-AD78-9EBC22C808CF@googlemail.com> Date: Wed, 6 Nov 2013 02:06:31 +0100 To: PHP internals Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1816\)) X-Mailer: Apple Mail (2.1816) Subject: CLI Web Server customization From: ingwie2000@googlemail.com (Kevin Ingwersen) --Apple-Mail=_4FB51E44-88A0-47B4-9B99-14D5A2CE6BE9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hello everyone. Currently, I am working on a project that allows PHP applications to be = developed with a GUI frontend based on Chromium - and later on CEF. For = this to work properly, I am spawning a new Chromium process with some = command line switches to allow customization of the launch. This means, = I can pass in the URL which should be opened, and disable features such = as translation and alike. However, the problem is the HTTP backend. = Currently, I am using a PHP script in the same process as the "watching" = process - which is basically a while loop that awaits for a client = connection. By using the pthreads extension, I am also handling events = that are received by the Remote Debug Protocol via a WebSocket = connection (PHP acting as a client here). As you can see, this is a = little chaos. So I have the event listener, the Webserver and process = watcher for Chromium in seperated threads. Once the browser is quit, I = have to use posix_kill to make sure the webserver dies as well - because = it simply wouldn't. So I got to the conclusion that I may change the logic, and remove the = webserver, and replace it by another spawned process of the PHP CLI HTTP = server. The problem is, I'd want to customize it some. Like, customize = error pages, logging, etc. I am also curios about something else. Back in some time, the PHP manual = read that the HTTP server is "for development only". The problem is, I = do not want to package an apache webserver into the bundle - or do some = nodejs scripting for some webserver. I'd like to stay on a PHP basis. Would be great if you can explain some things to me here! Related links for those curios: The actual project, drag0n: https://github.com/IngwiePhoenix/drag0n Deskshell (I maintain a fork and build the MacOS port): = https://github.com/sihorton/appjs-deskshell The current WebSocket client I am using for communication: = https://github.com/Devristo/phpws The Webserver was somewhere on google, the original file can be found = within drag0n, to be exact, here: = https://github.com/IngwiePhoenix/drag0n/blob/master/drag0n.app/Contents/Sy= stem/lib/php/WebServer.php Kind regards, Ingwie= --Apple-Mail=_4FB51E44-88A0-47B4-9B99-14D5A2CE6BE9--