HelPHP

Write_config
in package
implements Tool

Tags
class

Write_config

Rewrites one constant in config/main.php, config/db.php or config/email.php via the existing Utils::write_in_config(). Destructive, instance-scoped.

write_in_config()'s $path parameter otherwise lets a caller target config/db.php (DB credentials) or corrupt path-critical constants like HELPHP_FOLDER/HOME_FOLDER in config/main.php and self-lock the instance, so both the target file and the variable name are restricted here.

Table of Contents

Interfaces

Tool

Constants

ALLOWED_FILES  : mixed = ['main' => 'config/main.php', 'db' => 'config/d...
DENYLISTED_KEYS  : mixed = ['CRYPT_KEY', 'DB_PASS', 'DB_USER', 'DB_HOST',...

Methods

description()  : string
Human-readable description shown to the calling LLM in tools/list.
handle()  : array<string|int, mixed>
Runs the tool.
input_schema()  : array<string|int, mixed>
JSON Schema for the tool's arguments, returned verbatim as "inputSchema" in tools/list.
is_destructive()  : bool
True if this tool mutates instance or main-repo state. Destructive tools require arguments.confirm === true on every transport, and additionally require an admin-authenticated caller on the HTTP transport (see Server::handle_tools_call).
name()  : string
MCP tool name, as advertised in tools/list and matched in tools/call.

Constants

ALLOWED_FILES

public mixed ALLOWED_FILES = ['main' => 'config/main.php', 'db' => 'config/db.php', 'email' => 'config/email.php']

DENYLISTED_KEYS

public mixed DENYLISTED_KEYS = ['CRYPT_KEY', 'DB_PASS', 'DB_USER', 'DB_HOST', 'DB_BASE', 'DB_SLAVE_PASS', 'DB_SLAVE_USER', 'DB_SLAVE_HOST', 'DB_SLAVE_BASE', 'HELPHP_FOLDER', 'HOME_FOLDER', 'APACHE_USER', 'REDIS_HOST', 'REDIS_PORT']

Methods

description()

Human-readable description shown to the calling LLM in tools/list.

public description() : string

For a tool that mutates the shared main repo or an instance's live state, this description must say so explicitly.

Return values
string

handle()

Runs the tool.

public handle(array<string|int, mixed> $arguments, array<string|int, mixed> $context) : array<string|int, mixed>
Parameters
$arguments : array<string|int, mixed>

Arguments from the tools/call request.

$context : array<string|int, mixed>

['transport'=>'stdio'|'http', 'is_admin'=>bool, 'user_id'=>int|null, 'login'=>string|null]

Return values
array<string|int, mixed> —

MCP "content" array, e.g. ['content'=>[['type'=>'text','text'=>'...']]]

input_schema()

JSON Schema for the tool's arguments, returned verbatim as "inputSchema" in tools/list.

public input_schema() : array<string|int, mixed>
Return values
array<string|int, mixed>

is_destructive()

True if this tool mutates instance or main-repo state. Destructive tools require arguments.confirm === true on every transport, and additionally require an admin-authenticated caller on the HTTP transport (see Server::handle_tools_call).

public is_destructive() : bool
Return values
bool

name()

MCP tool name, as advertised in tools/list and matched in tools/call.

public name() : string
Return values
string
On this page

Search results