github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

facebook / phpsh

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 64
    • 5
  • Source
  • Commits
  • Network (5)
  • Issues (1)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

phpsh is a read-eval-print-loop for php that features readline history, tab completion, and quick access to documentation. It was developed at Facebook and ironically, is written mostly in python. It is open source and released under a modified BSD license. — Read more

  cancel

http://www.phpsh.org/

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

missed 'readline' dependency 
Daniel Corson (author)
Mon Feb 08 11:14:28 -0800 2010
commit  88da496a4e712e5f5a01198c09ff4147eeeba0a8
tree    687f909e6f9b9a8f5ca7a29e12b9cb252d064c2b
parent  289c109480575ab21902bc4d237c05e53e1ca7a3
phpsh /
name age
history
message
file LICENSE Mon Oct 13 13:02:15 -0700 2008 Initial commit for new public phpsh repo. This ... [Daniel Corson]
file README Tue Dec 01 13:58:12 -0800 2009 note in README that currently phpsh requires py... [dancor]
file rc.example.php Sun Sep 27 05:35:54 -0700 2009 rc comment punctuation [dancor]
file setup.py Mon Feb 08 11:14:28 -0800 2010 missed 'readline' dependency Summary: Roel Adr... [Daniel Corson]
directory src/ Mon Feb 08 11:01:40 -0800 2010 save 1000 lines of history instead of 100 Summ... [dancor]
directory test/ Sat Feb 21 03:32:04 -0800 2009 typo in last commit breaks extra includes; fix ... [dancor]
README
Mailing list at: http://groups.google.com/group/phpsh

To install:
(Note that the install currently clobbers any previous /etc/phpsh/rc.php)
~ python setup.py build
~ sudo python setup.py install
(Will download and install the pysqlite dependency for you if needed.)

The buildscript uses setuptools.  This comes with python >= 2.5.
If you are using python 2.4, go grab EasyInstall:
http://peak.telecommunity.com/DevCenter/EasyInstall#installing-easy-install
Currently, python 2.3 and earlier is not supported.  Let us know if
your setup requires that and we might try to support a lower common
denomenator..

To set up after install:
- If you just want to use vanilla php, just do ~ phpsh  and have fun.
- To connect to an actual codebase, e.g.:
  ~ cd ~/www
  ~ ctags -R            # for phpsh ctags integration, recommended
  ~ phpsh lib/init.php  # or some file(s) that load codebase libraries
- To get autoloading, modify /etc/phpsh/rc.php.  After that it's just:
  ~ cd ~/www
  ~ phpsh
  And for times when you just want vanilla php:
  ~ phpsh -c none
- For individual configuration, also see rc.example.php in the php
  distribution.


Note to ppl hacking on phpsh:
- For faster iteration, after installing once, you can run phpsh from src/
directly without reinstalling.  E.g.:
  ~ cd ~/www
  ~ ~/projects/phpsh/src/phpsh


Todo for after phpsh 1.2
- (A) Simple phpsh breakpoints that you can insert into your php code.
- (B) magic fatal undoing?
- Convert from /tmp file to named pipe for 'ready' message passing
  http://my.opera.com/zomg/blog/2007/08/29/php-and-named-pipes
- Maybe phpsh_check_syntax shouldn't actually be installed as a script, and
  just be a pkg_resource?  Didn't want to worry about zip file overhead, and
  installing didn't seem like a big deal.
- Similarly, php_manual.db should probably go in share/ not etc/ but similarly
  was worried about b.s. with setuptools..
- Paging for long php> d ..  results?  Or is terminal scroll fine..
- Thread loading ctags and starting php?  Would speed start but not restart.
- Command-line apc for faster php startup for large codebases.
- Note on php start error to start from codebase place?
- Make tab to show function signature work with multiline func sigs.

About (A: breakpoints):
jlindamood has suggested adding
a very basic debugging facility in which phpsh.php would define some
function called like phpsh_breakpoint() which you would be able to put
in your code that would cause the php> to re-happen at that breakpoint
so that you can investigate whatever state until you issue like a
phpsh_resume() (or whatever it would be called).

My suspicion is that that can be done pretty easily be having a new
message type from phpsh.php to phpsh.py.  (Currently there is only the
'ready' message when phpsh.php is ready to receive a new line of codes
from phpsh.py.)

About (B: fatal-undoing):
brent suggested adding
some kind of katamari-esque memory snapshotting, so that on fatals like
calling a nonexistent function (which are not catchable in php-land,
sadly) can be magically recovered from.  I think dweatherford or larry
would be good to ask about this kind of black magic.
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server