Download the PHP package wtyd/githooks without Composer

On this page you can find all versions of the php package wtyd/githooks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package githooks

1. Wtyd/GitHooks

GitHooks is a standalone CLI tool (.phar) for managing git hooks and running QA tools in PHP projects. Built with Laravel Zero.

Why GitHooks?

2. Requirements

3. Install

1. Install GitHooks as a dev dependency:

Note: for PHP < 8.1 you must add the following events to the scripts section in your composer.json:

Then run composer update wtyd/githooks.

2. Initialize the configuration file:

In interactive mode, GitHooks detects QA tools in vendor/bin/ and generates a tailored githooks.php. You can also use --no-interaction to copy a template.

3. Install the git hooks:

This creates a .githooks/ directory with universal hook scripts and configures git config core.hooksPath .githooks. The .githooks/ directory should be committed to version control.

To automate hook installation, add it to your composer.json:

4. Usage

When you commit, all configured QA tools run automatically. If all checks pass, the commit proceeds. If not, you fix the code and try again.

All checks passed:

Some checks failed:

Running manually

5. Configuration

GitHooks uses a PHP configuration file (githooks.php) with three sections: hooks, flows, and jobs.

Key concepts

See the documentation site for the full configuration reference.

6. Supported Tools

Tool Type Description
PHP CodeSniffer phpcs / phpcbf Code style checking and auto-fixing
PHPStan phpstan Static analysis
Psalm psalm Static analysis
PHP Mess Detector phpmd Code quality rules
Parallel-lint parallel-lint Syntax checking
PHPUnit phpunit Unit testing
Paratest paratest Parallel PHPUnit driver
PHP CS Fixer php-cs-fixer Code style auto-fixing
Rector rector Automated code refactoring
PHP Copy Paste Detector phpcpd Duplicate code detection
Inline command script Run a single shell command (executable: 'composer audit'). No path filtering.
Any tool custom Run any binary with script (one-liner) or executable-path + paths (+ accelerable: true to opt into --fast / --fast-branch filtering)

Two ways to run non-PHP tools:

7. Commands

Command Description
githooks flow <name> Run a single flow.
githooks flows <name1> <name2>… Run multiple flows in a combined plan: ad-hoc list, declarative meta-flow, or mixed. Jobs deduped by first occurrence.
githooks job <name> Run a single job. Pass extra args to the underlying tool with --: githooks job phpunit -- --filter=MyTest.
githooks hook Install git hooks via core.hooksPath.
githooks hook:clean Remove installed hooks.
githooks status Show hook installation status.
githooks cache:clear [jobs…] Clear QA tool cache files. Accepts job names, flow names, or no argument (clear all).
githooks conf:init Generate configuration file (interactive or template).
githooks conf:check Validate configuration with deep checks (paths, executables, configs, deprecations, did-you-mean for typos).
githooks conf:migrate Migrate v2 config to v3 format.
githooks system:info Show CPU detection (cgroup-aware) and process configuration.

Common flags for flow / flows / job

Flag Purpose
--mode=full\|fast\|fast-branch\|fast-dirty / --fast / --fast-branch / --fast-dirty Select execution mode. fast filters to staged files, fast-branch to files changed vs base branch, fast-dirty to the unified working tree (dirty vs HEAD ∪ untracked).
--branch=X (flow only) Force branch name used to resolve flows.<X>.on => [branch_pattern => …]. Overrides CI env vars and git rev-parse HEAD. In flows/job, branch resolution falls back to $GITHOOKS_BRANCH / CI env / git.
--files=a,b,c / --files-from=PATH / --exclude-pattern=glob Run against an explicit list of files (CSV, manifest, or with exclusion patterns).
--processes=N, --fail-fast, --only-jobs=a,b, --exclude-jobs=a,b, --dry-run Control parallelism, fail-fast behaviour, and job selection.
--format=text\|json\|junit\|sarif\|codeclimate Output format on stdout. JSON v2 schema is stable.
--report-json=PATH, --report-junit=PATH, --report-sarif=PATH, --report-codeclimate=PATH Write structured reports to files (one or many at once). --no-reports skips the config-declared reports.
--output=PATH Write the --format=… payload to a file instead of stdout.
--show-progress Force progress to stderr even with a structured --format (CI dashboards).
--stats Print a 5-column table (Job / Status / Time / Peak Cores / Peak Memory) plus temporal attribution at the end of the flow. Also exposes stats block in JSON v2.
--warn-after=N, --fail-after=N, --no-time-budget Override flow time-budget thresholds (seconds).
--memory-warn-above=MB, --memory-fail-above=MB, --no-memory-budget, --allocator=fifo\|greedy Override memory-budget thresholds and 2D allocator strategy.

See the documentation site for the full command reference.

8. Documentation

Full documentation is available at wtyd.github.io/githooks, including:

9. Contributing

Contributions are welcome! Send a pull request or open an issue. See the Contributing guide.

10. License

The MIT License (MIT). Please see License File for more information.


All versions of githooks with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wtyd/githooks contains the following files

Loading the files please wait ...