# Greph > Greph 是适用于源代码树的纯 PHP 搜索和重构引擎:支持与 grep 兼容的文本搜索、结构化 AST 搜索,以及保留格式的 AST 重写。 ## 页面 - [首页](https://greph.inline0.dev/zh/) ## 文档 - [简介](https://greph.inline0.dev/zh/docs.md): Greph以纯 PHP 搜索和重构 PHP 源码树:兼容 grep 的文本搜索、支持元变量的 AST 搜索,以及保留格式的重写。 - [快速入门](https://greph.inline0.dev/zh/docs/getting-started.md): 安装 Greph,开始文本、AST 和重写搜索。 - [文本搜索](https://greph.inline0.dev/zh/docs/modes/text.md): 固定字符串和正则表达式文本搜索,输出兼容 grep,使用体验类似 ripgrep。 - [AST 搜索](https://greph.inline0.dev/zh/docs/modes/ast.md): 支持元变量、重复捕获和可变参数模式的结构化 PHP 搜索。 - [AST 重写](https://greph.inline0.dev/zh/docs/modes/rewrite.md): 保留格式的结构化重写,支持试运行、交互和写入模式。 - [索引文本搜索](https://greph.inline0.dev/zh/docs/indexed/text.md): 用于重复文本搜索工作负载的预热三元组和标识符倒排表索引。 - [索引 AST 搜索](https://greph.inline0.dev/zh/docs/indexed/ast.md): 用于重复结构化查询的预热 AST 事实索引。 - [缓存 AST 搜索](https://greph.inline0.dev/zh/docs/indexed/cache.md): 缓存解析后的语法树存储,重复查询时可跳过 PHP-Parser 流程。 - [rg 兼容性](https://greph.inline0.dev/zh/docs/compatibility/rg.md): 由 Greph 引擎驱动的即插即用 ripgrep 包装器。 - [sg 兼容性](https://greph.inline0.dev/zh/docs/compatibility/sg.md): 由 Greph 引擎驱动的即插即用 ast-grep 包装器。 - [文件遍历器](https://greph.inline0.dev/zh/docs/advanced/walker.md): 递归遍历目录,支持 gitignore、.grephignore、glob 和二进制文件检测。 - [并行工作进程](https://greph.inline0.dev/zh/docs/advanced/parallel.md): 基于 pcntl 的工作进程池,支持并行文本和 AST 扫描,并可回退到单进程运行。 - [受进程限制的主机](https://greph.inline0.dev/zh/docs/advanced/process-restricted-hosts.md): 在禁用 Greph、proc_open()、shell_exec() 或 pcntl_fork() 的环境中运行,并以进程禁用模式构建比较辅助工具。 - [功能矩阵](https://greph.inline0.dev/zh/docs/advanced/feature-matrix.md): 通过探测生成的兼容性报告,涵盖 rg、sg 包装器及原生 greph 接口。 - [测试](https://greph.inline0.dev/zh/docs/advanced/testing.md): 单元测试、预期结果回归语料和验证命令。 - [基准测试](https://greph.inline0.dev/zh/docs/advanced/benchmarks.md): 仓库内的基准测试工具、真实场景语料库,以及由 CI 发布的数据。 - [CLI](https://greph.inline0.dev/zh/docs/cli.md): greph、greph-index、rg 和 sg 可执行文件的完整命令参考。 - [API](https://greph.inline0.dev/zh/docs/api.md): Greph\Greph facade 及配套的选项、结果和遍历器类构成公开的 PHP API。 ## 可选 - [完整文档](https://greph.inline0.dev/zh/llms-full.txt): 一个文件中所有文档页面的 Markdown 源码,138 KB,约 23,000 个令牌