fix: use Docker PHP-FPM to support sampling in conformance tests (#219)

This commit is contained in:
Kyrian Obikwelu 2026-01-02 15:59:56 +01:00 • committed by GitHub
commit 4c3e5e61c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,33 @@
<?php
/*
* This file is part of the official PHP MCP SDK.
*
* A collaboration between Symfony and the PHP Foundation.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Mcp\Tests\Conformance;
use Psr\Log\AbstractLogger;
final class FileLogger extends AbstractLogger
{
public function __construct(
private readonly string $filePath,
private readonly bool $debug = false,
) {
}
public function log($level, mixed $message, array $context = []): void
{
if (!$this->debug && 'debug' === $level) {
return;
}
$logMessage = \sprintf("[%s] %s\n", strtoupper($level), $message);
file_put_contents($this->filePath, $logMessage, \FILE_APPEND);
}
}