ext-php-rs-bindings

用于基于 ext-php-rs 构建 PHP 8.2+ 原生扩展的约定集合:包括使用 php_class/php_function 宏、Zval 类型转换、PhpException 映射、php.ini 加载机制以及使用 PHPUnit 进行测试。用于在生成或审查基于 Rust 库的 ext-php-rs PHP 绑定时应用这些约定。

仓库最近推送
GitHub Stars
182
Forks
19
Issues / PRs
2

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "ext-php-rs-bindings":https://skillpi.com/zh/skills/deepskill-e7047016bbdcf55286cf3f6b140ff960436ede4aaa7cb1bc2526f5054b9137c6。安装前核对上游来源和版本:https://github.com/Goldziher/ai-rulez。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

用于基于 ext-php-rs 构建 PHP 8.2+ 原生扩展的约定集合:包括使用 php_class/php_function 宏、Zval 类型转换、PhpException 映射、php.ini 加载机制以及使用 PHPUnit 进行测试。用于在生成或审查基于 Rust 库的 ext-php-rs PHP 绑定时应用这些约定。

0 下载

介绍来源: third_party · Goldziher · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: ext-php-rs-bindings
description: "ext-php-rs conventions for building PHP 8.2+ native extensions from a Rust core: php_class/php_function macros, Zval conversion, PhpException mapping, php.ini loading, and PHPUnit testing. Load when generating or reviewing ext-php-rs PHP bindings for a Rust library."
  • Use ext-php-rs for PHP 8.2+ native extensions. Use #[php_class] and #[php_function] macros.
  • Map Rust types to PHP via FromZval/IntoZval traits. Return PhpResult<T> for fallible operations.
  • Map Rust errors to PHP exceptions: PhpException::from(...) with specific classes (InvalidArgumentException, RuntimeException).
  • Use #[php_method] for class methods. Implement __construct for PHP constructors.
  • Build with cargo build --release. Load extension via php.ini (extension=your_ext.so) or PECL distribution.
  • Test from PHP using PHPUnit. Verify extension loading with php -m | grep extension_name.
  • Use ZendClassObject<T> for wrapping Rust structs as PHP objects.
  • PHP uses reference counting — avoid circular references in wrapped Rust structs. Implement Drop for cleanup.
  • PHP is single-threaded per request — offload CPU-intensive work to Rust, return results synchronously.
  • Keep PHP extension thin — business logic in Rust, PHP provides typed interface.
  • Anti-patterns: panics in PHP functions, blocking operations without timeout, raw pointer manipulation.

