承接 smalot/bitbucket-webhook 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

smalot/bitbucket-webhook

最新稳定版本:v0.2

Composer 安装命令:

composer require smalot/bitbucket-webhook

包简介

Bitbucket API to handle webhook callbacks.

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License Scrutinizer Code Quality

Requirements

  • PHP 5.3+
  • symfony/http-foundation >= 2.3
  • symfony/event-dispatcher >= 2.3

Installation

Composer

You need first to download this library using composer.

composer require smalot/bitbucket-webhook

Go to GetComposer.org to install Composer on your environment.

Example

From scratch

<?php

require_once 'vendor/autoload.php';

$request = \Symfony\Component\HttpFoundation\Request::createFromGlobals();
$dispatcher = new \Symfony\Component\EventDispatcher\EventDispatcher();

// Todo: add listener to event dispatcher.
$listener = ...

$dispatcher->addListener(\Smalot\Bitbucket\Webhook\Events::WEBHOOK_REQUEST, $listener);
$webhook = new \Smalot\Bitbucket\Webhook\Webhook($dispatcher);
$event = $webhook->parseRequest($request);

Using Symfony in controller

<?php

namespace AppBundle\Controller;

use Smalot\Bitbucket\Webhook\Webhook;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class BitbucketController extends Controller
{
    public function webhookAction(Request $request)
    {
        $dispatcher = $this->get('event_dispatcher');
        $webhook = new Webhook($dispatcher);
        $event = $webhook->parseRequest($request);
        
        return Response('ok');
    }
}

Don't forget to previously to register any event listener.

Documentation

Remote API

https://confluence.atlassian.com/bitbucket/manage-webhooks-735643732.html

Security

Bitbucket whitelist IP ranges:

https://confluence.atlassian.com/bitbucket/manage-webhooks-735643732.html#Managewebhooks-trigger_webhook

131.103.20.160/27
165.254.145.0/26
104.192.143.0/24
````

## Events

https://confluence.atlassian.com/bitbucket/event-payloads-740262817.html

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-01-17