peliprint/app/Services/Helpers/BlueprintVariableService.php
purple 839b602b6c Telemetry ID is now replaced with a Panel ID.
This ID contains a random string and the version of Blueprint and will be used for API calls and telemetry once that has been added.
2023-05-31 10:40:03 +02:00

49 lines
No EOL
1.2 KiB
PHP

<?php
namespace Pterodactyl\Services\Helpers;
use Pterodactyl\Contracts\Repository\SettingsRepositoryInterface;
use Pterodactyl\Services\Helpers\BlueprintPlaceholderService;
class BlueprintVariableService
{
// Construct BlueprintVariableService
public function __construct(
private SettingsRepositoryInterface $settings,
private BlueprintPlaceholderService $blueprintplaceholderservice,
) {
}
// $bp->serve()
// $bp->version()
// $bp->dbGet('db::record')
// $bp->dbSet('db::record', 'value')
// $bp->exec('arguments')
public function serve(): void {
return;
}
public function version(): string {
return $this->blueprintplaceholderservice->version();
}
public function dbGet($key): string {
$a = $this->settings->get("blueprint::".$key);
if (!$a) {
return "";
} else {
return $a;
};
}
public function dbSet($key, $value): void
{
$this->settings->set('blueprint::' . $key, $value);
return;
}
public function exec($arg): string|null
{
return shell_exec("blueprint -php ".$arg);
}
}