Skip to content

Commit fc77310

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/opcache-safe-reset
2 parents 30407d7 + ebbc4e2 commit fc77310

39 files changed

Lines changed: 1322 additions & 378 deletions

.github/workflows/docker.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
fetch-depth: 0
5858
persist-credentials: false
5959
- name: Set up Docker Buildx
60-
uses: docker/setup-buildx-action@v3
60+
uses: docker/setup-buildx-action@v4
6161
- name: Check PHP versions and base image fingerprint
6262
id: check
6363
env:
@@ -122,18 +122,18 @@ jobs:
122122
ref: ${{ needs.prepare.outputs.ref }}
123123
persist-credentials: false
124124
- name: Set up Docker Buildx
125-
uses: docker/setup-buildx-action@v3
125+
uses: docker/setup-buildx-action@v4
126126
with:
127127
platforms: ${{ matrix.platform }}
128128
- name: Login to DockerHub
129-
uses: docker/login-action@v3
129+
uses: docker/login-action@v4
130130
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
131131
with:
132132
username: ${{ secrets.REGISTRY_USERNAME }}
133133
password: ${{ secrets.REGISTRY_PASSWORD }}
134134
- name: Build
135135
id: build
136-
uses: docker/bake-action@v6
136+
uses: docker/bake-action@v7
137137
with:
138138
pull: true
139139
load: ${{ !fromJson(needs.prepare.outputs.push) }}
@@ -222,9 +222,9 @@ jobs:
222222
path: /tmp/metadata
223223
merge-multiple: true
224224
- name: Set up Docker Buildx
225-
uses: docker/setup-buildx-action@v3
225+
uses: docker/setup-buildx-action@v4
226226
- name: Login to DockerHub
227-
uses: docker/login-action@v3
227+
uses: docker/login-action@v4
228228
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
229229
with:
230230
username: ${{ secrets.REGISTRY_USERNAME }}

.github/workflows/static.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
ref: ${{ steps.check.outputs.ref }}
6969
persist-credentials: false
7070
- name: Set up Docker Buildx
71-
uses: docker/setup-buildx-action@v3
71+
uses: docker/setup-buildx-action@v4
7272
- name: Create platforms matrix
7373
id: matrix
7474
run: |
@@ -114,11 +114,11 @@ jobs:
114114
ref: ${{ needs.prepare.outputs.ref }}
115115
persist-credentials: false
116116
- name: Set up Docker Buildx
117-
uses: docker/setup-buildx-action@v3
117+
uses: docker/setup-buildx-action@v4
118118
with:
119119
platforms: ${{ matrix.platform }}
120120
- name: Login to DockerHub
121-
uses: docker/login-action@v3
121+
uses: docker/login-action@v4
122122
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
123123
with:
124124
username: ${{ secrets.REGISTRY_USERNAME }}
@@ -138,7 +138,7 @@ jobs:
138138
REF: ${{ needs.prepare.outputs.ref }}
139139
- name: Build
140140
id: build
141-
uses: docker/bake-action@v6
141+
uses: docker/bake-action@v7
142142
with:
143143
pull: true
144144
load: ${{ !fromJson(needs.prepare.outputs.push) || matrix.debug || matrix.mimalloc }}
@@ -282,18 +282,18 @@ jobs:
282282
env:
283283
REF: ${{ needs.prepare.outputs.ref }}
284284
- name: Set up Docker Buildx
285-
uses: docker/setup-buildx-action@v3
285+
uses: docker/setup-buildx-action@v4
286286
with:
287287
platforms: ${{ matrix.platform }}
288288
- name: Login to DockerHub
289-
uses: docker/login-action@v3
289+
uses: docker/login-action@v4
290290
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
291291
with:
292292
username: ${{ secrets.REGISTRY_USERNAME }}
293293
password: ${{ secrets.REGISTRY_PASSWORD }}
294294
- name: Build
295295
id: build
296-
uses: docker/bake-action@v6
296+
uses: docker/bake-action@v7
297297
with:
298298
pull: true
299299
load: ${{ !fromJson(needs.prepare.outputs.push) }}
@@ -397,9 +397,9 @@ jobs:
397397
path: /tmp/metadata-gnu
398398
merge-multiple: true
399399
- name: Set up Docker Buildx
400-
uses: docker/setup-buildx-action@v3
400+
uses: docker/setup-buildx-action@v4
401401
- name: Login to DockerHub
402-
uses: docker/login-action@v3
402+
uses: docker/login-action@v4
403403
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
404404
with:
405405
username: ${{ secrets.REGISTRY_USERNAME }}

