Introduce initial structure for Limble module with core configuration classes

This commit is contained in:
Jepp9350
2025-06-12 12:50:17 +02:00
parent 7109f68cdd
commit 56927b8994
5 changed files with 175 additions and 0 deletions
@@ -0,0 +1,29 @@
<?php
namespace limble\config;
use Exception;
use traits\module_config_variable;
class limble_client_id_c
{
use module_config_variable;
/**
* @throws Exception
*/
public function __construct()
{
self::setupConfigVariable(
'limble',
'client_id',
'string',
false,
null,
'The client_id for limble',
'client_id',
false,
''
);
}
}
@@ -0,0 +1,29 @@
<?php
namespace limble\config;
use Exception;
use traits\module_config_variable;
class limble_client_secret_c
{
use module_config_variable;
/**
* @throws Exception
*/
public function __construct()
{
self::setupConfigVariable(
'limble',
'client_secret',
'string',
false,
null,
'The client secret for limble',
'client_secret',
true,
''
);
}
}
@@ -0,0 +1,29 @@
<?php
namespace limble\config;
use Exception;
use traits\module_config_variable;
class limble_enabled_c
{
use module_config_variable;
/**
* @throws Exception
*/
public function __construct()
{
self::setupConfigVariable(
'limble',
'enabled',
'bool',
true,
null,
'Whether the limble module is enabled or not',
'1',
false,
'false'
);
}
}
@@ -0,0 +1,29 @@
<?php
namespace limble\config;
use Exception;
use traits\module_config_variable;
class limble_webhooks_enabled_c
{
use module_config_variable;
/**
* @throws Exception
*/
public function __construct()
{
self::setupConfigVariable(
'limble',
'webhooks_enabled',
'bool',
true,
null,
'Whether the limble modules webhooks are enabled or not',
'1',
false,
'false'
);
}
}
@@ -0,0 +1,59 @@
<?php
namespace limble;
require_once WD . '/modules/xlvask/config/limble_enabled_c.php';
require_once WD . '/modules/limble/config/limble_webhooks_enabled_c.php';
require_once WD . '/modules/limble/config/limble_client_id_c.php';
require_once WD . '/modules/limble/config/limble_client_secret_c.php';
use limble\config\limble_client_id_c;
use limble\config\limble_client_secret_c;
use limble\config\limble_enabled_c;
use limble\config\limble_webhooks_enabled_c;
use traits\module_config_t;
class limble_c
{
use module_config_t;
/**
* The API URL for the limble module
* @var string $api_url
*/
public string $api_url = 'https://eu-api.limblecmms.com';
/**
* The status of the module
* @var limble_enabled_c
*/
public limble_enabled_c $enabled;
/**
* The status of the webhooks
* @var limble_webhooks_enabled_c $webhooks_enabled
*/
public limble_webhooks_enabled_c $webhooks_enabled;
/**
* The client ID for the limble module
* @var limble_client_id_c
*/
public limble_client_id_c $client_id;
/**
* The client secret for the limble module
* @var limble_client_secret_c
*/
public limble_client_secret_c $client_secret;
public function __construct()
{
$this->setupConfig('limble');
$this->allowUpdate([
limble_enabled_c::class,
limble_webhooks_enabled_c::class,
limble_client_id_c::class,
limble_client_secret_c::class,
]);
$this->enabled = new limble_enabled_c();
$this->webhooks_enabled = new limble_webhooks_enabled_c();
$this->client_id = new limble_client_id_c();
$this->client_secret = new limble_client_secret_c();
}
}