Commit Graph

1023 Commits

Author SHA1 Message Date
Alliballibaba
512d2f161e Fixes return type 2025-12-28 21:50:35 +01:00
Alliballibaba
1f9da1c716 Adds 'PHPReturnValue'. 2025-12-28 21:46:51 +01:00
Alliballibaba
4c43aaf8f8 Fixes zval memleak. 2025-12-24 16:50:14 +01:00
Alliballibaba
de176f8653 Fixes zval memleak. 2025-12-24 16:49:30 +01:00
Alliballibaba
ff8f864a3d Removes special empty array. 2025-12-23 22:48:12 +01:00
Alliballibaba
fcc9f81986 Merge branch 'main' into perf/optimize-types 2025-12-23 22:17:51 +01:00
Alliballibaba
69320d2ee7 Adds logs. 2025-12-23 22:09:40 +01:00
Alliballibaba
7ceb485dae Prevents refcounting issues. 2025-12-23 22:03:32 +01:00
Marc
19d00a08e2 fix relative paths not being resolved correctly by spc (#2093)
closes #2092
closes #2064
2025-12-23 10:59:06 +01:00
Alliballibaba
f5a9bc3d7a Cleanup. 2025-12-22 23:31:59 +01:00
Alliballibaba
2306152fde Fixes test. 2025-12-22 22:55:03 +01:00
Alliballibaba
a86533a6ac Adds echos for debugging. 2025-12-22 21:34:52 +01:00
Alliballibaba
8bdb3de552 Simplifies zvals. 2025-12-22 21:33:35 +01:00
Alliballibaba
360d15c2aa Merge branch 'main' into perf/optimize-types 2025-12-20 22:29:27 +01:00
Alliballibaba
549cca304a Returns to old implementation. 2025-12-20 11:18:18 +01:00
Alliballibaba
c8c7d046ef pointer arithmetic fix. 2025-12-20 10:56:29 +01:00
Alliballibaba
ecf3f0e792 Formatting and allocation fixes. 2025-12-20 10:47:33 +01:00
Kévin Dunglas
57c58faf1c chore: prepare release 1.11.1 caddy/v1.11.1 v1.11.1 2025-12-20 09:16:23 +01:00
Loric Brevet
25d9cb9600 fix: crash when using the logger outside of the a request context 2025-12-20 09:15:29 +01:00
Alliballibaba
ae97abb897 Simplifies strings. 2025-12-19 23:17:05 +01:00
Alliballibaba
a222fd51cb Properly frees zvals in tests. 2025-12-19 23:01:58 +01:00
Alliballibaba
e2976abbeb Fixes conflicts. 2025-12-19 22:54:47 +01:00
Alliballibaba
a209d227ef Merge branch 'main' into perf/optimize-types
# Conflicts:
#	types.c
#	types.go
#	types.h
#	types_test.go
2025-12-19 22:31:52 +01:00
Kévin Dunglas
4092ecb5b5 fix: frankenphp_log() level parameter must be optional 2025-12-19 16:25:32 +01:00
Kévin Dunglas
75ccccf1b2 fix(caddy): use default patterns when hot_reload is alone 2025-12-19 09:38:05 +01:00
Kévin Dunglas
6231bf4a1c chore: prepare release 1.11.0 caddy/v1.11.0 v1.11.0 2025-12-18 16:51:41 +01:00
Kévin Dunglas
e01e40fd97 chore: bump deps (#2078) 2025-12-17 11:47:14 +01:00
Alexander Stecher
175e644d10 feat: multiple curly braces for watcher (#2068)
Allows doing something like this:

```caddyfile
watch "/app/{config,src}/*.{php,js}"
```

In the long term it would be nice to have pattern matching in the
watcher repo itself
2025-12-17 00:22:28 +01:00
Kévin Dunglas
a8f75d0eef ci: verbose logs for StaticPHP (#2074) 2025-12-15 20:13:15 +01:00
Raphael Coeffic
91c553f3d9 feat: add support for structured logging with the frankenphp_log() PHP function (#1979)
As discussed in https://github.com/php/frankenphp/discussions/1961,
there is no real way to pass a severity/level to any log handler offered
by PHP that would make it to the FrankenPHP layer. This new function
allows applications embedding FrankenPHP to integrate PHP logging into
the application itself, thus offering a more streamlined experience.

---------

Co-authored-by: Quentin Burgess <qutn.burgess@gmail.com>
Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
2025-12-15 16:10:35 +01:00
Alexandre Daubois
7fca07ed67 feat(types): expose IsPacked to help dealing with hashmaps and lists in Go code 2025-12-15 15:35:21 +01:00
dependabot[bot]
3599299cde 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.10.1 to 1.10.2
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.10.1...v1.10.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 13:41:56 +01:00
Alexandre Daubois
bb1c3678dc feat(extgen): add support for callable in parameters (#1731) 2025-12-15 12:50:50 +01:00
dependabot[bot]
58a63703b4 ci: bump actions/checkout from 5 to 6 in the github-actions group
Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout).


Updates `actions/checkout` from 5 to 6
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  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-12-15 12:23:53 +01:00
Alexandre Daubois
694ab86cef doc(runtime): mention Symfony 7.4 native support for worker mode (#1668)
Fixes https://github.com/symfony/symfony-docs/issues/21099, related to
https://github.com/symfony/symfony/pull/60503
2025-12-14 17:06:28 +01:00
Alliballibaba
5e139519a3 Removes benchmarks. 2025-12-13 20:42:42 +01:00
Alliballibaba
bcee843017 Removes benchmarks. 2025-12-13 20:39:40 +01:00
Alliballibaba
703d037ef7 Merge branch 'main' into perf/optimize-types
# Conflicts:
#	types.c
#	types.go
#	types.h
#	types_test.go
2025-12-13 20:34:05 +01:00
Marc
e23e0c571e update config doc for new deb/rpm packages (#2071) 2025-12-13 19:32:27 +01:00
Kévin Dunglas
f02e6f2f85 fix: update mercure_publish() to use the new GoPackedArray() API 2025-12-13 19:30:22 +01:00
Alexander Stecher
11213fd1de fix: returns a zend_array directly in types.go (#1894) 2025-12-12 22:55:58 +01:00
Alexandre Daubois
41da660088 fix(hot-reload): fix import (#2069) 2025-12-12 15:23:55 +01:00
Alexandre Daubois
599c92b15d tests(extgen): add integration tests (#1984)
Fix #1975
2025-12-12 14:32:00 +01:00
Alliballibaba
af328a3166 Merge branch 'main' into perf/optimize-types
# Conflicts:
#	internal/extgen/templates/extension.c.tpl
2025-12-12 14:29:41 +01:00
Kévin Dunglas
225ca409d3 feat: hot reload (#2031)
This patch brings hot reloading capabilities to PHP apps: in
development, the browser will automatically refresh the page when any
source file changes!
It's similar to HMR in JavaScript.

It is built on top of [the watcher
mechanism](https://frankenphp.dev/docs/config/#watching-for-file-changes)
and of the [Mercure](https://frankenphp.dev/docs/mercure/) integration.

Each time a watched file is modified, a Mercure update is sent, giving
the ability to the client to reload the page, or part of the page
(assets, images...).

Here is an example implementation:

```caddyfile
root ./public


mercure {
      subscriber_jwt {env.MERCURE_SUBSCRIBER_JWT_KEY}
      anonymous
}

php_server {
      hot_reload
}
```

```php
<?php
header('Content-Type: text/html');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Test</title>
<script>
    const es = new EventSource('<?=$_SERVER['FRANKENPHP_HOT_RELOAD']?>');
    es.onmessage = () => location.reload();
</script>
</head>
<body>
Hello
```

I plan to create a helper JS library to handle more advanced cases
(reloading CSS, JS, etc), similar to [HotWire
Spark](https://github.com/hotwired/spark). Be sure to attend my
SymfonyCon to learn more!

There is still room for improvement:

- Provide an option to only trigger the update without reloading the
worker for some files (ex, images, JS, CSS...)
- Support classic mode (currently, only the worker mode is supported)
- Don't reload all workers when only the files used by one change

However, this PR is working as-is and can be merged as a first step.

This patch heavily refactors the watcher module. Maybe it will be
possible to extract it as a standalone library at some point (would be
useful to add a similar feature but not tight to PHP as a Caddy module).

---------

Signed-off-by: Kévin Dunglas <kevin@dunglas.fr>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-12 14:29:18 +01:00
Francis Lavoie
d2007620a4 docs: Fix file extension in FrankenPHP configuration (#2067)
Corrected the file extension for additional configuration files in
FrankenPHP section.

---------

Signed-off-by: Francis Lavoie <lavofr@gmail.com>
2025-12-11 21:40:34 +01:00
Kévin Dunglas
4ac024a1d0 fix: remove deprecated Mercure "transport_url" directive from Caddyfile 2025-12-10 15:40:21 +01:00
Kacper Rowiński
e0dcf42852 chore: bump github.com/smallstep/certificates/ from 0.28.4 to 0.29.0 2025-12-09 11:40:58 +01:00
Arkeins
7b8cf6b127 docs: wrong config path for autoloaded .caddyfile (#2059)
Hi !

I am playing with FrankenPHP, and frankly new to the thing so I may be
wrong.

The [current documentation](https://frankenphp.dev/docs/config/#docker)
mention that :

> /etc/frankenphp/caddy.d/*.caddy: additional configuration files that
are loaded automatically

But in the main Caddyfile ([here on
GitHub](https://github.com/php/frankenphp/blob/main/caddy/frankenphp/Caddyfile#L59))
imports differently:

```ini
import Caddyfile.d/*.caddyfile
```

This PR aims to correct this :)

Thank you for your time !

Signed-off-by: Arkeins <7311955+Arkeins@users.noreply.github.com>
2025-12-03 18:20:09 +01:00
Alexander Stecher
98573ed7c0 refactor: extract the state module and make the backoff error instead of panic
This PR:
- moves state.go to its own module
- moves the phpheaders test the phpheaders module
- simplifies backoff.go
- makes the backoff error instead of panic (so it can be tested)
- removes some unused C structs
2025-12-02 23:10:12 +01:00