Omnimaga
General Discussion => Technology and Development => Computer Projects and Ideas => Topic started by: Juju on April 05, 2012, 03:21:51 pm
-
I wrote this thing in my free time. There was already a phpsh written in python made by Facebook, but this one is written in PHP. Features basic auto-completion!
Download link (http://files.julosoft.net/phpsh.phps).
-
Is that the one you use on julosoft.net? I like it, though Backspace doesn't work :/
-
No, it's a completely different one and it runs in command line, not in a browser.
-
By auto completion do you mean how Facebook automatically suggest friend names when you start typing them? Maybe a demo showcasing how it works (for visual people) is in order?
Also at first I was scared because I misread the title as PWSPHP, and thought a member decided to start making a site using that very outdated and insecure portal. :P
-
Well, how this works, you type a line of PHP code in a prompt and it executes it and when you press tab it complete the function or variable name you were typing, much like Facebook with friend names or bash, the Linux shell. Actually it's exactly like bash. But with PHP.
-
Hmm I see, so it's a bit more like how in some softwares when you type code, it auto completes the command?
-
Pretty much, yeah.
-
Oh, I see, it's a terminal for PHP commands :D
I'll try that later.
-
Heh, I struggled to get this to work until I realized that your link prints the source of that program, NOT actually let you download it... :P
Anyway, went and compiled PHP 5.4.0 to get readline support (apparently Ubuntu/Debian disables it by default.. :P), which also happens to have some improvements to its own shell (php -a).
(See blog post from its dev: http://schlueters.de/blog/archives/133-Now-in-trunk-Improved-interactive-shell.html)
I've set up an online terminal for you guys to play with:
http://withg.us.to:4200/phpsh/ (Juju's PHP Shell)
http://withg.us.to:4200/phpsh_native/ (PHP's native shell)
As always, do no evil, do no evil, and do no evil :P
-
Heh, I struggled to get this to work until I realized that your link prints the source of that program, NOT actually let you download it... :P
I think I accidentally the same thing, downloading the HTML page and attempting to run it as a PHP file :P
-
I tried "echo hey", and it didn't add a newline. On bash, I'm pretty sure echo adds a newline, doesn't the same happen on PHP?
Good work Juju!
-
I tried "echo hey", and it didn't add a newline. On bash, I'm pretty sure echo adds a newline, doesn't the same happen on PHP?
Good work Juju!
PHP does not add newlines for echo. You must do echo "hey\n" instead.