Morning Nikita,

+1 on the change to cli.

It can't really be a default extension right now because readline license
is not compatible:

https://github.com/php/php-src/pull/3823

Even without the license problem, I'm not convinced of the value of adding
the dependency: Because of this long standing strange behaviour, I don't
really think the interactive shell is well used.

Cheers
Joe

On Wed, 12 May 2021 at 10:48, Nikita Popov <nikita....@gmail.com> wrote:

> On Wed, May 12, 2021 at 10:37 AM Moritz Friedrich <m...@9dev.de> wrote:
>
> >
> > > Am 12.05.2021 um 10:12 schrieb Nikita Popov <nikita....@gmail.com>:
> > >
> > > Hi internals,
> > >
> > > If the readline extension is enabled, PHP provides an interactive shell
> > > under -a. If it is not enabled, it falls back to an "interactive mode"
> > > (yes, the difference between "interactive shell" and "interactive mode"
> > is
> > > important here). The interactive mode is simply an stdin input, which
> > needs
> > > to be terminated using Ctrl+D. You can only run one script that way.
> > >
> > > I think the current behavior is quite confusing, because it's really
> not
> > > obvious that you ended up in this fallback mode (you need to know the
> > > difference between "shell" and "mode" in the output) and most people
> > > wouldn't know what to do with it. The latest instance of this is
> > > https://bugs.php.net/bug.php?id=81033.
> > >
> > > I think we would be better off disabling -a completely if readline is
> not
> > > available, and exit with a helpful error message. I've opened
> > > https://github.com/php/php-src/pull/6976 to that effect. Does that
> sound
> > > reasonable?
> > >
> > > Regards,
> > > Nikita
> >
> > Hi Nikita,
> > if I may ask, would it also be possible to have deadline as a mandatory
> > dependency to always have the interactive shell available? Is there a
> good
> > reason to compile PHP without? Having a basic prompt available is really
> > handy at times — especially looking at Node.js with their
> ahead-completion
> > and general UX.
> > The same has been done for other PHP modules in the past, so I wonder if
> > we could simply have readline as a guarantee.
>
>
> The readline extension has an external dependency on readline / libedit.
> Making it a required extension would also make this a required dependency.
> We avoid having dependencies for the minimal build. The only dependency we
> currently have is libpcre, and we vendor that one. I doubt we'll want to
> add a new vendored dependency, as they tend to be a major pain.
>
> I personally do not use the interactive shell (and I think most people who
> do use *an* interactive shell prefer psysh), so I don't think this can be
> reasonably considered a "required" feature.
>
> Regards,
> Nikita
>

Reply via email to