.github/workflows/windows.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ jobs:
229229
$env:PHPRC = Get-Location
230230
231231
go test -race ./...
232+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
232233
cd caddy
233234
go test -race ./...
235+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
234236
working-directory: ${{ github.workspace }}\frankenphp

.github/workflows/wrap-issue-details.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
permissions:
1313
issues: write
1414
steps:
15-
- uses: actions/github-script@v7
15+
- uses: actions/github-script@v8
1616
with:
1717
script: |
1818
const body = context.payload.issue.body;

CONTRIBUTING.md

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -90,60 +90,60 @@ curl -v http://127.0.0.1:8080/phpinfo.php
9090

9191
1. Configure Git to always use `lf` line endings
9292

93-
```powershell
94-
git config --global core.autocrlf false
95-
git config --global core.eol lf
96-
```
93+
```powershell
94+
git config --global core.autocrlf false
95+
git config --global core.eol lf
96+
```
9797

9898
2. Install Visual Studio, Git, and Go:
9999

100-
```powershell
101-
winget install -e --id Microsoft.VisualStudio.2022.Community --override "--passive --wait --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.Llvm.Clang --includeRecommended"
102-
winget install -e --id GoLang.Go
103-
winget install -e --id Git.Git
104-
```
100+
```powershell
101+
winget install -e --id Microsoft.VisualStudio.2022.Community --override "--passive --wait --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.Llvm.Clang --includeRecommended"
102+
winget install -e --id GoLang.Go
103+
winget install -e --id Git.Git
104+
```
105105

106106
3. Install vcpkg:
107107

108-
```powershell
109-
cd C:\
110-
git clone https://github.com/microsoft/vcpkg
111-
.\vcpkg\bootstrap-vcpkg.bat
112-
```
108+
```powershell
109+
cd C:\
110+
git clone https://github.com/microsoft/vcpkg
111+
.\vcpkg\bootstrap-vcpkg.bat
112+
```
113113

