dev-develop
dev-developParse the bitbucket API payload from a webhook.
MIT
The Requires
- php >=5.3
- jms/serializer ~0.0
The Development Requires
by Tristan Lins
webhook bitbucket
Wallogit.com
2017 © Pedro Peláez
Parse the bitbucket API payload from a webhook.


, (*1)
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)
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');
<?php require 'vendor/autoload.php'; $parser = new ContaoCommunityAlliance\BitbucketPayload\BitbucketPayloadParser(); $event = $parser->parsePhp();
namespace MyBundle\Controller;
class MyController
{
public function myAction(\Symfony\Component\HttpFoundation\Request $request)
{
$parser = new \ContaoCommunityAlliance\BitbucketPayload\BitbucketPayloadParser();
$event = $parser->parseRequest($request);
}
}
$payload = '...'; // The bitbucket payload, usually the POST body. $parser = new ContaoCommunityAlliance\BitbucketPayload\BitbucketPayloadParser(); $event = $parser->parse($payload);
Parse the bitbucket API payload from a webhook.
MIT
webhook bitbucket