Copied unchanged from public/typo3conf/ext/ of EP/website at 9593cc8631354f8a363d6609de8b7433f669a9a0 (Git-tracked files only). History stays in the old repository. Only composer.json files are added so the extensions install as path packages. Co-Authored-By: Claude Opus 5.5 <[email protected]>
41 lines
1.1 KiB
PHP
41 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace EP\EpTheme\Form;
|
|
|
|
use Symfony\Component\HttpClient\HttpClient;
|
|
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
|
|
|
class WebhookFinisher extends AbstractMappedFinisher
|
|
{
|
|
protected function executeInternal()
|
|
{
|
|
try {
|
|
$url = trim((string)$this->parseOption('url'));
|
|
if ('' === $url) {
|
|
return;
|
|
}
|
|
|
|
$payload = $this->buildPayload();
|
|
if ([] === $payload) {
|
|
return;
|
|
}
|
|
|
|
$response = HttpClient::create()->request('POST', $url, [
|
|
'json' => $payload,
|
|
]);
|
|
|
|
$statusCode = $response->getStatusCode();
|
|
if ($statusCode < 200 || $statusCode >= 300) {
|
|
$this->logWarning('Webhook finisher returned an unexpected response status.', [
|
|
'url' => $url,
|
|
'statusCode' => $statusCode,
|
|
]);
|
|
}
|
|
} catch (\Throwable $e) {
|
|
$this->logWarning('Webhook finisher request failed.', [
|
|
'exception' => $e,
|
|
]);
|
|
}
|
|
}
|
|
}
|