Skip to content

Commit ef77a5d

Browse files
committed
Update spc self to PHP 8.4 only
1 parent 6b227d8 commit ef77a5d

File tree

9 files changed

+1660
-1066
lines changed

9 files changed

+1660
-1066
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ packlib_files.txt
3232
!/bin/spc*
3333
!/bin/setup-runtime*
3434
!/bin/spc-alpine-docker
35+
!/bin/php-cs-fixer-wrapper
3536

3637
# exclude windows build tools
3738
/php-sdk-binary-tools/

.php-cs-fixer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@
6464
'php_unit_test_class_requires_covers' => false,
6565
'phpdoc_var_without_name' => false,
6666
'fully_qualified_strict_types' => false,
67+
'operator_linebreak' => false,
68+
'php_unit_data_provider_method_order' => false,
6769
])
6870
->setFinder(
6971
PhpCsFixer\Finder::create()->in([__DIR__ . '/src', __DIR__ . '/tests/SPC'])

README-zh.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static-php-cli(简称 `spc`)有许多特性:
5858

5959
### 编译环境需求
6060

61-
- PHP >= 8.1(这是 spc 自身需要的版本,不是支持的构建版本)
61+
- PHP 8.4(这是 spc 自身需要的版本,不是支持的构建版本)
6262
- 扩展:`mbstring,tokenizer,phar`
6363
- 系统安装了 `curl``git`
6464

@@ -180,6 +180,9 @@ bin/spc --version
180180
# 检查环境依赖,并根据尝试自动安装缺失的编译工具
181181
./bin/spc doctor --auto-fix
182182

183+
# 输出目标项目依赖的扩展列表
184+
./bin/spc dump-extensions /path/to/your/project --format=text
185+
183186
# 拉取所有依赖库
184187
./bin/spc download --all
185188
# 只拉取编译指定扩展需要的所有依赖(推荐)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ which can be downloaded directly according to your needs.
6767
You can say I made a PHP builder written in PHP, pretty funny.
6868
But static-php-cli runtime only requires an environment above PHP 8.1 and extensions mentioned below.
6969

70-
- PHP >= 8.1 (This is the version required by spc itself, not the build version)
70+
- PHP 8.4 (This is the version required by spc itself, not the build version)
7171
- Extension: `mbstring,tokenizer,phar`
7272
- Supported OS with `curl` and `git` installed
7373

@@ -195,7 +195,7 @@ Basic usage for building php with some extensions:
195195
# fetch all libraries
196196
./bin/spc download --all
197197
# dump a list of extensions required by your project
198-
./bin/spc dump-extensions
198+
./bin/spc dump-extensions /path/to/your/project --format=text
199199
# only fetch necessary sources by needed extensions (recommended)
200200
./bin/spc download --for-extensions="openssl,pcntl,mbstring,pdo_sqlite"
201201
# download pre-built libraries first (save time for compiling dependencies)

bin/setup-runtime

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ __DIR__=$(cd "$(dirname "$0")" && pwd)
2525
__PROJECT__=$(cd "${__DIR__}"/../ && pwd)
2626

2727
# set download dir
28-
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.2.13-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
28+
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.4.4-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
2929
__COMPOSER_URL__="https://getcomposer.org/download/latest-stable/composer.phar"
3030

3131
# use china mirror
@@ -45,7 +45,7 @@ done
4545

4646
case "$mirror" in
4747
china)
48-
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.2.13-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
48+
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.4.4-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
4949
__COMPOSER_URL__="https://mirrors.tencent.com/composer/composer.phar"
5050
;;
5151

@@ -61,7 +61,7 @@ test -f "${__PROJECT__}"/downloads/runtime.tar.gz || { echo "Downloading $__PHP_
6161
test -f "${__DIR__}"/php || { tar -xf "${__PROJECT__}"/downloads/runtime.tar.gz -C "${__DIR__}"/ ; }
6262
chmod +x "${__DIR__}"/php
6363
# download composer
64-
test -f "${__DIR__}"/composer || curl -#fSL -o "${__DIR__}"/composer "$__COMPOSER_URL__"
64+
test -f "${__DIR__}"/composer || { echo "Downloading Composer from $__COMPOSER_URL__" && curl -#fSL -o "${__DIR__}"/composer "$__COMPOSER_URL__" ; }
6565
chmod +x "${__DIR__}"/composer
6666
# sanity check for php and composer
6767
"${__DIR__}"/php -v >/dev/null || { echo "Failed to run php" && exit 1; }

bin/setup-runtime.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ if ($action -eq 'add-path') {
5151
}
5252

5353
# get php 8.1 specific version
54-
$API = (Invoke-WebRequest -Uri "https://www.php.net/releases/index.php?json&version=8.3") | ConvertFrom-Json
54+
$API = (Invoke-WebRequest -Uri "https://www.php.net/releases/index.php?json&version=8.4") | ConvertFrom-Json
5555

5656
# php windows download
5757
$PHPRuntimeUrl = "https://windows.php.net/downloads/releases/php-" + $API.version + "-nts-Win32-vs16-x64.zip"

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}
1010
],
1111
"require": {
12-
"php": ">= 8.1",
12+
"php": "~8.4.0",
1313
"ext-mbstring": "*",
1414
"ext-zlib": "*",
1515
"laravel/prompts": "^0.1.12",
@@ -19,7 +19,7 @@
1919
"require-dev": {
2020
"captainhook/captainhook-phar": "^5.23",
2121
"captainhook/hook-installer": "^1.0",
22-
"friendsofphp/php-cs-fixer": "^3.25",
22+
"friendsofphp/php-cs-fixer": "^3.60",
2323
"humbug/box": "^4.5.0 || ^4.6.0",
2424
"nunomaduro/collision": "^7.8",
2525
"phpstan/phpstan": "^1.10",
@@ -44,7 +44,7 @@
4444
],
4545
"scripts": {
4646
"analyse": "phpstan analyse --memory-limit 300M",
47-
"cs-fix": "php-cs-fixer fix",
47+
"cs-fix": "PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix",
4848
"test": "vendor/bin/phpunit tests/ --no-coverage",
4949
"build:phar": "vendor/bin/box compile"
5050
},

0 commit comments

Comments
 (0)