2017 © Pedro Peláez
 

library bitbucket-payload

Parse the bitbucket API payload from a webhook.

image

contao-community-alliance/bitbucket-payload

Parse the bitbucket API payload from a webhook.

  • Tuesday, November 11, 2014
  • by cca
  • Repository
  • 0 Watchers
  • 0 Stars
  • 11 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Version ![Stable Build Status](http://img.shields.io/travis/contao-community-alliance/bitbucket-payload/master.svg?style=flat-square&label=stable build) ![Upstream Build Status](http://img.shields.io/travis/contao-community-alliance/bitbucket-payload/develop.svg?style=flat-square&label=dev build) License Downloads, (*1)

bitbucket webhook payload

This project contains a set of classes to validate, deserialize and serialize the bitbucket webhook payload. The parser use the jms/serializer internally, that means you can deserialize and serialize the payload as you like., (*2)

Requirements

Annotations are used to define the serialisation settings. Depending on your environment, you may need to register an annotation class loader. A very simple way is to register the class_exists function as loader, if you have a global autoloader available., (*3)

use Doctrine\Common\Annotations\AnnotationRegistry;
AnnotationRegistry::registerLoader('class_exists');

Usage examples

... in plain php

<?php
require 'vendor/autoload.php';

$parser = new ContaoCommunityAlliance\BitbucketPayload\BitbucketPayloadParser();

$event  = $parser->parsePhp();

... in symfony / http-foundation

namespace MyBundle\Controller;

class MyController
{
    public function myAction(\Symfony\Component\HttpFoundation\Request $request)
    {
        $parser = new \ContaoCommunityAlliance\BitbucketPayload\BitbucketPayloadParser();

        $event  = $parser->parseRequest($request);
    }
}

... in any other environment

$payload   = '...'; // The bitbucket payload, usually the POST body.

$parser = new ContaoCommunityAlliance\BitbucketPayload\BitbucketPayloadParser();

$event  = $parser->parse($payload);

The Versions

11/11 2014

dev-develop

dev-develop

Parse the bitbucket API payload from a webhook.

  Sources   Download

MIT

The Requires

 

The Development Requires

webhook bitbucket