To capture a background transaction, utilize the function atatus_set_background_transaction(true) along with atatus_begin_transaction() and atatus_end_transaction()

Compatibility

Requires PHP agent version 1.15.2 or higher.

Syntax

copy
icon/buttons/copy
atatus_set_background_transaction($value)

Parameter

Parameter Type Description
$value Boolean (Required) Set true for background transaction.

Example

copy
icon/buttons/copy
<?php

function migrate() {

    if (extension_loaded('atatus')) { // ensure PHP agent is available
        atatus_begin_transaction(); //begins a new transaction
        atatus_set_background_transaction(true);
    }

    // Your background task...

    if (extension_loaded('atatus')) { // ensure PHP agent is available
        atatus_end_transaction(); // stops the current transaction
    }
}

See also