Files
api/services/nginx/app/modules/gatewayapi/gatewayapi_c.php
T
Jepp9350 849f1cc53e Add GatewayAPI module with configuration, routing, and core logic
Introduced a new GatewayAPI module to handle SMS messaging integration. This includes interfaces, core classes for API interaction, configuration management, and routing for config retrieval and update. Added necessary initializations in `index.php` to integrate the module seamlessly.
2025-04-10 10:51:32 +02:00

69 lines
2.0 KiB
PHP

<?php
namespace gatewayapi;
$GatewayAPI_path = __DIR__;
$GatewayAPI_config_path = $GatewayAPI_path . '/config';
/** Universal */
require_once $GatewayAPI_path . '/config/gatewayapi_enabled_c.php';
require_once $GatewayAPI_path . '/config/gatewayapi_api_key_c.php';
require_once $GatewayAPI_path . '/config/gatewayapi_api_secret_c.php';
require_once $GatewayAPI_path . '/config/gatewayapi_sender_c.php';
require_once $GatewayAPI_path . '/config/gatewayapi_api_token_c.php';
use gatewayapi\config\gatewayapi_api_key_c;
use gatewayapi\config\gatewayapi_api_secret_c;
use gatewayapi\config\gatewayapi_api_token_c;
use gatewayapi\config\gatewayapi_enabled_c;
use gatewayapi\config\gatewayapi_sender_c;
use traits\module_config_t;
class gatewayapi_c
{
use module_config_t;
/**
* The status of the module
* @var gatewayapi_enabled_c
*/
public gatewayapi_enabled_c $enabled;
/**
* The API key for the module
* @var gatewayapi_api_key_c
*/
public gatewayapi_api_key_c $api_key;
/**
* The API secret for the module
* @var gatewayapi_api_secret_c
*/
public gatewayapi_api_secret_c $api_secret;
/**
* The sender for the module
* @var gatewayapi_sender_c
*/
public gatewayapi_sender_c $sender;
/**
* The API token for the module
* @var gatewayapi_api_token_c
*/
public gatewayapi_api_token_c $api_token;
public function __construct()
{
$this->setupConfig('GatewayAPI');
$this->allowUpdate([
gatewayapi_enabled_c::class,
gatewayapi_api_key_c::class,
gatewayapi_api_secret_c::class,
gatewayapi_sender_c::class,
gatewayapi_api_token_c::class,
]);
$this->enabled = new gatewayapi_enabled_c();
$this->api_key = new gatewayapi_api_key_c();
$this->api_secret = new gatewayapi_api_secret_c();
$this->sender = new gatewayapi_sender_c();
$this->api_token = new gatewayapi_api_token_c();
}
}