Download the PHP package dintel/php-github-webhook without Composer

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

PHP GitHub webhook package

Overview

This package contains classes that allow keeping up to date git repository by performing git pull on every git push to your GitHub repository. To achieve this you have to add simple script to your git repository and configure webhook on your GitHub repository.

Webhook script

For a webhook script to work you have to do 3 things:

  1. Add this package to your composer dependencies
  2. Add a simple PHP script that will actually handle calls to webhook
  3. Configure your GitHub repository webhook to be called every time commits are pushed to GitHub

Composer

To add dependency, simply edit your composer.json and add to your require block following dependency - "dintel/php-github-webhook": "0.1.*". This is the simplest way to bring php-github-webhook libraries into your project.

Webhook script

To actually handle webhook calls, you have to add PHP script that will be accessible publicly and it will run git pull every time GitHub calls it. A simplest example of such webhook script:

In the script above <your secret> should be some random string you choose and it should be later supplied to GitHub when defining webhook. For more information about secrets and how they are used in GitHub webhook read Webhooks | GitHub API.

NOTE: Since this script has sensitive data in it (secret that is used to validate requests), it is advised to not put that script under git control by excluding it in .gitignore file. Another option is to take secret from some environment variable that would be defined by other means (like SetEnv in apache configuration).

GitHub repository configuration

To set up a repository webhook on GitHub, head over to the Settings page of your repository, and click on Webhooks & services. After that, click on Add webhook.

Fill in following values in form:

Click Add webhook button and that's it.

Classes

Handler

Handler class actually handles webhook calls. It first checks GitHub signature and then executes git pull if signature and secret match.

Here is a complete list of methods:


All versions of php-github-webhook with dependencies

PHP Build Version
Package Version
Requires php Version >=5.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 dintel/php-github-webhook contains the following files

Loading the files please wait ....