Download the PHP package bridgemate/dataconnector-client without Composer

On this page you can find all versions of the php package bridgemate/dataconnector-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package dataconnector-client

Bridgemate Data Connector scoring program client for PHP

Packagist CI

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; its wire format is generated from the .NET source and verified against golden fixtures, so the two clients speak an identical protocol.

Requirements

Installation

Quick start

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

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

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:

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

Open this folder in VS Code and install the recommended extensions (Intelephense + PHP Debug, suggested automatically). With PHP and Xdebug 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

The protocol, the procedures (initializing an event, updating movements, the queues) and all DTOs are described in the Bridgemate Data Connector developer's guide. The DTO classes in src/Dto carry the same names and property names as the guide.

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

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

Package version Data Connector / BCS
1.x BCS 5.x (Data Connector with http support)

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.

Other platforms and support

The same client exists for .NET (the reference implementation, including the scoring program emulator), Java and Python. Questions are welcome in the Discussions of the main repository; see SUPPORT.md.

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 — like the .NET reference client.


All versions of dataconnector-client with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-curl Version *
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bridgemate/dataconnector-client contains the following files

Loading the files please wait ...