Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62054 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78966 invoked from network); 5 Aug 2012 23:21:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Aug 2012 23:21:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.170 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.220.170 mail-vc0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:41091] helo=mail-vc0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B7/B1-03102-8FFFE105 for ; Sun, 05 Aug 2012 19:21:28 -0400 Received: by vcbgb30 with SMTP id gb30so2541117vcb.29 for ; Sun, 05 Aug 2012 16:21:25 -0700 (PDT) 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=KKa0gKHU0Ta5/78SjwJIrsuqvAOaC4TCLAg9g5GTK9A=; b=aGStKvngJ55y0thdTYEFXbxIDogVam73VskUTI4A4Os/+wAOgCsCjw0hODU08YnAh+ 30iQZr+8bg92pR8vxtzs4x2z3IM0al772uQF7Zj2HDYeH6xwihsMzuGxeKlQu1G3jblH 5d0DfQ66En4bFArMoyVpWMIny2iym3T11i9KsAfT41xmeYrr9UZVYQfi5+yKz9qt05py Hqm1ISYcf5K4gpE5lHt7b+mBqrrgzVga5E207em1E+kelM7yV6mff40hINCBR2oVQ32r PBSMtShnDMvzvnwJJkrCiV+n8i3qii9hN2NDAHsiVs87vG8ZwTehykeJxr0qpXl2qv75 zKHg== MIME-Version: 1.0 Received: by 10.52.75.166 with SMTP id d6mr5731072vdw.113.1344208885433; Sun, 05 Aug 2012 16:21:25 -0700 (PDT) Received: by 10.58.216.166 with HTTP; Sun, 5 Aug 2012 16:21:25 -0700 (PDT) In-Reply-To: <1344205126.1440.1086.camel@guybrush> References: <1344205126.1440.1086.camel@guybrush> Date: Mon, 6 Aug 2012 01:21:25 +0200 Message-ID: To: =?UTF-8?Q?Johannes_Schl=C3=BCter?= Cc: PHP Internals Content-Type: multipart/alternative; boundary=20cf3071cc701ec54a04c68d0598 Subject: Re: [PHP-DEV] php interactive shell without readline From: tyra3l@gmail.com (Ferenc Kovacs) --20cf3071cc701ec54a04c68d0598 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Aug 6, 2012 at 12:18 AM, Johannes Schl=C3=BCter wrote: > On Sat, 2012-08-04 at 21:49 +0200, Ferenc Kovacs wrote: > > Hi, > > > > As most of you know, the current php interactive shell is pretty much > > useless without compiling php --with-readline, but for the most users > this > > the first impression what they experience (eg. using the php interactiv= e > > shell without readline support). > > Note that for 5.4 I refactored the code so a shared readline extension > is good enough by moving all shell related parts to ext/readline. This > should reduce the pain for distribution package users where typically > everything is shared. > for the record that would be https://bugs.php.net/bug.php?id=3D53878 and http://git.php.net/?p=3Dphp-src.git;a=3Dcommit;h=3D6c734a6b4c9ecf90162cf53f= cf5f89864ccabbde right? > > > There is an alternative readline replacement called linenoise ( > > https://github.com/antirez/linenoise/) written by the author of Redis, > and > > I would like to know, what do you think about using that for the > > interactive shell if php is built without readline support. > > It is really small/compact and it is under the two clause BSD license s= o > I > > think it would be a good candidate for bundling it in php. > > What do you think about it? Is it something worth looking into? > > There are two ways to do that: Either move the shell code back to > sapi/cli or making ext/readline play nice with linenoise. > I have to grasp the code a little bit better to answer that, but from a quick look I think that it was an improvement, that the readline stuff was moved out from there, so I think that we should keep that. The linenoise would be always available and I think it would be only a couple of lines, so I think that it would be possible to put it into php_cli.c but as you mentioned we should make it such a way, that even the dynamically loaded readline has to be able to override it. > > When using the first approach make sure that the user can still pick > readline, as readline has features linenoise (currently) hasn't, like > searching using Ctrl+r or configuration of the key combinations. agree, linenoise can't replace readline, so in general I think that we should only use it, if readline isn't available. > I'd > also like if readline can be built shared but still overwrite the > built-in default. > agree > > Doing the second approach has the benefit that the lib can be exported > to userland in the same run. While then there's little benefit as it all > still depends on an extension ... > > (Actually there would be a third possibility - writing a linenoise > extension which uses sapi/cli's hook but that requires duplicating most > of the shell code and makes things more complicated, let#s ignore > this ;-) ) > > What's your plan there? > > to tell you the truth I'm just throwing around ideas and waiting for somebody with better understanding the actual implementation to help me out. ;) --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --20cf3071cc701ec54a04c68d0598--