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

Are many other tools and composer plugins for manage git hooks. But GitHooks offers:

Further, it can be used together with javascript validation tools like typicode/husky if you have hybrid projects.

2. Requirements

3. Install

1. GitHooks must be installed like dev requirement with composer:

Note: for php < 8.1 you must add the next post-update-cmd event to the scripts section in your composer.json:

Then run composer update wtyd/githooks.

Until version 2.3.0 the method used was php72orMinorUpdate but it has been deprecated and will be removed from version 3.0.0

It is also convenient to add it to the post-install-cm event so that the rest of the project developers do not have problems with the build

2. Install all needed supported tools. How you install the tools doesn't matter.

3. Initialize GitHooks with githooks conf:init. This command creates the configuration file in the root path (githooks.yml).

4. Run githooks hook. It Copies the script for launch GitHooks on the pre-commit event in .git/hooks directory. You can, also run githooks hook otherHook MyScriptFile.php for set any hook with a custom script. See the wiki for more information.

To ensure that it is configured automatically, we can configure the command in the post-update-cmd and post-install-cmd events of the composer.json file (scripts section):

5. Set the configuration file.

4. Usage

When you commit, all the configured code check tools are automatically launched. If your code pass all checks, GitHooks allows you to commit. If not, you have to fix the code and try again:

Imagen todo OK

Imagen con KO

You can also run GitHooks whenever you want. All tools at same time or one by one:

Imagen de una herramienta

5. Supported Tools

At this moment, the supported tools are:

But you can set your own script on any git hook.

6. Set the Configuration File

The githooks.yml file is splitted on three parts:

6.1. Options

6.1.1. Execution

The execution flag marks how GitHooks will run:

6.1.2. Processes

Run multiple tools in multiple processes at same time (tool all command). The default number of processes is 1.

6.2. Tools

It is an array with the name of the tools that GitHooks will run. The name of the tools is their executable. If you want all the tools to be executed, the Tools key will be as follows:

The order in which the tools are is the order in which they will be executed.

6.3. Setting Tools

In next step you must configure the tools with the same name as in the Tools key. For example, for set phpcs:

All the available options are in the wiki.

7. Contributing

Contributions from others would be very much appreciated! Send pull request/issue. Check all steps for do that at Wiki section for Contributing. Thanks!

8. 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.1
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 ....