modified: README.md

This commit is contained in:
2026-04-23 12:39:36 +02:00
parent cbaf3319ce
commit aee79ddbfa
15 changed files with 2371 additions and 108 deletions

View File

@@ -0,0 +1,50 @@
<?php
if (!defined('ABSPATH')) {
exit;
}
final class SPP_Plugin
{
private static ?SPP_Plugin $instance = null;
public static function instance(): SPP_Plugin
{
if (self::$instance === null) {
self::$instance = new self();
}
return self::$instance;
}
public function boot(): void
{
SPP_Activator::maybe_upgrade();
$repository = new SPP_Repository();
$proxmox = $this->make_proxmox_client();
$expiration_service = new SPP_Expiration_Service($repository, $proxmox);
add_action('spp_expire_deployments', [$expiration_service, 'expire_due_deployments']);
(new SPP_REST_Controller($repository, $proxmox, $expiration_service))->register_hooks();
(new SPP_Admin_Page())->register_hooks();
(new SPP_Shortcode())->register_hooks();
}
private function make_proxmox_client(): SPP_Proxmox_Client
{
$mode = get_option('spp_proxmox_mode', 'mock');
if ($mode === 'http') {
return new SPP_Http_Proxmox_Client([
'base_url' => (string) get_option('spp_proxmox_base_url', ''),
'token_id' => (string) get_option('spp_proxmox_token_id', ''),
'token_secret' => (string) get_option('spp_proxmox_token_secret', ''),
'node' => (string) get_option('spp_proxmox_node', ''),
]);
}
return new SPP_Mock_Proxmox_Client();
}
}