You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+9-3Lines changed: 9 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,21 @@ The format is based on [Keep a Changelog(https://keepachangelog.com/en/1.0.0/),
5
5
and this project adheres to [Semantic Versioning(https://semver.org/spec/v2.0.0.html).
6
6
7
7
## Unreleased
8
+
### Added
9
+
- Add `--timeout` option to the WeasyPrint command-line call by default. This improves consistency with the internal process timeout already applied by Symfony Process. If you're running WeasyPrint inside a worker, queue, or other timeout-managed environment, you can disable it using `$pdf->disableTimeout()` or `$pdf->setTimeout(null)`. (#15)
10
+
- Add `disableTimeout()` method to easily disable the new CLI timeout behavior
11
+
12
+
### Security
13
+
- Update `symfony/process` minimal version to mitigate [CVE-2024-51736](https://github.com/advisories/GHSA-qq5c-677p-737q)
8
14
9
15
## 1.5.0 - 2024-11-04
10
16
### Added
11
17
- Support WeasyPrint 63.0 new `srgb` option
12
-
-Added support for PHP 8.4
18
+
-Add support for PHP 8.4
13
19
14
20
## 1.4.0 - 2023-11-20
15
21
### Changed
16
-
-Added support for Symfony 7.0 and PHP 8.3
22
+
-Add support for Symfony 7.0 and PHP 8.3
17
23
18
24
## 1.3.0 - 2023-10-07
19
25
### Added
@@ -39,7 +45,7 @@ and this project adheres to [Semantic Versioning(https://semver.org/spec/v2.0.0.
39
45
40
46
## 1.0.0 - 2023-01-16
41
47
### Fixed
42
-
-Fixed handling of repeatable options (attachment and stylesheet)
48
+
-Fix handling of repeatable options (attachment and stylesheet)
A default timeout of 10 seconds is set for the WeasyPrint process to prevent orphaned or hanging processes.
87
+
This is a defensive measure that applies in most cases and helps ensure system stability.
88
+
89
+
You can change the timeout with the `setTimeout()` method:
90
+
91
+
```php
92
+
$pdf = new Pdf('/usr/local/bin/weasyprint');
93
+
$pdf->setTimeout(30); // 30 seconds
94
+
```
95
+
96
+
The timeout can be disabled entirely using either of the following:
97
+
98
+
```php
99
+
$pdf->setTimeout(null);
100
+
// or
101
+
$pdf->disableTimeout();
102
+
```
103
+
104
+
This is especially useful if you're running inside a *queue worker*, *job runner*, or other environments that already handle timeouts (e.g. Symfony Messenger, Laravel Queue, Supervisor).
105
+
Disabling the internal timeout in those cases avoids conflicts with higher-level timeout strategies.
106
+
107
+
> **Note:**
108
+
> The `setTimeout()` method affects **both**:
109
+
> - how long the process is allowed to run before being forcibly stopped, and
110
+
> - the `--timeout` option passed to the WeasyPrint command-line tool.
111
+
>
112
+
> If you only want to disable WeasyPrint's own timeout (while keeping the execution time limit), use:
113
+
>
114
+
> ```php
115
+
> $pdf->setOption('timeout', null);
116
+
> ```
117
+
84
118
## Differences with Snappy
85
119
86
120
Although PhpWeasyPrint and Snappy are interchangeable, there are a couple of differences between the two, due to WeasyPrint CLI API:
0 commit comments