Download the PHP package projektgopher/whisky without Composer

On this page you can find all versions of the php package projektgopher/whisky. 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 whisky

Whisky Logo

Whisky Terminal Example

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status GitHub Static Analysis Action Status Total Downloads

Introduction

Whisky is the simplest, framework agnostic, CLI tool for managing and enforcing a php project's git hooks across an entire team.

Git hooks are a fantastic tool to ensure that code hitting version control satisfies your org's code quality standards. However, .git/hooks is not included in your git tree. This makes it impractical to have all contributors to a repository use the same checks with the same settings.

Installation

Whisky's only dependency is php^8.1.

You can install the package via composer:

This is the recommended method, as every developer on your project will have access to the tool.

Global Installation

Whisky can be installed globally, however this means that any developer on your project will also need it installed globally if they want to use it.

If Whisky is installed both globally, and locally, on a project the version that's run will depend on how the command is invoked.

Usage

The install command will create a whisky.json file in your project root:

For a complete list of supported git hooks, see the Git Documentation.

[!CAUTION] all hooks are evaluated as-is in the terminal. Keep this in mind when committing anything involving changes to your whisky.json.

Adding or removing any hooks (not individual commands) to your whisky.json file should be followed by ./vendor/bin/whisky update to ensure that these changes are reflected in your .git/hooks directory.

Working With Hook Arguments

Some hooks in git are passed arguments.

The commit-msg hook is a perfect example. It's passed the path to git's temporary file containing the commit message, which can then be used by scripts like npm's commitlint to allow or prevent commit messages that might not conform to your project's standards.

To use this argument that git passes, you can optionally include $1 in your array of commands. (You should wrap it in escaped double quotes to prevent odd behavior due to whitespace)

[!IMPORTANT]
For commitlint specifically, you'll need to follow the instructions in their documentation, as it will require extra packages and setup to run in your project.

Automating Hook Updates

While we suggest leaving Whisky as an 'opt-in' tool, by adding a couple of Composer scripts we can ensure consistent git hooks for all project contributors. This will force everyone on the project to use Whisky:

Skipping Hooks

Sometimes you need to commit or push changes without running your git hooks, like when handing off work to another computer. This can usually be done using git's native --no-verify flag.

However, some git actions don't support this flag, like git merge --continue. In this case, running the following command will have the exact same effect.

[!TIP] by adding alias whisky=./vendor/bin/whisky to your bash.rc file, you can shorten the length of this command.

Disabling Hooks

Adding a hook's name to the disabled array in your whisky.json will disable the hook from running. This can be useful when building out a workflow that isn't ready for the rest of the team yet.

Advanced Usage

For anything more complicated than simple terminal commands it's recommended to create a scripts directory in your project root. This comes with the added benefit of allowing you to run scripts written in any language.

[!NOTE] When doing this, make sure any scripts referenced are executable:

Testing

Troubleshooting

If you've installed Whisky both locally and globally, and your hooks are being run twice, try uninstalling whisky from your hooks for one of those installations.

Contributing

[!NOTE] Don't build the binary when contributing. The binary will be built when a release is tagged.

Please see CONTRIBUTING for more details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

A big "Thank You" to EXACTsports for supporting the development of this package.

License

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


All versions of whisky with dependencies

PHP Build Version
Package Version
Requires php Version ^8.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 projektgopher/whisky contains the following files

Loading the files please wait ....