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

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

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

denx-b/bitbucket-webhook

Composer 安装命令:

composer require denx-b/bitbucket-webhook

包简介

Simple webhook handling bitbucket

README 文档

README

The library makes it easy to handle bitbucket webhooks.

Example

use Dbogdanoff\Bitbucket;

// Repository events (Push, Fork, Updated, Commit, ...) 
$repo = new Bitbucket\Repo();
$push = $repo->getPush(); // array
$fork = $repo->getFork(); // array
$branch = $repo->getBranch(); // string
$changes = $repo->getChanges(); // array — 'changes' from root or 'changes' key from 'push'
$authorNickName = $repo->getAuthorNickName(); // string

// Issue events (Created, Updated, Comment created)
$issue = new Bitbucket\Issue();
$issue = $issue->getIssue(); // array

// Pull request events (Created, Updated, Change, ...)
$pullRequest = new Bitbucket\PullRequest();
$title = $pullRequest->getTitle(); // string
$link = $pullRequest->getLink(); // string
$data = $pullRequest->getPullRequest(); // array
$author = $pullRequest->getAuthor(); // array
$authorNickName = $pullRequest->getAuthorNickName(); // string
$commentText = $pullRequest->getCommentText(); // string
$commentInlinePath = $pullRequest->getCommentInlinePath(); // string
$commentInlineNumber = $pullRequest->getCommentInlineNumber(); // string

// All objects extended from Bitbucket\Base()
$actor = $repo->getActor(); // array
$nickname = $repo->getNickName(); // string
$repository = $repo->getRepository(); // array
$projectName = $repo->getProjectName(); // string
$eventType = $repo->getEventKey(); // string — repo:push, repo:updated, pullrequest:created, ...
$rawData = $repo->getRawData(); // array — full data

Exceptions

// Bitbucket\Repo::__construct()
if (strpos($_SERVER['HTTP_X_EVENT_KEY'], 'repo:') === false) {
    throw new Exception('Invalid request type');
}

// Bitbucket\Issue::__construct()
if (strpos($_SERVER['HTTP_X_EVENT_KEY'], 'issue:') === false) {
    throw new Exception('Invalid request type');
}

// Bitbucket\PullRequest::__construct()
if (strpos($_SERVER['HTTP_X_EVENT_KEY'], 'pullrequest:') === false) {
    throw new Exception('Invalid request type');
}

Requirements

Bitbucket - Webhook requires the following:

  • PHP 7.0.0+

Installation

Bitbucket - Webhook is installed via Composer. To add a dependency to bitbucket-webhook in your project, either

Run the following to use the latest stable version

    composer require denx-b/bitbucket-webhook

or if you want the latest master version

    composer require denx-b/bitbucket-webhook:dev-master

You can of course also manually edit your composer.json file

{
    "require": {
       "denx-b/bitbucket-webhook": "0.*"
    }
}

Documentation

Manage webhooks

https://support.atlassian.com/bitbucket-cloud/docs/manage-webhooks/

Events

https://support.atlassian.com/bitbucket-cloud/docs/event-payloads/

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-02-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固