114114
4. [Download the latest version of the watcher library for Windows](https://github.com/e-dant/watcher/releases) and extract it to a directory named `C:\watcher`
115115
5. [Download the latest **Thread Safe** version of PHP and of the PHP SDK for Windows](https://windows.php.net/download/), extract them in directories named `C:\php` and `C:\php-devel`
116116
6. Clone the FrankenPHP Git repository:
117117

118-
```powershell
119-
git clone https://github.com/php/frankenphp C:\frankenphp
120-
cd C:\frankenphp
121-
```
118+
```powershell
119+
git clone https://github.com/php/frankenphp C:\frankenphp
120+
cd C:\frankenphp
121+
```
122122

123123
7. Install the dependencies:
124124

125-
```powershell
126-
C:\vcpkg\vcpkg.exe install
127-
```
125+
```powershell
126+
C:\vcpkg\vcpkg.exe install
127+
```
128128

129129
8. Configure the needed environment variables (PowerShell):
130130

131-
```powershell
132-
$env:PATH += ';C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\bin'
133-
$env:CC = 'clang'
134-
$env:CXX = 'clang++'
135-
$env:CGO_CFLAGS = "-O0 -g -IC:\frankenphp\vcpkg_installed\x64-windows\include -IC:\watcher -IC:\php-devel\include -IC:\php-devel\include\main -IC:\php-devel\include\TSRM -IC:\php-devel\include\Zend -IC:\php-devel\include\ext"
136-
$env:CGO_LDFLAGS = '-LC:\frankenphp\vcpkg_installed\x64-windows\lib -lbrotlienc -LC:\watcher -llibwatcher-c -LC:\php -LC:\php-devel\lib -lphp8ts -lphp8embed'
137-
```
131+
```powershell
132+
$env:PATH += ';C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\bin'
133+
$env:CC = 'clang'
134+
$env:CXX = 'clang++'
135+
$env:CGO_CFLAGS = "-O0 -g -IC:\frankenphp\vcpkg_installed\x64-windows\include -IC:\watcher -IC:\php-devel\include -IC:\php-devel\include\main -IC:\php-devel\include\TSRM -IC:\php-devel\include\Zend -IC:\php-devel\include\ext"
136+
$env:CGO_LDFLAGS = '-LC:\frankenphp\vcpkg_installed\x64-windows\lib -lbrotlienc -LC:\watcher -llibwatcher-c -LC:\php -LC:\php-devel\lib -lphp8ts -lphp8embed'
137+
```
138138

139139
9. Run the tests:
140140

141-
```powershell
142-
go test -race -ldflags '-extldflags="-fuse-ld=lld"' ./...
143-
cd caddy
144-
go test -race -ldflags '-extldflags="-fuse-ld=lld"' -tags nobadger,nomysql,nopgx ./...
145-
cd ..
146-
```
141+
```powershell
142+
go test -race -ldflags '-extldflags="-fuse-ld=lld"' ./...
143+
cd caddy
144+
go test -race -ldflags '-extldflags="-fuse-ld=lld"' -tags nobadger,nomysql,nopgx ./...
145+
cd ..
146+
```
147147

148148
10. Build the binary:
149149

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ Our maintainers offer apk packages for all systems using `apk`. To install, run:
9090
VERSION=85 # 82-85 available
9191
echo "https://pkg.henderkes.com/api/packages/${VERSION}/alpine/main/php-zts" | sudo tee -a /etc/apk/repositories
9292
KEYFILE=$(curl -sJOw '%{filename_effective}' https://pkg.henderkes.com/api/packages/${VERSION}/alpine/key)
93-
sudo mv ${KEYFILE} /etc/apk/keys/ &&
94-
sudo apk update &&
93+
sudo mv ${KEYFILE} /etc/apk/keys/ &&
94+
sudo apk update &&
9595
sudo apk add frankenphp
9696
```
9797

@@ -170,6 +170,7 @@ Go to `https://localhost`, and enjoy!
170170
- [Compile from sources](https://frankenphp.dev/docs/compile/)
171171
- [Monitoring FrankenPHP](https://frankenphp.dev/docs/metrics/)
172172
- [WordPress integration](https://frankenphp.dev/docs/wordpress/)
173+
- [Symfony integration](https://frankenphp.dev/docs/symfony/)
173174
- [Laravel integration](https://frankenphp.dev/docs/laravel/)
174175
- [Known issues](https://frankenphp.dev/docs/known-issues/)
175176
- [Demo app (Symfony) and benchmarks](https://github.com/dunglas/frankenphp-demo)
@@ -178,7 +179,7 @@ Go to `https://localhost`, and enjoy!
178179

179180
## Examples and Skeletons
180181

181-
- [Symfony](https://github.com/dunglas/symfony-docker)
182+
- [Symfony](https://frankenphp.dev/docs/symfony/)
182183
- [API Platform](https://api-platform.com/docs/symfony)
183184
- [Laravel](https://frankenphp.dev/docs/laravel/)
184185
- [Sulu](https://sulu.io/blog/running-sulu-with-frankenphp)

caddy/admin_test.go

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,46 @@ func TestShowTheCorrectThreadDebugStatus(t *testing.T) {
8282
assert.Len(t, debugState.ThreadDebugStates, 3)
8383
}
8484

85+
func TestThreadDebugStateMetricsAfterRequests(t *testing.T) {
86+
tester := caddytest.NewTester(t)
87+
tester.InitServer(`
88+
{
89+
skip_install_trust
90+
admin localhost:2999
91+
http_port `+testPort+`
92+
93+
frankenphp {
94+
num_threads 2
95+
worker ../testdata/worker-with-counter.php 1
96+
}
97+
}
98+
99+
localhost:`+testPort+` {
100+
route {
101+
root ../testdata
102+
rewrite worker-with-counter.php
103+
php
104+
}
105+
}
106+
`, "caddyfile")
107+
108+
// make a few requests so counters are populated
109+
tester.AssertGetResponse("http://localhost:"+testPort+"/", http.StatusOK, "requests:1")
110+
tester.AssertGetResponse("http://localhost:"+testPort+"/", http.StatusOK, "requests:2")
111+
tester.AssertGetResponse("http://localhost:"+testPort+"/", http.StatusOK, "requests:3")
112+
113+
debugState := getDebugState(t, tester)
114+
115+
hasRequestCount := false
116+
for _, ts := range debugState.ThreadDebugStates {
117+
if ts.RequestCount > 0 {
118+
hasRequestCount = true
119+
assert.Greater(t, ts.MemoryUsage, int64(0), "thread %d (%s) should report memory usage", ts.Index, ts.Name)
120+
}
121+
}
122+
assert.True(t, hasRequestCount, "at least one thread should have RequestCount > 0 after serving requests")
123+
}
124+
85125
func TestAutoScaleWorkerThreads(t *testing.T) {
86126
wg := sync.WaitGroup{}
87127
maxTries := 10

0 commit comments

Comments
 (0)