Constants

BACKTRAC_API_ENDPOINT

BACKTRAC_API_ENDPOINT

COMPARE_PROD_STAGE

COMPARE_PROD_STAGE

COMPARE_PROD_DEV

COMPARE_PROD_DEV

COMPARE_STAGE_DEV

COMPARE_STAGE_DEV

ENV_PROD

ENV_PROD

ENV_STAGE

ENV_STAGE

ENV_DEV

ENV_DEV

Properties

$httpClient

$httpClient : \RestClient

Type

\RestClient

$projectId

$projectId : string

Type

string — Backtrac project id

$apiKey

$apiKey : string

Type

string — Backtrac.io api key

$secure

$secure : boolean

Type

boolean

Methods

__construct()

__construct(  $projectId,   $apiKey,   $secure = true) 

Backtrac ls teClient constructor.

Parameters

$projectId

string Backtrac project id

$apiKey

string Backtrac api key

$secure

compareEnvironments()

compareEnvironments(  $method) : mixed

Request a compare between 2 environments

Parameters

$method

string One of the self::COMPARE_* constants

Throws

\Exception

Returns

mixed

takeSnapshot()

takeSnapshot(string  $method, string  $env = '') : mixed

Request a snapshot of environment

Parameters

string $method

One of the self::COMPARE_* constants

string $env

One of the self::ENV_* constants

Throws

\Exception

Returns

mixed

checkResponse()

checkResponse(\RestClient  $client) : mixed

Checks an API response and return the decoded object, or throw an exception if failed.

Parameters

\RestClient $client

Throws

\Exception

Returns

mixed

setWebsite()

setWebsite(\EC\Utils\Backtrac\Website  $website) : mixed

Parameters

\EC\Utils\Backtrac\Website $website

Throws

\Exception

Returns

mixed

getResult()

getResult(  $id) : mixed

Gets a job / diff result

Results is (decoded ) :

{"status":"success","result":{"message":"Diff is completed","result":"Amount of differences: 100 %"}}

Parameters

$id

Returns

mixed

waitForResults()

waitForResults(  $id, integer  $timeout = 10) : mixed

Wait for the end of the diff to return the result :

Highly experimental, relying on "Diff is completed" text is unreliable

Parameters

$id
integer $timeout

Returns

mixed