PHP code example of graze / dynamark3-client

1. Go to this page and download the library: Download graze/dynamark3-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

graze / dynamark3-client example snippets


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

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

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

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

/**
 * 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();

...
$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
 php
$client = Graze\Dynamark3Client\Dynamark3Client::factory();
...