Download the PHP package thecodingmachine/gitlab-hook-middleware without Composer

On this page you can find all versions of the php package thecodingmachine/gitlab-hook-middleware. 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 gitlab-hook-middleware

Latest Stable Version Total Downloads Latest Unstable Version License Build Status Coverage Status

Gitlab hook PSR-15 middleware

This package is a PSR-15 Middleware to receive events sent by a Gitlab webhook and send them to a listener.

It's possible to use directly the hookReceiver to build the event object, but you could check the Gitlab authentification.

How does it work

The middleware checks the header named X-GITLAB-TOKEN and builds an event object. The object is dispatched to a listener that you must implement.

The middleware takes care of unserializing the payload and provides you with nice PHP objects instead of raw JSON data. It's possible to get the initial array payload with the getPayload() function.

Your listener will receive all events. If you want to listen on a specific event type, you must check the object type.

Event List:

Scope Hook Header Object
Project Push Hook Push Hook TheCodingMachine\GitlabHook\Model\Push
Project Tag Push Hook Tag Push Hook TheCodingMachine\GitlabHook\Model\TagPush
Project Note Hook Note Hook Not implemented
Project Pipeline Hook Pipeline Hook TheCodingMachine\GitlabHook\Model\Pipeline
Project Build Hook Build Hook TheCodingMachine\GitlabHook\Model\Build
Group Project created System Hook TheCodingMachine\GitlabHook\Model\ProjectCreate
Group Project destroyed System Hook TheCodingMachine\GitlabHook\Model\ProjectDestroy
Group Project renamed System Hook TheCodingMachine\GitlabHook\Model\ProjectRename
Group Project transferred System Hook TheCodingMachine\GitlabHook\Model\ProjectTrasnfer
Group New Team Member System Hook TheCodingMachine\GitlabHook\Model\TeamMemberAdd
Group Team Member Removed System Hook TheCodingMachine\GitlabHook\Model\TeamMemberRemove
Group User created System Hook TheCodingMachine\GitlabHook\Model\UserCreate
Group User removed System Hook TheCodingMachine\GitlabHook\Model\UserDestroy
Group User failed login System Hook TheCodingMachine\GitlabHook\Model\UserFailedLogin
Group User renamed System Hook TheCodingMachine\GitlabHook\Model\UserRename
Group Key added System Hook TheCodingMachine\GitlabHook\Model\KeyCreate
Group Key removed System Hook TheCodingMachine\GitlabHook\Model\KeyDestroy
Group Group created System Hook TheCodingMachine\GitlabHook\Model\GroupCreate
Group Group removed System Hook TheCodingMachine\GitlabHook\Model\GroupDestroy
Group Group renamed System Hook TheCodingMachine\GitlabHook\Model\GroupRename
Group New Group Member System Hook TheCodingMachine\GitlabHook\Model\UserGroupAdd
Group Group Member Removed System Hook TheCodingMachine\GitlabHook\Model\UserGroupRemove
Group Push events System Hook TheCodingMachine\GitlabHook\Model\Push
Group Tag events System Hook TheCodingMachine\GitlabHook\Model\Tag
Group Merge request events System Hook TheCodingMachine\GitlabHook\Model\MergeRequest
Group Repository Update events System Hook TheCodingMachine\GitlabHook\Model\RepositoryUpdate

Example

Listener implementation

Use without middleware

Use a middleware


All versions of gitlab-hook-middleware with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
thecodingmachine/funky Version ^1
psr/http-server-middleware Version ^1
psr/http-server-handler Version ^1
psr/http-message Version ^1
psr/log Version ^1
psr/container Version ^1
zendframework/zend-diactoros Version ^1.8.5
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 thecodingmachine/gitlab-hook-middleware contains the following files

Loading the files please wait ....