Интересную утилитку показал Korchasa
PHPSH
Установка на моей машине прошла так:
git clone git://github.com/indeyets/phpsh.git
cd phpsh/
aptitude install python-setuptools
python setup.py build
aptitude install python-sqlite libsqlite3-dev
sudo python setup.py install
phpsh
Далее смотрим помощь в самом шелле:
max@max:~/src/phpsh$ phpsh
Starting php
type 'h' or 'help' to see instructions & features
php> h
-- Help --
Type php commands and they will be evaluted each time you hit enter. Ex:
php> $msg = "hello world"
Put = at the beginning of a line as syntactic sugar for return. Ex:
php> = 2 + 2
4
phpsh will print any returned value (in yellow) and also assign the last
returned value to the variable $_. Anything printed to stdout shows up blue,
and anything sent to stderr shows up red.
You can enter multiline input, such as a multiline if statement. phpsh will
accept further lines until you complete a full statement, or it will error if
your partial statement has no syntactic completion. You may also use ^C to
cancel a partial statement.
You can use tab to autocomplete function names, global variable names,
constants, classes, and interfaces. If you are using ctags, then you can hit
tab again after you've entered the name of a function, and it will show you
the signature for that function. phpsh also supports all the normal
readline features, like ctrl-e, ctrl-a, and history (up, down arrows).
Note that stdout and stderr from the underlying php process are line-buffered;
so php> for ($i = 0; $i < 3; $i++) {echo "."; sleep(1);}
will print the three dots all at once after three seconds.
(echo ".
" would print one a second.)
See phpsh -h for invocation options.
-- phpsh quick command list --
h Display this help text.
r Reload (e.g. after a code change). args to r append to add
includes, like: php> r ../lib/username.php
(use absolute paths or relative paths from where you start phpsh)
R Like 'r', but change includes instead of appending.
d Get documentation for a function or other identifier.
ex: php> d my_function
D Like 'd', but gives more extensive documentation for builtins.
v Open vim read-only where a function or other identifer is defined.
ex: php> v some_function
V Open vim (not read-only) and reload (r) upon return to phpsh.
e Open emacs where a function or other identifer is defined.
ex: php> e some_function
x [=]function([args]) Execute function() with args under debugger
c Append new includes without restarting; display includes.
C Change includes without restarting; display includes.
! Execute a shell command.
ex: php> ! pwd
q Quit (ctrl-D also quits)
php>
Похожие посты:
- twit.py CLI-twitter-client Today I'm trying to use Python again and write small...
- Полезности для Bash Выкладываю по просьбе товарища подключаемую часть своего .bashrc Содержит несколько...
- Подсчет коммитов Ради прикола решил посчитать кол-во коммитов каждого участника в некотором...
- Pyfig При занятиях разработкой на Python уже не хочется изобретать велосипеды...
- PHP Unix Man Pages уже давно документация PHP имеет возможность компилироваться в Unix Man...