static-php-cli/assets/zh_contributing_index.md.22akXfoC.js
2025-07-29 03:09:27 +00:00

2 lines
4.4 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as a,c as i,o as l,af as o}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"贡献指南","description":"","frontmatter":{},"headers":[],"relativePath":"zh/contributing/index.md","filePath":"zh/contributing/index.md"}'),r={name:"zh/contributing/index.md"};function n(t,e,c,d,s,h){return l(),i("div",null,e[0]||(e[0]=[o('<h1 id="贡献指南" tabindex="-1">贡献指南 <a class="header-anchor" href="#贡献指南" aria-label="Permalink to “贡献指南”"></a></h1><p>感谢你能够看到这里,本项目非常欢迎你的贡献!</p><h2 id="贡献方法" tabindex="-1">贡献方法 <a class="header-anchor" href="#贡献方法" aria-label="Permalink to “贡献方法”"></a></h2><p>如果你有代码或文档要贡献,以下是你需要首先了解的内容。</p><ol><li>你要贡献什么类型的代码?(新扩展、修复 Bug、安全问题、项目框架优化、文档</li><li>如果你贡献了新文件或新片段,你的代码是否经过 <code>php-cs-fixer</code> 和 <code>phpstan</code> 的检查?</li><li>在贡献代码前是否充分阅读了 <a href="./../develop/">开发指南</a></li></ol><p>如果你能回答上述问题并对代码进行了修改,可以及时在项目 GitHub 仓库发起 Pull Request。 代码审查完成后,可以根据建议修改代码,或直接合并到主分支。</p><h2 id="贡献类型" tabindex="-1">贡献类型 <a class="header-anchor" href="#贡献类型" aria-label="Permalink to “贡献类型”"></a></h2><p>本项目的主要目的是编译静态链接的 PHP 二进制文件,命令行处理功能基于 <code>symfony/console</code> 编写。 在开发之前,如果你对它不够熟悉,请先查看 <a href="https://symfony.com/doc/current/components/console.html" target="_blank" rel="noreferrer">symfony/console 文档</a>。</p><h3 id="安全更新" tabindex="-1">安全更新 <a class="header-anchor" href="#安全更新" aria-label="Permalink to “安全更新”"></a></h3><p>因为本项目基本上是一个本地运行的 PHP 项目,一般来说不会有远程攻击。 但如果你发现此类问题,请<strong>不要</strong>在 GitHub 仓库提交 PR 或 Issue 你需要通过 <a href="mailto:admin@zhamao.me" target="_blank" rel="noreferrer">邮件</a> 联系项目维护者crazywhalecc。</p><h3 id="修复-bug" tabindex="-1">修复 Bug <a class="header-anchor" href="#修复-bug" aria-label="Permalink to “修复 Bug”"></a></h3><p>修复 Bug 一般不涉及项目结构和框架的修改,所以如果你能定位到错误代码并直接修复它,请直接提交 PR。</p><h3 id="新扩展" tabindex="-1">新扩展 <a class="header-anchor" href="#新扩展" aria-label="Permalink to “新扩展”"></a></h3><p>对于添加新扩展,你需要了解项目的一些基本结构以及如何根据现有逻辑添加新扩展。 这将在本页的下一节中详细介绍。 总的来说,你需要:</p><ol><li>评估扩展是否可以内联编译到 PHP 中。</li><li>评估扩展的依赖库(如果有)是否可以静态编译。</li><li>编写不同平台的库编译命令。</li><li>验证扩展及其依赖项与现有扩展和依赖项兼容。</li><li>验证扩展在 <code>cli</code>、<code>micro</code>、<code>fpm</code>、<code>embed</code> SAPIs 中正常工作。</li><li>编写文档并添加你的扩展。</li></ol><h3 id="项目框架优化" tabindex="-1">项目框架优化 <a class="header-anchor" href="#项目框架优化" aria-label="Permalink to “项目框架优化”"></a></h3><p>如果你已经熟悉 <code>symfony/console</code> 的工作原理,并同时要对项目的框架进行一些修改或优化,请先了解以下事情:</p><ol><li>添加扩展不属于项目框架优化,但如果你在添加新扩展时发现必须优化框架,则需要先修改框架本身,然后再添加扩展。</li><li>对于一些大规模逻辑修改(例如涉及 LibraryBase、Extension 对象等的修改),建议先提交 Issue 或 Draft PR 进行讨论。</li><li>在项目早期,它是一个纯私有开发项目,代码中有一些中文注释。项目国际化后,你可以提交 PR 将这些注释翻译为英语。</li><li>请不要在代码中提交更多无用的代码片段,例如大量未使用的变量、方法、类以及多次重写的代码。</li></ol>',18)]))}const f=a(r,[["render",n]]);export{m as __pageData,f as default};