Token导航 LogoToken导航

Agent Skill · 研究检索

php-sql-fixer(PHP SQL fixer 搜索)

用于辅助数据库表结构、查询语句、迁移脚本和数据维护任务。它适合让 Agent 分析 schema、编写 SQL、排查查询问题、整理索引或生成迁移建议。使用时需要明确数据库类型、连接环境和目标表,区分只读分析与写入变更;涉及删除、更新、迁移和批量导入时,应优先 dry-run、备份或事务保护,避免误操作。

php-sql-fixer 是研究检索类 Agent Skill,可用宿主为 OpenClaw,通过ClawHub获取,权限为需要联网;许可证为 MIT-0,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 32,401。

总安装 2,521周安装 103GitHub Stars 公开资料未说明下载 816核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT-0
版本
1.0.0

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:php-sql-fixer(PHP SQL fixer 搜索)
来源仓库:https://github.com/xaviermary56/php-sql-fixer
安装命令:
openclaw skills install php-sql-fixer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install php-sql-fixer

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

检测 PHP/Yaf 项目中的 SQL 注入风险并生成修复补丁。扫描字符串拼接与超全局变量使用,识别潜在安全漏洞。输出参数化查询改写建议,提升数据库操作安全性。php-sql-fixer 属于研究检索类 Skill,可作为该场景下的辅助能力补充。仅分析代码逻辑,不直接修改文件,需人工复核后应用变更。

建议在测试环境验证修复效果,避免生产环境误操作。

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 OpenClaw;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 openclaw skills install php-sql-fixer;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

php-sql-fixer 怎么安装?

在终端执行 openclaw skills install php-sql-fixer。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

php-sql-fixer 支持哪些 AI 工具?

公开资料标注支持 OpenClaw。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

php-sql-fixer 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

php-sql-fixer 是免费的吗?

来源标注的许可证是 MIT-0。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

php-sql-fixer 用的人多吗?

公开数据是累计安装 2,521 次,近一周安装 103 次,下载 816 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

php-sql-fixer 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 专注 OpenClaw 一种宿主,触发方式和使用习惯不用来回切换。
  • 许可证明确为 MIT-0,商用和分发边界好判断。

先想清楚的地方

  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 OpenClaw,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
php-sql-fixer

PHP SQL fixer 搜索 · 本页

2,521—需要联网MIT-0有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

name
php-sql-fixer
version
1.0.0
description
Detect SQL injection risks in PHP/Yaf projects and generate parameterized query fix patches. Scans for string concatenation in SQL, unsafe superglobal interpolation, and sprintf-based injection. Outputs annotated findings with before/after fix suggestions. Works with PHP 7.3 and common Yaf DB patterns.
emoji
💉
user-invocable
true
homepage
https://github.com/XavierMary56/OmniPublish
requires
metadata
openclaw
requires
bins

PHP SQL Fixer

Detect SQL injection risks and generate parameterized query fix patches for PHP/Yaf projects.

Overview

This skill does two things:

  1. Scan — find all SQL injection candidates in a PHP project (string concatenation, superglobal interpolation, unsafe sprintf)
  2. Fix — for each finding, generate the parameterized equivalent and explain the change

Always prefer minimal, targeted fixes. Do not refactor surrounding code. Do not change DB abstraction patterns that already exist in the project.


Workflow

Step 1 — Run the scanner

bash "$SKILL_DIR/scripts/scan_sql.sh" <project-root> [output-file]

Read the output carefully. The scanner flags candidates, not confirmed vulnerabilities. Some hits may be false positives (e.g. SQL built from constants, not user input).

Step 2 — Triage findings

For each flagged file:

  • Open the file and read the full context around the hit (at least ±10 lines)
  • Confirm whether user-controlled input ($_GET, $_POST, $_REQUEST, function params from controllers) reaches the SQL string
  • Mark each finding as: confirmed / suspected / false positive

Step 3 — Generate fix suggestions

