{"id":13668895,"url":"https://github.com/facebookarchive/phpsh","last_synced_at":"2025-09-28T22:31:32.236Z","repository":{"id":561894,"uuid":"192868","full_name":"facebookarchive/phpsh","owner":"facebookarchive","description":"A read-eval-print-loop for php","archived":true,"fork":false,"pushed_at":"2014-05-14T23:23:46.000Z","size":6498,"stargazers_count":1156,"open_issues_count":25,"forks_count":142,"subscribers_count":68,"default_branch":"master","last_synced_at":"2024-09-27T03:40:14.677Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.phpsh.org/","language":"Emacs Lisp","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/facebookarchive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-05-05T08:40:42.000Z","updated_at":"2024-08-15T18:49:08.000Z","dependencies_parsed_at":"2022-08-16T10:30:54.812Z","dependency_job_id":null,"html_url":"https://github.com/facebookarchive/phpsh","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookarchive%2Fphpsh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookarchive%2Fphpsh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookarchive%2Fphpsh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookarchive%2Fphpsh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/facebookarchive","download_url":"https://codeload.github.com/facebookarchive/phpsh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234569704,"owners_count":18854133,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T08:00:52.748Z","updated_at":"2025-09-28T22:31:25.859Z","avatar_url":"https://github.com/facebookarchive.png","language":"Emacs Lisp","funding_links":[],"categories":["Emacs Lisp","类库"],"sub_categories":["CLI"],"readme":"Archived Repo\n=============\nThis is an archived project and is no longer supported or updated by Facebook. Please do not file issues or pull-requests against this repo. If you wish to continue to develop this code yourself, we recommend you fork it.\n\nProceed and be bold!\n\nphpsh\n=====\nphpsh 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.\n\nMailing list at: [http://groups.google.com/group/phpsh]([http://groups.google.com/group/phpsh])\n\nPHP Dependencies\n===================\n__Version:__\n\n * PHP 5+\n\n__Modules:__\n\n * [pcntl](http://php.net/manual/en/book.pcntl.php) *recommended but not required.*\n * [pcre](http://php.net/manual/en/book.pcre.php)\n * [posix](http://php.net/manual/en/book.posix.php)\n * [tokenizer](http://php.net/manual/en/book.tokenizer.php)\n\nPython Dependencies\n===================\n\n\n* sqlite  \n  * Python \u003c  2.6: `sudo easy_install pysqlite`  \n  * Python \u003e= 2.6: pysqlite should already be installed, since it's part of the stdlib\n* readline  \n  * Mac OS X: `sudo easy_install readline`\n  * ActivePython: `pypm install readline`\n  * Most Linux distributions: readline should already be installed, since it's part of the stdlib\n\nInstalling Globally\n===================\n_Note that this install currently clobbers any previous /etc/phpsh/rc.php_  \n* `python setup.py build`  \n* `sudo python setup.py install`  \n* `phpsh`  \n\nInstalling Locally\n==================\n_Note that this install currently clobbers any previous ~/.phpsh/rc.php_  \n* `python setup.py install --prefix=~`  \n* `export PYTHONPATH=~/lib/python2.6/site-packages` (Adjust this if your python minor version differs from 2.6)  \n* `~/bin/phpsh`  \n\n_You will probably want to put the PYTHONPATH line in your .bashrc or such, and just add ~/bin to your PATH as well._\n\nThere are more details on installing from a setup.py at [http://docs.python.org/library/distutils.html](http://docs.python.org/library/distutils.html)\n\nAfter Install\n=============\n\nVanilla PHP\n-------------\n* Just run `phpsh` and have fun.\n\nConnecting to an Actual Codebase\n--------------------------------\n* `cd ~/www`  \n* `ctags -R` # for phpsh ctags integration, recommended  \n* `phpsh lib/init.php` # or some file(s) that load codebase libraries  \n\nAutoloading\n-----------\n* Modify /etc/phpsh/rc.php. Then:\n  * `cd ~/www`  \n  * `phpsh`  \n* And for times when you just want vanilla php:\n  * `phpsh -c none`\n\nIndividual Configuration\n------------------------\n* For individual configuration, also see rc.example.php in the php distribution.\n\nHacking on phpsh\n================\n* For faster iteration, after installing once, you can run phpsh from src/ directly without reinstalling.  \n  * `cd ~/www`  \n  * `~/projects/phpsh/src/phpsh`  \n\n\nTodo (after phpsh 1.2)\n======================\n* Simple phpsh breakpoints that you can insert into your php code.  \n    * jlindamood has suggested adding\n    a very basic debugging facility in which phpsh.php would define some\n    function called like phpsh_breakpoint() which you would be able to put\n    in your code that would cause the php\u003e to re-happen at that breakpoint\n    so that you can investigate whatever state until you issue like a\n    phpsh_resume() (or whatever it would be called).\n    \n    * My suspicion is that that can be done pretty easily be having a new\n    message type from phpsh.php to phpsh.py.  (Currently there is only the\n    'ready' message when phpsh.php is ready to receive a new line of codes\n    from phpsh.py.)\n    \n* Magic fatal undoing?  \n    * brent suggested adding\n    some kind of katamari-esque memory snapshotting, so that on fatals like\n    calling a nonexistent function (which are not catchable in php-land,\n    sadly) can be magically recovered from.  I think dweatherford or larry\n    would be good to ask about this kind of black magic.\n    \n* Convert from /tmp file to named pipe for 'ready' message passing [http://my.opera.com/zomg/blog/2007/08/29/php-and-named-pipes](http://my.opera.com/zomg/blog/2007/08/29/php-and-named-pipes)\n* Maybe phpsh_check_syntax shouldn't actually be installed as a script, and\n  just be a pkg_resource?  Didn't want to worry about zip file overhead, and\n  installing didn't seem like a big deal.\n* Similarly, php_manual.db should probably go in share/ not etc/ but similarly\n  was worried about b.s. with setuptools..\n* Paging for long php\u003e d ..  results?  Or is terminal scroll fine..\n* Thread loading ctags and starting php?  Would speed start but not restart.\n* Command-line apc for faster php startup for large codebases.\n* Note on php start error to start from codebase place?\n* Make tab to show function signature work with multiline func sigs.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebookarchive%2Fphpsh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffacebookarchive%2Fphpsh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebookarchive%2Fphpsh/lists"}