Skip to content

Support: Method to test connection to LRS #46

@cvanderlinden

Description

@cvanderlinden

I am looking for a simple way to test the connection to the LRS

  1. Create the XApiClientBuilder
  2. Create the xApiClient
  3. Create the statementsApiClient
  4. getStatements
use Xabbuh\XApi\Client\XApiClientBuilder;
use Http\Adapter\Guzzle7\Client;
use Http\Message\MessageFactory\GuzzleMessageFactory;
.
.
.
$builder = new XApiClientBuilder();

$xApiClient = $builder
    ->setHttpClient(new Client())
    ->setRequestFactory(new GuzzleMessageFactory())
    ->setBaseUrl($endpoint)
    ->setAuth($key, $secret)
    ->setVersion($version)
    ->build();

$statementsApiClient = $xApiClient->getStatementsApiClient();

$result = $statementsApiClient->getStatements();

All of this works, but what I am looking to do is a simple test to check the connection works before I get into statements/storing. Is there a method available that I am missing that can test the client before doing any statements/storing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions