Download the PHP package bruli/php-git-hooks without Composer
On this page you can find all versions of the php package bruli/php-git-hooks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package php-git-hooks
php-git-hooks
Git hooks for PHP projects.
Library based in git hook scripts for PHP projects.
Installation
Step 1: Composer
You must add the following line to the composer.json
file to use with Symfony 3.0:
You can use "~2.0" for Symfony version 2.X.
Or you can write in your console:
If you don't have composer, you need download the binary file and run it:
Step 2: Configuration
Using Composer
First, you will need to add the following lines to your composer.json
WARNING: "PhpGitHooks\Application\Composer\ConfiguratorScript::buildConfig" is deprecated. You need change by current entry.
Then, launch $ composer install
and composer should ask you about configuration
Bin directory configuration.
If your project doesn't have a "bin/" directory, you can add this in your composer.json
file.
Note: This is not necessary for Symfony projects.
Manual config file for git hooks.
You can configure php-git-hooks, creating a php-git-hooks.yml file with...
... or you can copy php-git-hooks.yml.sample from vendor/bruli/php-git-hooks.
Config file for phpunit.
If you want use phpunit tool, you must create a phpunit.xml.dist in your project root directory. Alternatively you can copy from vendor/bruli/php-git-hooks/phpunit.xml.dist in your project root directory.
Config file for phpmd.
The same case that phpunit. You must create a PmdRules.xml in your project root directory or copy from php-git-hook directory.
Step 3: Enabling hooks.
The most easy way to enable hook is copy hook file into your .git/hooks directory.
For pre-commit hook:
You can enable this hooks with composer or manually executing
For commit-msg hook:
For pre-push hook:
execute.
Valid pre-commit.
Fail pre-commit.
Credits
- Pablo Braulio (@brulics)
- All contributors
License
php-git-hooks is released under the MIT License. See the bundled LICENSE file for details.
All versions of php-git-hooks with dependencies
friendsofphp/php-cs-fixer Version ^2.1
phpunit/phpunit Version ~6.0|~7.0|~8
squizlabs/php_codesniffer Version ~3.0
phpmd/phpmd Version ~2.6
symfony/dependency-injection Version ~4.0
symfony/config Version ~4.0
symfony/yaml Version ~4.0
fiunchinho/phpunit-randomizer Version ~3.0|~4.0
seld/jsonlint Version ~1.5
bruli/ignore-files Version ~1.0
beberlei/assert Version ~2.7
bruli/php-value-objects Version ~0.1
bruli/event-bus-bundle Version ^0.5
symfony/flex Version ~1.0