定制 self-heallm/php-self-heallm 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

self-heallm/php-self-heallm

最新稳定版本:v0.1.0

Composer 安装命令:

composer require self-heallm/php-self-heallm

包简介

Framework-agnostic PHP library for automated error triage and LLM-powered self-healing.

README 文档

README

Packagist (self-heallm/php-self-heallm)

Latest Version License PHP Version Symfony HttpClient Total Downloads Monthly Downloads

GitHub (universe-coder/php-self-heallm)

GitHub Stars Open Issues Last Commit GitHub forks

Canonical repository URLs are in composer.json (homepage, support). The Composer package name on Packagist remains self-heallm/php-self-heallm.

Framework-agnostic PHP Composer library that scans recent log errors, asks an LLM for a fix (OpenAI, Anthropic, Hugging Face OpenAI-compatible endpoint, or Ollama), validates path safety, optionally applies patches, and sends reports (Telegram, Slack, webhook, Sentry, JSONL file).

Install

composer require self-heallm/php-self-heallm

CLI

From your project root (with config/self-heal.php or env vars):

vendor/bin/self-heal

Or pass an explicit config path:

vendor/bin/self-heal --config=/absolute/path/to/self-heal.php

Copy config/self-heal.php into your app and adjust paths under log, reporting, and deduplication defaults (package defaults use <package>/var/... when shipped alone).

Programmatic use

use SelfHealLM\Bootstrap\SelfHealApplication;

$pipeline = SelfHealApplication::fromConfigFile(__DIR__ . '/config/self-heal.php');
$result = $pipeline->run(); // ['status' => 'ok'|'skipped', 'reason' => ...?]

Or build config in memory:

$pipeline = SelfHealApplication::fromConfigArray([
    'enabled' => true,
    'dry_run' => true,
    'log' => ['path' => '/var/log/app.log', 'max_lines' => 200],
    // ... same keys as in config/self-heal.php (no outer `self-heal` key required)
]);

Environment variables

Same SELF_HEAL_* names as the Laravel-oriented package; see config/self-heal.php for the full list. Set SELF_HEAL_OPENAI_TOKEN, SELF_HEAL_LOG_PATH, etc., in your process environment or .env loader before including the config file.

Security

  • Only paths under configured allowed_paths are accepted; forbidden_paths always win.
  • Auto-apply runs only when enabled, auto_apply, and dry_run are set accordingly in config.

Related

The laravel-self-heallm package targets Laravel apps; this library is suitable for any PHP runtime with Composer.

License

MIT. See LICENSE.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 9
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固