2017 © Pedro Peláez
 

library dynamark3-client

A Dynamark Communication Protocol 3 client, written in PHP

image

graze/dynamark3-client

A Dynamark Communication Protocol 3 client, written in PHP

  • Tuesday, July 10, 2018
  • by graze
  • Repository
  • 9 Watchers
  • 1 Stars
  • 7,361 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 7 % Grown

The README.md

dynamark3-client

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads, (*1)

A Dynamark Communication Protocol 3 client, written in PHP, (*2)

Install

Via Composer, (*3)

``` bash composer require graze/dynamark3-client, (*4)


## Usage ### Instantiating a client Use the `factory` method to return a `Dynamark3ClientInterface` instance: ``` php $client = Graze\Dynamark3Client\Dynamark3Client::factory(); ...

Issuing commands

Connect to a remote endpoint using connect:, (*5)

...
$dsn = '127.0.0.1:20000';
$client->connect($dsn);
...

Commands are then simply method names that can be called directly on the client:, (*6)

...
// issue a GETXML command
$resp = $client->getxml();
...

Commands containing spaces are represented using camelCase:, (*7)

...
// issue a MARK STOP command
$resp = $client->markStop();
...

Command arguments are passed as method paramaters:, (*8)

...
// issue a DELETEFILE command
$path = '\hard disk\domino\filecoding\codes.txt';
$resp = $client->deletefile($path);
...

Responses

The client will respond with a Dynamark3ResponseInterface object with the following methods:, (*9)

/**
 * Any response from the server up until a prompt is encountered.
 *
 * @return string
 */
public function getResponseText();

/**
 * Whether an error prompt was encountered.
 *
 * @return bool
 */
public function isError();

/**
 * The error code returned from the Dynamark 3 server
 *
 * @return int
 */
public function getErrorCode();

Handling a response:, (*10)

...
$resp = $client->getxml();
if ($resp->isError()) {
    echo sprintf('the server responded with error code: [%d]', $resp->getErrorCode());
    // look up the error code in the Dynamark 3 protocol docs
    return;
}

$xml = $resp->getResponseText();
// do something fun with the xml

Example success response:, (*11)

Screenshot of terminal text showing a success response, (*12)

Example error response:, (*13)

Screenshot of terminal text showing an error response, (*14)

Some commands will return interesting data in their response, e.g. getxml:, (*15)

Screenshot of terminal text showing XML response, (*16)

Change log

Please see CHANGELOG for more information what has changed recently., (*17)

Testing

bash make test, (*18)

Contributing

Please see CONTRIBUTING for details., (*19)

Security

If you discover any security related issues, please email security@graze.com instead of using the issue tracker., (*20)

Credits

License

The MIT License (MIT). Please see License File for more information., (*21)

The Versions

10/07 2018

dev-master

9999999-dev

A Dynamark Communication Protocol 3 client, written in PHP

  Sources   Download

The Requires

 

The Development Requires

23/04 2018

dev-dockerise

dev-dockerise

A Dynamark Communication Protocol 3 client, written in PHP

  Sources   Download

The Requires

 

The Development Requires

02/03 2016

v2.0.0

2.0.0.0

A Dynamark Communication Protocol 3 client, written in PHP

  Sources   Download

The Requires

 

The Development Requires

18/02 2016

v1.0.0

1.0.0.0

A Dynamark Communication Protocol 3 client, written in PHP

  Sources   Download

The Requires

 

The Development Requires