Skip to main content
Glama

CTX: Context as Code (CaC) tool

by context-hub
MIT License
235
  • Apple
  • Linux
UpdaterFactory.php1.16 kB
<?php declare(strict_types=1); namespace Butschster\ContextGenerator\Lib\BinaryUpdater; use Butschster\ContextGenerator\Lib\BinaryUpdater\Strategy\UnixUpdateStrategy; use Butschster\ContextGenerator\Lib\BinaryUpdater\Strategy\UpdateStrategyInterface; use Butschster\ContextGenerator\Lib\BinaryUpdater\Strategy\WindowsUpdateStrategy; use Psr\Log\LoggerInterface; use Spiral\Files\FilesInterface; /** * Factory for creating platform-specific update strategies. */ final readonly class UpdaterFactory { /** * @param FilesInterface $files File system service */ public function __construct( private FilesInterface $files, private ?LoggerInterface $logger = null, ) {} /** * Create an appropriate update strategy based on the current platform. */ public function createStrategy(): UpdateStrategyInterface { // Create the appropriate strategy based on the operating system return match (\PHP_OS_FAMILY) { 'Windows' => new WindowsUpdateStrategy($this->files, $this->logger), default => new UnixUpdateStrategy($this->files, $this->logger), }; } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/context-hub/generator'

If you have feedback or need assistance with the MCP directory API, please join our Discord server