PluginProbe
xSpeed Cache: AI-Powered Performance Hub with MCP, Caching & CDN / 1.3.3
xSpeed Cache: AI-Powered Performance Hub with MCP, Caching & CDN v1.3.3
1.3.3 1.3.2 1.3.1 1.3.0 1.2.4 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 All 29 releases
xspeed / includes / modules / Mcp / Cli_Output_Buffer.php

Cli_Output_Buffer.php in xSpeed Cache: AI-Powered Performance Hub with MCP, Caching & CDN 1.3.3, at includes/modules/Mcp/Cli_Output_Buffer.php

34 lines 660 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Output buffer for the MCP CLI bridge — collects the lines a bridged
4 * xSpeed CLI command emits (via the \WP_CLI shim) during a run, so the
5 * bridge can return them as structured MCP output. See Cli_Shim.
6 *
7 * @package XSpeed
8 */
9
10 declare(strict_types=1);
11
12 namespace XSpeed\Modules\Mcp;
13
14 defined( 'ABSPATH' ) || exit;
15
16 final class Cli_Output_Buffer {
17
18 /** @var string[] */
19 private $lines = array();
20
21 public function push( string $line ): void {
22 $this->lines[] = $line;
23 }
24
25 /** @return string[] */
26 public function lines(): array {
27 return $this->lines;
28 }
29
30 public function text(): string {
31 return implode( "\n", $this->lines );
32 }
33 }
34