Unix manual pages for PHP functions
Did you know that unix manual pages for PHP functions and methods existed?
For a while I had vim configured to run reflection when I hit “K“, but after the PHP documentation team released unix manual pages for PHP I now get the manual page in all its glory; function description, parameter descriptions, return values, examples, notes, see also and everything you are used to see from the online manual.
Its awesome.
As many PHP functions use “standard names” the documentation team decided to not install the manual in the standard man directory.
When you install the unix manual package you get a little shell script (called “pman”) which runs the normal “man” command for you, and sets the manual directory to wherever you installed the package.
To install the PHP manual as unix manual pages:
$ pear install doc.php.net/pman
If you are running very old pear version you need to “discover” the doc.php.net channel first:
$ pear channel-discover doc.php.net
And then run the command above.
The manual will install into whichever directory you have specified as the “doc_dir” in the pear configuration, and the “pman” script into “bin_dir”.
By default I believe pear sets the “bin_dir” to something that is already in your $PATH so you should be able to execute “pman strpos” now.
In VIM you need to update the “keywordprg” config (or add it, if it doesn’t exists already) to “pman”:
set keywordprg=pman
Now open up a .php file, place your cursor over some PHP function and hit “K“, you should get the manual page for that function \o/.
Unfortunately Symfony, Zend Framework, Doctrine, and other frameworks/libraries/.. do not distribute unix manual pages yet so I use the Taglist plugin to jump to the code.
Looking forward to when these frameworks start producing unix manual pages, so much easier to read :D
-Hannes



Comments
No comments yet.
Leave a comment