Download the PHP package netodomenico/php-discord-git-notifications without Composer

On this page you can find all versions of the php package netodomenico/php-discord-git-notifications. 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?
netodomenico/php-discord-git-notifications
Rate from 1 - 5
Rated 5.00 based on 1 reviews

Informations about the package php-discord-git-notifications

PHP Discord GIT Notifications

Currently compatible with Github, BitBucket and Gitlab

Send a Discord message on every push, pull request created or approved on your Git repository.

Features

Installation

PHP Discord GIT Notifications requires PHP 7.1+ to run. Install the package and initialize your repository entries.

Configuration

PHP Discord GIT Notifications has a few simple configurations. Instructions on how to use them in your own application are explained below.

Configuration Type Explanation Mandatory
bot_message String The message Discord will show over the git activity summary. No
bot_username String The username of the bot sending Discord message. No
bot_avatar String The avatar of the bot sending Discord message. No
bot_color String The left bar color of messages sent on Discord (HEX, 6 chars, with no # symbol. Example: E62B5A). No
secure_token String String used as matching constraint for security reasons (only on Gitlab) No

Initialization

Define your route (be sure using POST method), pair your controller and then import PHP Discord GIT Notifications class at the top of your file.

Once the class is imported, you can initialize the object:

After that you can proceed declaring your webhooks:

If you want to declare a specific configuration value (as referenced in configuration section), do in this way:

After that you can proceed parsing request and then sending message to the Discord matching webhook:

How to create and/or retrieve your Github Webhook UUID

  1. Login into your Github account.
  2. Search and enter in your Repository.
  3. Click on Settings and then on Webhooks in the left sidebar.
  4. Create your webhook if you haven't already did by entering the complete url of this route and making sure that Content type is set to application/json and choose Let me select individual events if interested (only Pushes and Pull requests will be considered).
  5. After that, click on edit and retrieve the Github webhook uuid from the url path.

How to create and/or retrieve your Bitbucket Webhook UUID

  1. Login into your Bitbucket account.
  2. Search and enter in your Repository.
  3. Click on Repository settings and then on Webhooks under Workflow subcategory.
  4. Create your webhook if you haven't already did by entering the complete url of this route and making sure that Push (under repository), Created (under pull request) and Approved (under pull request) checkboxes are enabled.
  5. After that, click on edit or view requests (if your are not on those sections yet) call to actions and retrieve the bitbucket webhook uuid from the url path (make sure to not copy braces characters %7B and %7D which can limit uuid string).

How to create and/or retrieve your Gitlab Project ID

  1. Login into your Gitlab account.
  2. Search and enter in your Project.
  3. Click on Settings and then on Webhooks.
  4. Create your webhook if you haven't already did by entering the complete url of this route and making sure that Push events checkbox is enabled.
  5. After that, click on General on the left sidebar and retrieve the Project ID from the disabled input field.

How to create and/or retrieve your Discord channel Webhook URL

  1. Make sure you have enough permissions to perform the task.
  2. Identify your desired channel and move over that.
  3. Click on the gear (Edit channel) and then on Integrations.
  4. After that your can click on the "Create webhook" call to action, enter the required parameters and then copy the Webhook URL.

License

Apache License 2.0

There's no place like 127.0.0.1!


All versions of php-discord-git-notifications 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 netodomenico/php-discord-git-notifications contains the following files

Loading the files please wait ....