PHPackages                             jadb/monohook - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jadb/monohook

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jadb/monohook
=============

Fully configurable and extendable VCS hook manager

354PHP

Since Jan 13Pushed 11y ago1 watchersCompare

[ Source](https://github.com/jadb/monohook)[ Packagist](https://packagist.org/packages/jadb/monohook)[ RSS](/packages/jadb-monohook/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Monohook - Git hooks in PHP
===========================

[](#monohook---git-hooks-in-php)

A re-visited approach to [Git hooks](http://git-scm.com/book/en/Customizing-Git-Git-Hooks%E2%80%8E) - and probably other like Mercurial or Subversion?

Install
-------

[](#install)

Monohook can be installed using [Composer](http://getcomposer.org):

```
composer require --dev jadb/monohook:dev-master

```

Usage
-----

[](#usage)

Now that you have the package installed, you just need to create your hooks and symlink them to the `.monohook` config you create.

To create your `.monohook`, please refer to the one used for this repository.

Now, symlink the hooks you want managed by monohook:

```
$ ln -s ../../.monohook .git/hooks/pre-commit
$ ln -s ../../.monohook .git/hooks/post-commit
$ ln -s ../../.monohook .git/hooks/pre-rebase

```

What's included?
----------------

[](#whats-included)

### Processors

[](#processors)

- **CodeSnifferProcessor**: Detect violations of a defined set of coding standards in PHP and CSS.
- **LintProcessor**: Syntax check every new PHP file.
- **PHPUnitProcessor**: Test (when possible) every new PHP file.
- **RebaseProcessor**: Make sure that a rebase does not overwrite already pushed commits.
- *TODO* **ContentFilterProcessor**: Check any new code for filterable content (debug, wording, etc.).
- *TODO* **ImageOptimizerProcessor**: Reduce images' sizes.

### Providers

[](#providers)

- **GitProvider**
- *TODO* **MercurialProvider**
- *TODO* **SubversionProvider**

### Handlers

[](#handlers)

- **StdoutHandler**
- *TODO* **EmailHandler**
- *TODO* **StreamHandler**

Contributing
------------

[](#contributing)

- Fork
- Mod, fix, test
- *Optionally* write some documentation (currently in `README.md`)
- Send pull request

All contributed code must be licensed under the [BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause).

Bugs &amp; Feedback
-------------------

[](#bugs--feedback)

License
-------

[](#license)

Copyright (c) 2015, [Jad Bitar](http://jadb.io)

Licensed under the [BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause)Redistributions of files must retain the above copyright notice.

Acknowledgements
----------------

[](#acknowledgements)

Originally inspired by [AD7six/git-hooks](https://github.com/AD7six/git-hooks) and [Seldaek/monolog](https://github.com/Seldaek/monolog).

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ccb57ae849b67ade8d9c1e266bc2868183bbcf07fb6c66c2d45254a452272d54?d=identicon)[jadb](/maintainers/jadb)

---

Top Contributors

[![jadb](https://avatars.githubusercontent.com/u/33527?v=4)](https://github.com/jadb "jadb (2 commits)")

### Embed Badge

![Health badge](/badges/jadb-monohook/health.svg)

```
[![Health](https://phpackages.com/badges/jadb-monohook/health.svg)](https://phpackages.com/packages/jadb-monohook)
```

###  Alternatives

[enomotodev/php-cs-fixer-commit

Create commit of php-cs-fixer

18126.0k](/packages/enomotodev-php-cs-fixer-commit)[paulzi/yii2-materialized-path

Materialized Path Behavior for Yii2

2619.6k6](/packages/paulzi-yii2-materialized-path)[padam87/address-bundle

Symfony2 AddressBundle

1013.2k](/packages/padam87-address-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
