Download the PHP package dtforce/slim-hook without Composer

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

Build Status Scrutinizer Code Quality Code Coverage

Gitlab webhook in PHP

This is a very simple webhook for gitlab, allowing to start bash scripts as a reaction to BUILD, PUSTH and TAG events.

Installation

Install with composer:

Or by cloning this repo.

Configuration

Create a file local.yaml in the config folder containing something like this:

Variables

When is your script being executed, there are few variables, given to the environment.

These are examples, it should be quite clear:

Deploy

Push

Tag

Launching

You can configure Apache in the usual way, or you can launch using PHP embedded server like this:

BashREST

For convenience this application can also serve simple REST requests. This can be handy, when you want a result of the script executed on the target platform when deploying in gitlab CI. By making request to this server in the following form:

POST to /groupName/projectName/action

you will launch a script described in the config like this:

If you sent some data (in the form of JSON) in the POST body, the script will receive them in its enviroment variables in a flattened form.

Example:

sent as POST to /bash-rest/test-app/my-action

Will result in these environment variables set:

If you set-up your secret in the config script, request to the BashREST server will need to authorize themselves with this secret. Secret is stored in header field X-Secret. Notice it is different to the one used by Gitlab Webhooks.

Example of a BashREST call

Suppose config:

and assume, shell_exec launches sh or bash, then call the action like this:

The response will be returned as application/text containing result(written to stdout) of the executed command:

The idea is to have something like RPC for bash over HTTP protocol.

That's all

Hope you like it!


All versions of slim-hook with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
slim/slim Version ^3.1
monolog/monolog Version ^1.17
zendframework/zend-config Version ^2.6
zendframework/zend-servicemanager Version ^2.6
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 dtforce/slim-hook contains the following files

Loading the files please wait ....