NOCSRFCHECK
public
mixed
NOCSRFCHECK
= 1
public
mixed
NOCSRFCHECK
= 1
public
mixed
NOCSRFCHECK
= '1'
public
mixed
NOCSRFCHECK
= 1
\file talerbarr/webhook/webhook.php \ingroup talerbarr \brief Lightweight webhook listener for the Taler synchronisation.
public
mixed
NOLOGIN
= 1
public
mixed
NOREQUIREAJAX
= 1
public
mixed
NOREQUIREAJAX
= '1'
public
mixed
NOREQUIREAJAX
= 1
public
mixed
NOREQUIREHTML
= 1
public
mixed
NOREQUIREHTML
= '1'
public
mixed
NOREQUIREHTML
= 1
public
mixed
NOREQUIREMENU
= 1
public
mixed
NOREQUIREMENU
= '1'
public
mixed
NOREQUIREMENU
= 1
public
mixed
NOREQUIRESOC
= 1
public
mixed
NOREQUIRESOC
= '1'
public
mixed
NOSCANGETFORINJECTION
= 1
public
mixed
NOSCANPOSTFORINJECTION
= 1
Background synchroniser for the Taler-Barr module.
public
mixed
NOSESSION
= 1
Runs from CLI or by an async exec() call.
Refuses to start when another run is in progress (flock lock).
Writes human-readable progress into DOL_DATA_ROOT.'/talerbarr/sync.status.json'.
Normally you are not supposed to call it directly, only through the lib TalerSyncUtil class.
Usage examples php talerbarrsync.php – normal run, auto-detect direction php talerbarrsync.php --force – ignore stale lock file
public
mixed
NOSESSION
= 1
public
mixed
NOTOKENRENEWAL
= 1
public
mixed
NOTOKENRENEWAL
= 1
Persist a human-readable sync status JSON file.
writeStatus(array<string|int, mixed> $s) : void
Arbitrary status payload to serialize; function adds an RFC date in "ts".
Remove stale product_link rows: - links pointing to a deleted Dolibarr product - links that no longer exist on Taler
cleanOrphanProductLinks(DoliDB $db, string $instance, array<string|int, mixed> $remoteIds, User $user) : array{checked: int, deleted: int, errors: int}
DB handler
Taler instance id
Product ids seen on Taler during this run
Current user
Prepare admin pages header
talerbarrAdminPrepareHead() : array<string|int, array{string, string, string}>
Prepare array of tabs for TalerConfig
talerconfigPrepareHead(TalerConfig $object) : array<string|int, array{string, string, string}>
TalerConfig
Array of tabs
Build bucket definitions for a given range key.
talerbarr_build_chart_buckets(string $rangeKey, int $nowTs) : array<string|int, mixed>
Chart range key: day|week|month|year.
Current timestamp used as reference to anchor buckets.
Ensure relation/link columns are present and visible in the order-link list.
talerbarr_force_orderlink_list_columns(array<string|int, mixed> &$arrayfields, TalerOrderLink $object, Translate $langs) : void
Column configuration array (modified in-place)
Current list object definition
Translator
Custom relation/external link columns rendered explicitly in the list.
talerbarr_orderlink_extra_link_columns(Translate $langs) : array<string, string>
Translator
Resolve the latest credit note linked to a source invoice.
talerbarr_find_credit_note_for_invoice(DoliDB $db, int $sourceInvoiceId) : int
Database handle
Source invoice rowid
Credit note rowid (0 if none found)
Emit a JSON error/success response and exit.
talerbarrWebhookRespond(int $status, string $message[, array<string|int, mixed> $extra = [] ]) : void
HTTP status code
Human readable message
Optional extra payload
Escape unescaped quotes inside stringified JSON blobs embedded in a JSON payload.
talerbarrEscapeNestedJsonStrings(string $raw) : string
This is a defensive fix for Taler payloads that wrap arrays/objects in strings without escaping inner quotes (e.g., "taxes":"[{"tax":"..."}]").
Raw body
Sanitised body
Decode a JSON payload with a couple of sanitation fallbacks.
talerbarrDecodeWebhookJson(string $raw[, string|null &$error = null ][, string|null &$lastAttempt = null ]) : array<string|int, mixed>|null
Raw HTTP body.
Receives the last json_last_error_msg() if decoding fails.
Receives the sanitised payload used for the final attempt.
Decoded associative array on success, null on failure.
Persist the raw body of a JSON payload that could not be decoded for debugging.
talerbarrPersistInvalidJsonPayload(string $raw, string $error) : void
Raw body string.
Last json_last_error_msg().