PHPackages                             bridgemate/dataconnector-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. bridgemate/dataconnector-client

ActiveLibrary

bridgemate/dataconnector-client
===============================

Scoring program client for the Bridgemate Data Connector over http. Communicate with Bridgemate Control Software (BCS 5) from a bridge scoring program written in PHP.

v1.1.0(3w ago)00LGPL-3.0-onlyPHPPHP &gt;=8.1CI passing

Since Jul 12Pushed 3w agoCompare

[ Source](https://github.com/BridgeSystems/Bridgemate-Data-Connector-Scoring-Program-Client-PHP)[ Packagist](https://packagist.org/packages/bridgemate/dataconnector-client)[ Docs](https://github.com/BridgeSystems/Bridgemate-Data-Connector-Scoring-Program-Client-PHP)[ RSS](/packages/bridgemate-dataconnector-client/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

Bridgemate Data Connector scoring program client for PHP
========================================================

[](#bridgemate-data-connector-scoring-program-client-for-php)

[![Packagist](https://camo.githubusercontent.com/85cea34d4cc7bddf4ec32207749ded29b5b03f626acffb872895729091599d07/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6272696467656d6174652f64617461636f6e6e6563746f722d636c69656e74)](https://packagist.org/packages/bridgemate/dataconnector-client)[![CI](https://github.com/BridgeSystems/Bridgemate-Data-Connector-Scoring-Program-Client-PHP/actions/workflows/ci.yml/badge.svg)](https://github.com/BridgeSystems/Bridgemate-Data-Connector-Scoring-Program-Client-PHP/actions/workflows/ci.yml)

PHP client for scoring programs to communicate with the **Bridgemate Data Connector** over http. Bridgemate Control Software (BCS 5) is needed to receive, process and return data from the Data Connector. This package is the PHP counterpart of the [.NET client](https://github.com/BridgeSystems/Bridgemate-Data-Connector-Scoring-Program-Client); its wire format is generated from the .NET source and verified against golden fixtures, so the two clients speak an identical protocol.

Requirements
------------

[](#requirements)

- PHP 8.1 or later with `ext-curl` and `ext-json`
- A reachable Bridgemate Data Connector (installed with BCS 5). When the scoring program runs on a different computer than BCS, enable listening on the local network in BCS and allow the port (default 5079) through the firewall on the BCS computer.

Installation
------------

[](#installation)

```
composer require bridgemate/dataconnector-client

```

Quick start
-----------

[](#quick-start)

```
use Bridgemate\DataConnector\DataConnectorClient;
use Bridgemate\DataConnector\Dto\DataConnectorResponseData;
use Bridgemate\DataConnector\Dto\InitDTO;

// Data Connector on the same computer (port discovered through the registry, default 5079):
$client = new DataConnectorClient('YourClubId', 'YourLicenceKey');

// Data Connector on another computer on the local network:
$client = new DataConnectorClient('YourClubId', 'YourLicenceKey', 'http://192.168.1.50:5079');

// Check the connection.
$response = $client->connect();

// Create an event in BCS (see the developer's guide for how to build the InitDTO).
$initDto = new InitDTO();
// ... fill sessions, scoring groups, sections, tables, rounds ...
$response = $client->initialize($initDto);

// Poll for new board results and accept them once processed.
$results = $client->pollForResults($sessionGuid);
foreach ($results as $result) {
    // store the result in your scoring program
}
if ($results !== []) {
    $client->acceptQueueData($sessionGuid, DataConnectorResponseData::Results);
}
```

All methods return a `ScoringProgramResponse` (poll methods return arrays of DTOs) and never throw on communication problems: inspect `DataType`/`ErrorType` on the response, exactly like with the .NET client.

### Polling model

[](#polling-model)

Http is stateless and the client keeps no connection open, so it fits both a long-running CLI worker (poll in a loop) and a web application (poll on demand during a request). The id of the last polled queue item per data type is cached on the client instance and used by `acceptQueueData()`; in a web application poll and accept within the same request, or track the queue item ids yourself via `getLastQueueItemId()`.

Getting started sample
----------------------

[](#getting-started-sample)

[examples/getting-started.php](examples/getting-started.php) is a small console application that exercises the whole workflow against a live Data Connector — use it as a template for your own scoring program:

```
composer install
php examples/getting-started.php               # interactive menu
php examples/getting-started.php --scenario    # unattended full flow

```

Mind that **"Initialize event" starts Bridgemate Control Software** and creates a small test event (1 section, 2 tables, 3 rounds, 8 players). The poll queues only carry data once BCS produces it: enter a result in BCS (or on a Bridgemate) and then poll for results here. The sample prints every request and response envelope (wire trace, toggleable), which is the fastest way to learn the protocol.

### Debugging in Visual Studio Code

[](#debugging-in-visual-studio-code)

Open this folder in VS Code and install the recommended extensions (Intelephense + PHP Debug, suggested automatically). With PHP and [Xdebug](https://xdebug.org/docs/install) installed, press F5 — launch configurations for the sample and for PHPUnit are provided in `.vscode/launch.json`. Set a breakpoint in `src/DataConnectorClient.php::sendRequest()` to watch every envelope being built and sent.

Documentation
-------------

[](#documentation)

The protocol, the procedures (initializing an event, updating movements, the queues) and all DTOs are described in the [Bridgemate Data Connector developer's guide](https://github.com/BridgeSystems/Bridgemate-Data-Connector-Scoring-Program-Client/blob/master/Documentation/MD/index.md). The DTO classes in `src/Dto` carry the same names and property names as the guide.

Validation
----------

[](#validation)

`Bridgemate\DataConnector\Validation\DtoValidator` ports the `Validate()` methods of the .NET client, one static method per DTO (`DtoValidator::validateInitDTO($dto)`, `validateResultDTO($dto)`, ...). Each method fills the DTO's `ValidationMessages` property and returns `true` when the DTO is valid. Validate before you send: client-side validation is advisory and lets you reject bad data with a precise message before it leaves your program, but the Data Connector service re-validates authoritatively and returns a response with `ErrorType``Validation` when it rejects a payload.

Note on explicit seatings: a `ParticipationDTO` may only carry a `RoundNumber` above one for a section that was created with `HasExplicitParticipations` set — for all other sections BCS calculates the seating for later rounds from the movement.

The validators are hand-written parity ports of the C# originals: their boolean results and message texts (including order) are asserted against generated golden fixtures in `tests/fixtures/validation`, produced by the .NET client itself.

Scope
-----

[](#scope)

This first release covers the core workflow: `connect`/`ping`, `initialize`, `continueEvent`, `updateMovement`, `updateScoringGroups`, the `send*` methods (results, player data, participations, handrecords, TD calls, Bridgemate 2/3 settings), the `pollFor*` methods and `acceptQueueData`. BCS management commands are not wrapped yet; `sendRequest()` is public for anything the client does not cover.

Compatibility
-------------

[](#compatibility)

Package versionData Connector / BCS1.xBCS 5.x (Data Connector with http support)Development
-----------

[](#development)

The `src/Dto` classes and `tests/fixtures` are **generated** from the .NET client repository (`tools/DtoGenerator` there) — do not edit them by hand. The fixture tests assert structural JSON equality with the exact bytes the .NET client produces.

```
composer install
composer test

```

Other platforms and support
---------------------------

[](#other-platforms-and-support)

The same client exists for [.NET](https://github.com/BridgeSystems/Bridgemate-Data-Connector-Scoring-Program-Client) (the reference implementation, including the scoring program emulator), [Java](https://github.com/BridgeSystems/Bridgemate-Data-Connector-Scoring-Program-Client-Java) and [Python](https://github.com/BridgeSystems/Bridgemate-Data-Connector-Scoring-Program-Client-Python). Questions are welcome in the [Discussions](https://github.com/BridgeSystems/Bridgemate-Data-Connector-Scoring-Program-Client/discussions)of the main repository; see [SUPPORT.md](SUPPORT.md).

License
-------

[](#license)

Copyright © Bridge Systems BV. This library is free software, licensed under the **GNU Lesser General Public License v3.0 only** (LGPL-3.0-only) — see [LICENSE](LICENSE) — like the [.NET reference client](https://github.com/BridgeSystems/Bridgemate-Data-Connector-Scoring-Program-Client).

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance94

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~22 days

Total

2

Last Release

27d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e88910a2850ff11e23a48c20b5ec2b4b84805bcacf04ef2a8e5c373f92dc2a4?d=identicon)[Steffens-Bridgemate](/maintainers/Steffens-Bridgemate)

---

Top Contributors

[![Steffens-Bridgemate](https://avatars.githubusercontent.com/u/41148062?v=4)](https://github.com/Steffens-Bridgemate "Steffens-Bridgemate (14 commits)")

---

Tags

Bridgescoringbcsbridgematedata-connector

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bridgemate-dataconnector-client/health.svg)

```
[![Health](https://phpackages.com/badges/bridgemate-dataconnector-client/health.svg)](https://phpackages.com/packages/bridgemate-dataconnector-client)
```

###  Alternatives

[graham-campbell/github

GitHub Is A GitHub Bridge For Laravel

6522.0M23](/packages/graham-campbell-github)[graham-campbell/gitlab

GitLab Is A GitLab Bridge For Laravel

144651.2k2](/packages/graham-campbell-gitlab)[cache/simple-cache-bridge

A PSR-6 bridge to PSR-16. This will make any PSR-6 cache compatible with SimpleCache.

433.4M30](/packages/cache-simple-cache-bridge)[cmsig/seal-symfony-bundle

An integration of CMS-IG SEAL search abstraction into Symfony Framework.

15362.1k16](/packages/cmsig-seal-symfony-bundle)[zoon/rialto

Manage Node resources from PHP

12284.3k3](/packages/zoon-rialto)[callmenp/lara-auth-bridge

Offers a simple API for the included custom phpBB authentication module. for phpBB3.0 and laravel5

161.1k](/packages/callmenp-lara-auth-bridge)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
