Re: [PHP-DEV] php interactive shell: save history on SIGINT exit

2014-07-24 Thread Johannes Schlüter
On Wed, 2014-07-23 at 17:08 +0400, Dmitry Saprykin wrote: > Yes, you are right. append_history is not suitable for libedit. I left > write_history call for libedit. Committed and pushed in a slightly modified form (variable declarations should be on top of a block) http://git.php.net/?p=php-src.gi

Re: [PHP-DEV] php interactive shell: save history on SIGINT exit

2014-07-23 Thread Dmitry Saprykin
Yes, you are right. append_history is not suitable for libedit. I left write_history call for libedit. On 23 July 2014 16:38, Johannes Schlüter wrote: > On Mon, 2014-07-21 at 18:17 +0400, Dmitry Saprykin wrote: > > changed "write_history" at the end to "append_history" after > > each cli_is_val

Re: [PHP-DEV] php interactive shell: save history on SIGINT exit

2014-07-23 Thread Tjerk Meesters
On 23 Jul, 2014, at 8:38 pm, Johannes Schlüter wrote: > On Mon, 2014-07-21 at 18:17 +0400, Dmitry Saprykin wrote: >> changed "write_history" at the end to "append_history" after >> each cli_is_valid_code. >> Now it is -1 line, +1 line commit and completely looks like bug fix. ) > > Have you tes

Re: [PHP-DEV] php interactive shell: save history on SIGINT exit

2014-07-23 Thread Johannes Schlüter
On Mon, 2014-07-21 at 18:17 +0400, Dmitry Saprykin wrote: > changed "write_history" at the end to "append_history" after > each cli_is_valid_code. > Now it is -1 line, +1 line commit and completely looks like bug fix. ) Have you tested with libedit? - A quick grep on my system shows no append_hist

Re: [PHP-DEV] php interactive shell: save history on SIGINT exit

2014-07-21 Thread Dmitry Saprykin
changed "write_history" at the end to "append_history" after each cli_is_valid_code. Now it is -1 line, +1 line commit and completely looks like bug fix. ) On 21 July 2014 18:00, Johannes Schlüter wrote: > On Mon, 2014-07-21 at 13:12 +0400, Dmitry Saprykin wrote: > > Php interactive shell saves

Re: [PHP-DEV] php interactive shell: save history on SIGINT exit

2014-07-21 Thread Johannes Schlüter
On Mon, 2014-07-21 at 13:12 +0400, Dmitry Saprykin wrote: > Php interactive shell saves commands history when you exit it using 'quit'. > But it throws all you history away when you exit using Ctrl+C. It is common > practice to save history on SIGINT exit (mysql, mongo, etc.) > > I would like to i

Re: [PHP-DEV] php interactive shell: save history on SIGINT exit

2014-07-21 Thread Dmitry Saprykin
Thank you for clarification. I'm agree with all points. But I think in this particular case (1 file, <20 lines of code) simple review could be enough. I'm new in php development and may be I am missing some workflow steps. If RFC is absolutely necessary I will be happy to create it but I have no en

Re: [PHP-DEV] php interactive shell: save history on SIGINT exit

2014-07-21 Thread Bob Weinand
Am 21.7.2014 um 12:52 schrieb Pierre Joye : > On Mon, Jul 21, 2014 at 11:50 AM, Dmitry Saprykin > wrote: >> Ok, I will NOT )) >> God saves us from bureaucracy > > Well, Michael's view is known. > > However let me explain what RFCs bring, besides bureaucracy. > > - clear identification of use ca

Re: [PHP-DEV] php interactive shell: save history on SIGINT exit

2014-07-21 Thread Pierre Joye
On Mon, Jul 21, 2014 at 11:50 AM, Dmitry Saprykin wrote: > Ok, I will NOT )) > God saves us from bureaucracy Well, Michael's view is known. However let me explain what RFCs bring, besides bureaucracy. - clear identification of use cases, incl. edge cases - better design and design reviews - doc

Re: [PHP-DEV] php interactive shell: save history on SIGINT exit

2014-07-21 Thread Dmitry Saprykin
Ok, I will NOT )) God saves us from bureaucracy On 21 July 2014 13:46, Michael Wallner wrote: > > On 21 Jul 2014 11:24, "Yasuo Ohgaki" wrote: > > > > Hi all, > > > > On Mon, Jul 21, 2014 at 6:12 PM, Dmitry Saprykin < > saprykin.dmi...@gmail.com> > > wrote: > > > > > Php interactive shell save

Re: [PHP-DEV] php interactive shell: save history on SIGINT exit

2014-07-21 Thread Michael Wallner
On 21 Jul 2014 11:24, "Yasuo Ohgaki" wrote: > > Hi all, > > On Mon, Jul 21, 2014 at 6:12 PM, Dmitry Saprykin < saprykin.dmi...@gmail.com> > wrote: > > > Php interactive shell saves commands history when you exit it using 'quit'. > > But it throws all you history away when you exit using Ctrl+C. It

Re: [PHP-DEV] php interactive shell: save history on SIGINT exit

2014-07-21 Thread Yasuo Ohgaki
Hi all, On Mon, Jul 21, 2014 at 6:12 PM, Dmitry Saprykin wrote: > Php interactive shell saves commands history when you exit it using 'quit'. > But it throws all you history away when you exit using Ctrl+C. It is common > practice to save history on SIGINT exit (mysql, mongo, etc.) > > I would l

[PHP-DEV] php interactive shell: save history on SIGINT exit

2014-07-21 Thread Dmitry Saprykin
Php interactive shell saves commands history when you exit it using 'quit'. But it throws all you history away when you exit using Ctrl+C. It is common practice to save history on SIGINT exit (mysql, mongo, etc.) I would like to implement SIGINT handler for interactive shell to save history on Ctr