Download the PHP package codestaq/phook without Composer
On this page you can find all versions of the php package codestaq/phook. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download codestaq/phook
More information about codestaq/phook
Files in codestaq/phook
Package phook
Short Description Helper class for creating PHP Git Hooks
License MIT
Homepage https://github.com/gmanricks/PHP-GIT-Hooks
Informations about the package phook
PHP-GIT-Hooks
A PHP Class for Helping you run custom functions in Git Hooks
Usage
You can install the package through composer using:
A created this class as verbose as possible, in terms of function names. So to run a simple function with a message before and after it you would type:
This will Download a picture of a Sassy Penguin to your PC.
There are more advanced commands like onTrigger
which will only run the command when a special trigger keyword is found in the current commit message.
You may also add another Message to display when the command fails by using the unlessFails
Command and all messages can be color coded using color names like so:
The withoutACommand
Function will just display the message without running any functions, it is worth noting that if you set a trigger, even though no function will be run, the message won't be displayed without the keyword.
The supported Colors are:
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- white
- clear (no Formatting)
- plain (reset to default Formatting)
For more Examples Consult the TestHook file.
Credits
This is a Project created by Gabriel Manricks. You can follow me on twitter at:
P.S.
Even though I wrote that this is a Git Hook Library, the only real Git related function is the triggers, so if you just need a Terminal printer with Color Support then this will work great (including the command part).