siip-whatsapp-notifications.../main.php
2024-12-31 09:48:29 +00:00

24 lines
610 B
PHP
Executable File

<?php
chdir(__DIR__);
require 'vendor/autoload.php';
(static function () {
$builder = new \DI\ContainerBuilder();
$container = $builder->build();
$plugin = $container->get(\SmsNotifier\Plugin::class);
try {
$plugin->run();
// cleanup plugin log
$container->get(\SmsNotifier\Service\LogCleaner::class)->clean();
} catch (Exception $e) {
$logger = new \SmsNotifier\Service\Logger();
$logger->error($e->getMessage());
$logger->debug($e->getTraceAsString());
}
})();
http_response_code(200); //Response OK when it's called by a webhook.