php "$SKILL_DIR/scripts/suggest_fix.php" <file-path>

The script outputs annotated before/after for each risky SQL statement in the file.

Step 4 — Apply fixes

Apply fixes manually or with targeted Edit tool calls. Rules:

  • Use parameterized queries matching the project's existing DB pattern (PDO, custom model, etc.)
  • Do not change method signatures or surrounding business logic
  • Add a // FIXED: sql injection comment on the line where the fix was applied
  • Run php -l <file> after every edit to verify syntax

Step 5 — Verify

# syntax check
docker compose -f /mnt/d/Users/Public/php20250819/docker-php7.3/docker-compose.yml \
  exec fpm-server php -l /var/www/html/2026www/<project>/<file>

# re-scan to confirm no remaining hits
bash "$SKILL_DIR/scripts/scan_sql.sh" <project-root>

Fix Patterns

See references/fix-patterns.md for the complete catalog. Quick reference:

Pattern 1 — String concatenation

// BEFORE (unsafe)
$sql = "SELECT * FROM users WHERE id = " . $id;
$res = $db->query($sql);

// AFTER (PDO)
$stmt = $db->prepare("SELECT * FROM users WHERE id = ?");
$stmt->execute([$id]);
$res = $stmt->fetchAll();

Pattern 2 — Variable interpolation

// BEFORE (unsafe)
$sql = "SELECT * FROM orders WHERE status = '$status' AND uid = $uid";

// AFTER (PDO named placeholders)
$stmt = $db->prepare("SELECT * FROM orders WHERE status = :status AND uid = :uid");
$stmt->execute([':status' => $status, ':uid' => $uid]);

Pattern 3 — sprintf injection

// BEFORE (unsafe)
$sql = sprintf("SELECT * FROM t WHERE name = '%s'", $name);

// AFTER
$stmt = $db->prepare("SELECT * FROM t WHERE name = ?");
$stmt->execute([$name]);

Pattern 4 — Yaf Model with custom query builder

// BEFORE (unsafe — raw string passed to model)
$this->_model->where("user_id = $uid AND type = '$type'")->find();

// AFTER (use array condition — depends on your Model API)
$this->_model->where(['user_id' => $uid, 'type' => $type])->find();

// OR if model supports raw+bindings:
$this->_model->where("user_id = ? AND type = ?", [$uid, $type])->find();

Pattern 5 — IN clause with array

// BEFORE (unsafe)
$ids = implode(',', $id_arr);
$sql = "SELECT * FROM t WHERE id IN ($ids)";

// AFTER (PHP 7.3 compatible)
$placeholders = implode(',', array_fill(0, count($id_arr), '?'));
$stmt = $db->prepare("SELECT * FROM t WHERE id IN ($placeholders)");
$stmt->execute($id_arr);

What NOT to Change

  • Do not switch DB abstraction libraries (e.g. from custom Model to bare PDO) unless the whole project already uses PDO
  • Do not parameterize column names or table names — these cannot be parameterized; use an allowlist instead
  • Do not touch SQL built entirely from constants with no user input
  • Do not change surrounding cache logic, error handling, or return values

False Positive Checklist

Before reporting a finding as confirmed SQL injection:

  • [ ] Does user-controlled input actually reach this SQL string?
  • [ ] Is the value an integer that was already intval()-cast earlier?
  • [ ] Is the value selected from a fixed allowlist (e.g. column name from a whitelist array)?
  • [ ] Is the SQL built from config constants only (no request data)?

If all four are "no" → confirmed risk. If any is "yes" → suspected or false positive.


Bulk Fix Guidance

When fixing many files across a project:

  1. Run scan_sql.sh on the whole project, save output to file
  2. Sort findings by controller/callback/payment paths first
  3. Fix highest-risk files first (payment, callback, login)
  4. Re-scan after each batch to track progress
  5. Never mix SQL fix commits with unrelated changes

平台分布

OpenClaw

82.65%
按下载量换算674

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills