Command line utilitary for the PHP manual
This is a simple script that helps you see quick information about PHP functions directly from command line.
It returns:
- The function's availability
- The function's description
- The function's definition
- The function's parameters
- The function's return value
$ ./pman function_name
- Download the PHP documentation "many files" (https://www.php.net/distributions/manual/php_manual_en.tar.gz)
- Unzip everything to some folder (e.g.
/opt/pman/
) - Change the path in
$manual_path
at line 4 to the path where you unzipped the files - Make pman executable with
chmod +x pman
Tip: use # mv pman /bin
to call it from anywhere
This is by far not the best code I could to, and I've made some quick fixes. I know the code isn't beaultiful.
I haven't tested with a lot of functions and the PHP manual has some inconsistences, so it's possible that there is some bug.
Oh, and since I made this to work with functions only, I deleted every html file that doesn't start with "function." on the folder at step 2