定制 roarbb/webhooker 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

roarbb/webhooker

Composer 安装命令:

composer require roarbb/webhooker

包简介

Github Webhook Helper

README 文档

README

#Installation

The recommended way to install Webhooker is through Composer.

# Install Composer
curl -sS https://getcomposer.org/installer | php

Next, run the Composer command to install the latest stable version of Webhooker:

composer require roarbb/webhooker

#Prerequisites

Make sure that you have rights to update files on server

chown -R www-data /path/to/website/root

#Webhook config

##Step 1 In website root, create webhook.php file

###basic

<?php

use Webhook\Hook;

include_once('vendor/autoload.php');

$hook = new Hook();
echo $hook->pull();

###If you want to secure your webhook with secret token (token in file)

webhook.php

<?php

use Webhook\Hook;

include_once('vendor/autoload.php');

$hook = new Hook();
$hook->setConfigFile(__DIR__ . '/config.neon');

if ($hook->isValidSignature()) {
    echo $hook->pull();
}

config.neon

github:
    secret: secretToken123

###If you want to secure your webhook with secret token (token as string)

webhook.php

<?php

use Webhook\Hook;

include_once('vendor/autoload.php');

$hook = new Hook();
$hook->setGithubSecret('secretToken123');

if ($hook->isValidSignature()) {
    echo $hook->pull();
}

##Step 2 Login to github, and set up your webhook. Link: https://github.com/[username]/[repository]/settings/hooks

add-webhook

Payload Url: Link to your webhook.php
Content Type: application/json
Secret: secretToken123
Which events would you like to trigger this webhook? - Just the push event.
Active: checked

It may looks like this: webhook-config

##Final Step On producion server:

  • Double-check permissions
  • Don't forget to run composer update

You can check your automatic updates in Webhooks/Manage Webhook -> Recent Deliveries webhook-payload

#Enjoy your new workflow!

统计信息

  • 总下载量: 11
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-01-09