版本历史

  1. v5.15.0 GitHub ↗
    原版更新说明

    ## What's Changed * chore(deps): bump github.com/parquet-go/parquet-go from 0.32.0 to 0.32.1 in /tools/skillbench by @dependabot[bot] in https://github.com/Goldziher/ai-rulez/pull/597 * chore(deps): bump @astrojs/starlight from 0.42.11 to 0.43.1 in /website by @dependabot[bot] in https://github.com/Goldziher/ai-rulez/pull/595 * feat(plugin): configurable Cursor hook root fallback by @Goldziher in https://github.com/Goldziher/ai-rulez/pull/600 * chore: refresh dependencies, harness names and fix AR005 flag-value false positive by @Goldziher in https://github.com/Goldziher/ai-rulez/pull/601 * chore(release): prepare ai-rulez 5.15.0 by @Goldziher in https://github.com/Goldziher/ai-rulez/pull/602 **Full Changelog**: https://github.com/Goldziher/ai-rulez/compare/v5.14.1...v5.15.0

  2. v5.14.1 GitHub ↗
    原版更新说明

    ## What's Changed * fix(config): honor XDG_CACHE_HOME for the user cache by @Goldziher in https://github.com/Goldziher/ai-rulez/pull/592 **Full Changelog**: https://github.com/Goldziher/ai-rulez/compare/v5.14.0...v5.14.1

  3. v5.14.0 GitHub ↗
    原版更新说明

    ## What's Changed * chore(deps): bump @astrojs/starlight from 0.42.10 to 0.42.11 in /website by @dependabot[bot] in https://github.com/Goldziher/ai-rulez/pull/576 * fix(harnessnames): refresh copilot and cortex built-ins from their sources by @Goldziher in https://github.com/Goldziher/ai-rulez/pull/583 * fix(config): make the session-start briefing source-aware by @Goldziher in https://github.com/Goldziher/ai-rulez/pull/584 * feat(mcp): expose worktree_setup for agent-created worktrees by @Goldziher in https://github.com/Goldziher/ai-rulez/pull/587 * docs(publish): add a verify-before-install recipe for consumers by @Goldziher in https://github.com/Goldziher/ai-rulez/pull/585 * chore(release): prepare ai-rulez 5.14.0 by @Goldziher in https://github.com/Goldziher/ai-rulez/pull/588 **Full Changelog**: https://github.com/Goldziher/ai-rulez/compare/v5.13.4...v5.14.0

  4. v5.13.4 GitHub ↗
    原版更新说明

    ## What's Changed * test(bench): measure native and MCP skill discovery by @Goldziher in https://github.com/Goldziher/ai-rulez/pull/575 * fix(npm): stop the Windows CLI tree when the wrapper exits by @Goldziher in https://github.com/Goldziher/ai-rulez/pull/574 * fix(mcp): improve Claude skill discovery for v5.13.4 by @Goldziher in https://github.com/Goldziher/ai-rulez/pull/577 **Full Changelog**: https://github.com/Goldziher/ai-rulez/compare/v5.13.3...v5.13.4

  5. v5.13.3 GitHub ↗
    原版更新说明

    ## What's Changed * ci: keep generated release artifacts out of Git by @Goldziher in https://github.com/Goldziher/ai-rulez/pull/567 * docs: clarify native and MCP skill discovery by @Goldziher in https://github.com/Goldziher/ai-rulez/pull/568 * fix(npm): preserve stdout and forward termination by @Goldziher in https://github.com/Goldziher/ai-rulez/pull/566 * fix(pathglob): preserve Unicode literals by @Goldziher in https://github.com/Goldziher/ai-rulez/pull/569 * fix(semver): validate release age before duration conversion by @Goldziher in https://github.com/Goldziher/ai-rulez/pull/570 * fix(agents): preserve adjacent AGENTS.md sections by @Goldziher in https://github.com/Goldziher/ai-rulez/pull/571 * bench: add paired skill discovery fixture and protocol by @Goldziher in https://github.com/Goldziher/ai-rulez/pull/572 * chore(release): prepare ai-rulez 5.13.3 by @Goldziher in https://github.com/Goldziher/ai-rulez/pull/573 **Full Changelog**: https://github.com/Goldziher/ai-rulez/compare/v5.13.2...v5.13.3

此处仅展示最近 5 个版本。 在原站查看完整版本历史 ↗

当前收录版本

0.0.1

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值75/100

亮点

  • 提供完整的 ext-php-rs 开发约定集
  • 覆盖类型映射、异常处理、内存管理等关键工程实践
触发精准92/100

亮点

  • 触发词精准覆盖 ext-php-rs 核心概念
  • 边界清晰限定于 Rust-PHP 跨语言绑定场景
结构规范78/100

待提升项

  • 缺少端到端完整代码示例 原报告严重程度:轻微

    文档提供了关键用法要点,但缺少一个完整的 php_class 实现示例

    改进建议:补充一个完整的 ext-php-rs 扩展示例,包含 #[php_class]、#[php_method]、类型转换和异常处理的端到端代码

亮点

  • 逻辑结构清晰,bullet points 覆盖完整开发流程
  • frontmatter 完整规范
执行可靠88/100

亮点

  • 构建和测试路径明确可靠
  • 覆盖主要异常场景和反模式指导
证据可验 (前四项均值)83/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。