Commit Graph

892 Commits

Author SHA1 Message Date
Marc
bf4c9fe986 fix test typo (#1964)
* Fix typo in TestFlushEmptyResponse_worker function

* Fix test function name for flush empty response
2025-11-08 08:28:56 +01:00
Marc
b22bdd987b update docs to remove old references to frankenphp:static-builder (#1950)
* update docs to remove old references to frankenphp:static-builder (we have -musl and -gnu)

* remove --platform and make gnu default

* add --platform back in (let dunglas decide)

* fix missed translations
2025-11-07 10:27:37 +01:00
Alexandre Daubois
28d17b39dc chore: bump GitHub Action deps (#1957) 2025-11-04 08:52:23 +01:00
Marc
264f92835d bring back logic for workers to inherit php_server parent environment (#1956)
* bring back logic to inherit php_server parent environment

* change order to account for

php {
    worker file.php 1 {

    }
}
cases

* suggestion

* add inherit env test
2025-11-02 14:50:50 +01:00
Alexandre Daubois
b49aed1934 chore: bump deps 2025-10-31 16:51:26 +01:00
Kévin Dunglas
4d0fb7d0f8 refactor: simplify Init() 2025-10-29 23:14:46 +01:00
Marc
5447a7a6c8 add compile from sources fallback to unsupported OS message (#1939)
* add compile from sources fallback to unsupported OS message

* rewrite message to indicate general support, but no precompiled binaries

* add logs to build-static
2025-10-29 19:25:51 +01:00
Alexander Stecher
1270784cd3 suggestion: external worker api (#1928)
* Cleaner request apis.
2025-10-29 11:36:33 +01:00
Kévin Dunglas
9b8d215727 refactor: improve Worker public API and docs 2025-10-29 11:36:33 +01:00
Alexandre Daubois
94e58eb215 fix: replace file_put_contents() by file_get_contents() in Mercure docs 2025-10-28 15:00:43 +01:00
Alexander Stecher
bf6e6534f6 fix: exit() and dd() support in worker mode (#1946)
* Verifies exit behavior.

* formatting

* Checks for actual exit.

* Fixes test.

* Fixes test.

* Update testdata/dd.php

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

---------

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
2025-10-28 10:57:50 +01:00
Michal Kleiner
fb1f46808e fix: typo in method name in example usage (#1935) 2025-10-22 09:14:36 +02:00
Florent Drousset
7f64673495 Fix small typo (#1934) 2025-10-21 17:50:00 +02:00
Kévin Dunglas
f7756717b5 feat: allow creating strongly typed slices and maps from PHP values with type utilities (#1933)
* feat: use generics in type functions for better type support

* various improvements

* better docs

* update docs
2025-10-21 11:20:54 +02:00
Damien Calesse
9aee496b96 Add patchelf installation in static-gnu Dockerfile (#1899)
* Add patchelf installation in static-gnu Dockerfile

* reduce static-builder-gnu.Dockerfile layers

---------

Co-authored-by: henderkes <m@pyc.ac>
2025-10-20 18:08:40 +02:00
Alexander Stecher
45823c51b2 fix: catches panic on invalid status code (#1920) 2025-10-16 11:35:35 +02:00
Kévin Dunglas
f8ea48c3b1 chore(caddy): better error handling 2025-10-15 11:12:34 +02:00
Laury S.
1fbd619597 fix: remove BOM on config fr doc file (#1924) 2025-10-14 17:50:51 +02:00
Kévin Dunglas
d52ce94341 docs: improve Mercure documentation and various other parts 2025-10-14 14:32:38 +02:00
Kévin Dunglas
b749f52ae5 chore: simplify string using backticks
# Conflicts:
#	internal/extgen/classparser.go
#	internal/extgen/gofile_test.go
2025-10-14 14:09:17 +02:00
Kévin Dunglas
e917ab7974 fix: callback parameters handling in worker extensions 2025-10-09 15:42:29 +02:00
Kévin Dunglas
5514491a18 feat(extgen): support for mixed type (#1913)
* feat(extgent): support for mixed type

* refactor: use unsafe.Pointer

* Revert "refactor: use unsafe.Pointer"

This reverts commit 8a0b9c1beb.

* fix docs

* fix docs

* cleanup template

* fix template

* fix tests
2025-10-09 14:10:45 +02:00
Kévin Dunglas
c42d287138 refactor: extension worker (#1910)
* refactor: extension worker

* feat: optional HTTP request

* allow passing unsafe.Pointer to the extension callback

* lint

* simplify
2025-10-09 14:10:09 +02:00
SpencerMalone
1f6f768c97 fix: release but don't free CLI streams when executing cli scripts (#1906)
* Bring upstream commit 0a4a55fd44 into cli_register_file_handles to release but not free stdout/in/err.

Fixes being unable to log to stdout or error after using frankenphp.ExecutePHPCode

* chore: clang-format

---------

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
2025-10-08 17:07:54 +02:00
Kévin Dunglas
a4596b7767 ci: fix Biome linter issue (#1911) 2025-10-08 08:38:00 +02:00
Rob Landers
fa3a7032a4 refactor: make Worker an embeddable struct (#1884)
* make WorkerExtension embeddable

Signed-off-by: Robert Landers <landers.robert@gmail.com>

* change names

Signed-off-by: Robert Landers <landers.robert@gmail.com>

---------

Signed-off-by: Robert Landers <landers.robert@gmail.com>
2025-10-07 16:56:56 +02:00
Filippo Tessarotto
ab1ec71d24 docs(worker): Prefer try-catch over set_exception_handler (#1897) 2025-10-06 09:01:49 +02:00
dependabot[bot]
219a5407ff chore: bump the go-modules group with 2 updates (#1903) 2025-09-29 17:56:28 +02:00
Marc
76511c2e19 fix(packages): frankenphp trust failing because admin API isn't started #1846 (#1870) 2025-09-27 15:50:29 +02:00
Alexandre Daubois
7668a27d4b chore: bump /caddy sub-group deps (#1863) 2025-09-23 10:26:13 +02:00
Artur Melanchyk
e4c1801c25 fix: added missing decrement for the "ready" WaitGroup counter (#1890)
Co-authored-by: Artur Melanchyk <13834276+arturmelanchyk@users.noreply.github.com>
2025-09-22 19:57:01 +02:00
Rob Landers
52df300f86 feat: custom workers initial support (#1795)
* create a simple thread framework

Signed-off-by: Robert Landers <landers.robert@gmail.com>

* add tests

Signed-off-by: Robert Landers <landers.robert@gmail.com>

* fix comment

Signed-off-by: Robert Landers <landers.robert@gmail.com>

* remove mention of an old function that no longer exists

Signed-off-by: Robert Landers <landers.robert@gmail.com>

* simplify providing a request

Signed-off-by: Robert Landers <landers.robert@gmail.com>

* satisfy linter

Signed-off-by: Robert Landers <landers.robert@gmail.com>

* add error handling and handle shutdowns

Signed-off-by: Robert Landers <landers.robert@gmail.com>

* add tests

Signed-off-by: Robert Landers <landers.robert@gmail.com>

* pipes are tied to workers, not threads

Signed-off-by: Robert Landers <landers.robert@gmail.com>

* fix test

Signed-off-by: Robert Landers <landers.robert@gmail.com>

* add a way to detect when a request is completed

Signed-off-by: Robert Landers <landers.robert@gmail.com>

* we never shutdown workers or remove them, so we do not need this

Signed-off-by: Robert Landers <landers.robert@gmail.com>

* add more comments

Signed-off-by: Robert Landers <landers.robert@gmail.com>

* Simplify modular threads (#1874)

* Simplify

* remove unused variable

* log thread index

* feat: allow passing parameters to the PHP callback and accessing its return value (#1881)

* fix formatting

Signed-off-by: Robert Landers <landers.robert@gmail.com>

* fix test compilation

Signed-off-by: Robert Landers <landers.robert@gmail.com>

* fix segfaults

Signed-off-by: Robert Landers <landers.robert@gmail.com>

* Update frankenphp.c

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

---------

Signed-off-by: Robert Landers <landers.robert@gmail.com>
Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
2025-09-18 09:21:49 +02:00
Florent Drousset
fe7aa2cae4 docs: fix small typo in x-sendfile.md (#1882)
Just fixing a small typo (double "à") that I've seen in the doc.
2025-09-16 20:02:43 +02:00
Kévin Dunglas
7754abcbd0 fix: PHPValue() and GoValue() types (#1879)
* fix: PHPValue() return type

* fix: GoValue() argument type
2025-09-15 17:04:06 +02:00
Kévin Dunglas
52a0be5728 feat(ext): expose GoValue() and PHPValue() functions (#1877)
* feat(ext): expose a GoValue function

* GoValue()
2025-09-15 16:25:11 +02:00
Alexander Stecher
960dd209f7 feat: multiple workers with same file (#1856)
* Allow multiple workers with the same file.

* Fix formatting of duplicate filename check

* Adds docs.

* suggestions by @alexandre-daubois.

* Update performance.md

---------

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
2025-09-09 14:27:00 +02:00
Youenn Le Gouedec
984f0a0211 docs: replace GEN_STUB_FILE by GEN_STUB_SCRIPT (#1849) 2025-09-08 14:13:16 +02:00
dependabot[bot]
86a2d27c01 ci: bump actions/setup-go from 5 to 6 in the github-actions group
Bumps the github-actions group with 1 update: [actions/setup-go](https://github.com/actions/setup-go).


Updates `actions/setup-go` from 5 to 6
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 13:58:05 +02:00
dependabot[bot]
0f942c8601 chore(caddy): bump github.com/spf13/cobra
Bumps the go-modules group in /caddy with 1 update: [github.com/spf13/cobra](https://github.com/spf13/cobra).


Updates `github.com/spf13/cobra` from 1.9.1 to 1.10.0
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.9.1...v1.10.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-version: 1.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-01 23:36:48 +02:00
dependabot[bot]
8c501a8d98 ci: bump actions/attest-build-provenance in the github-actions group (#1852) 2025-09-01 23:10:01 +02:00
Adiel Cristo
c564c3ffb9 fix: minor docs fixes 2025-08-29 12:46:40 +02:00
Adiel Cristo
6ab8350561 feat: translate file docs/extensions.md (#1843) 2025-08-29 09:17:49 +02:00
Kévin Dunglas
ad86bf49c2 chore: prepare release 1.9.1 caddy/v1.9.1 v1.9.1 2025-08-28 19:18:41 +02:00
Kévin Dunglas
1030e4ceb4 ci: fix issues and lint with zizmor 2025-08-28 19:16:32 +02:00
Kévin Dunglas
460d63e436 chore: bump deps and check go.mod files are clean in CI 2025-08-28 19:16:01 +02:00
Alexander Stecher
78bc5c87d8 fix: free request context if php_request_startup() errors (#1842) 2025-08-28 17:29:10 +02:00
Alexandre Daubois
99bb87167e chore: bump deps 2025-08-27 15:56:40 +02:00
Alexandre Daubois
c14d771fdf feat(docker): add support for Debian Trixie (#1777)
* ci: add support for Debian Trixie

* nit

* add Trixie to bug_report.yaml

---------

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
2025-08-27 08:32:05 +02:00
Alexander Stecher
952754db27 fix: don't flush env between requests (#1814) 2025-08-27 08:30:40 +02:00
Marc
9b851bf53e fix: add WorkingDirectory to ReadHat service file to make mercure.db files work without absolute paths (#1835)
* add WorkingDirectory to make mercure.db files work without absolut paths

* make linter happy
2025-08-26 16:39:02 +02:00