Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

unwanted PHP extensions compiled even with explicit php_builder.extensions setting

已关闭 适合新手
#149 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
70/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
php
领域
build-system

调研方向

查找 PHP 配置命令的生成位置,特别是处理 php_builder.extensions 的逻辑。Bug 是当显式列出扩展时不会添加 --disable-all。查找构建器配置解析部分和组装配置参数的脚本。修复应确保仅启用指定的扩展。

由索引模型根据 Issue 内容生成。

描述

TL;DR: Apparently, php_builder.extensions setting enables the extensions which are normally disabled. Extensions which are enabled by default are still compiled. What I expected was that this setting compiles only the listed extensions.

Boring details:

I have this project.yml file (with no vendor directory):


output: build/myapp

mode: bin

sapi: embed

php-builder:
  extensions: [ctype, curl, fileinfo, filter, pcntl, posix, libxml, dom, mbstring, sockets, zlib, dom]
  zts: on


optimize: 3
job: 4
debug: false

sources:
  - main.php

build-dir: build

main.php:

<?php

function main(): void
{
  $extensions = get_loaded_extensions();
  var_dump($extensions);
}

And here is the output: build/myapp

array(35) {
  [0]=>
  string(4) "Core"
  [1]=>
  string(4) "date"
  [2]=>
  string(6) "lexbor"
  [3]=>
  string(4) "pcre"
  [4]=>
  string(7) "sqlite3"
  [5]=>
  string(4) "zlib"
  [6]=>
  string(5) "ctype"
  [7]=>
  string(4) "curl"
  [8]=>
  string(3) "uri"
  [9]=>
  string(4) "json"
  [10]=>
  string(8) "fileinfo"
  [11]=>
  string(6) "filter"
  [12]=>
  string(4) "hash"
  [13]=>
  string(5) "iconv"
  [14]=>
  string(3) "SPL"
  [15]=>
  string(8) "mbstring"
  [16]=>
  string(12) "Zend OPcache"
  [17]=>
  string(5) "pcntl"
  [18]=>
  string(7) "session"
  [19]=>
  string(8) "standard"
  [20]=>
  string(3) "PDO"
  [21]=>
  string(10) "pdo_sqlite"
  [22]=>
  string(4) "Phar"
  [23]=>
  string(5) "posix"
  [24]=>
  string(6) "random"
  [25]=>
  string(10) "Reflection"
  [26]=>
  string(6) "libxml"
  [27]=>
  string(9) "SimpleXML"
  [28]=>
  string(7) "sockets"
  [29]=>
  string(9) "tokenizer"
  [30]=>
  string(3) "dom"
  [31]=>
  string(3) "xml"
  [32]=>
  string(9) "xmlreader"
  [33]=>
  string(9) "xmlwriter"
  [34]=>
  string(13) "typephp_myapp"
}

xml, xmlreader, xmlwriter, SimpleXML, PDO, pdo_sqlite, sqlite3, session are all there.

Looking at the logs, I've found out that the configure command does not use --disable-all when the required extensions are explicitly listed in php_builder.extensions. Shouldn't that be the behavior I expected or am I missing something?

主要语言
PHP
星标
1.4k
派生
81
平均合并
1 天 1 小时
30 天内合并 PR
25

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

swoole/typephp 的其他 Issue

查看 swoole/typephp 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。