| 3 Oct 2022 |
Pol |  Download image.png | 17:54:37 |
ramsey | it would still be mutating the state of the machine when it creates the bytes in applyVersionandVariant() | 17:54:44 |
Pol | mmh | 17:54:50 |
ramsey | You'd have to create the bytes outside the class and then pass them into the class in order to keep the class immutable | 17:55:25 |
Pol | True. | 17:55:36 |
Pol | You have to leave it to the user | 17:55:44 |
ramsey | but that's a cumbersome API, so I'll just not put @psalm-immutable on the class 🙂 | 17:55:52 |
Pol | True. | 17:55:58 |
Pol | And doing this? | 17:57:02 |
Pol |  Download image.png | 17:57:03 |
Pol | But that is not what you want right? | 17:57:42 |
Pol | (you told me on Twitter) | 17:57:48 |
ramsey | it's the same problem... because the class calls random_bytes() either directly or indirectly, it is mutating the machine's state | 17:58:30 |
Pol | Doah. Right. | 17:58:38 |
| 4 Oct 2022 |
Jan Tojnar | I wonder if we could make the flake update action trigger on the channel advancement | 20:28:54 |
Pol | That would be an amazing improvement | 20:36:49 |
Pol | So we can get rid of the cronjob | 20:36:59 |
Pol | I've already looked for that | 20:37:09 |
Pol | I haven't found anything | 20:37:12 |
Pol | Let me know if you have found something, I'm highly interested | 20:38:51 |
| 12 Oct 2022 |
Jan Tojnar | gah, I am having a weird issue where DOMDocument, where loadHTML does not do anything, with no errors reported. But only when running the script from Apache, it works completely fine on CLI with the same PHP derivation and php.ini. Tried both 8.0 and 8.1. | 13:20:47 |
Jan Tojnar | The following script, in case someone wants to try to reproduce it:
<?php
// phpinfo();
// die;
var_dump(libxml_use_internal_errors(true));
$domDocument = new \DOMDocument();
$html = <<<HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Test</title>
</head>
<body>
Test.
</body>
</html>
HTML;
$domDocument->loadHTML($html);
var_dump($domDocument->textContent);
var_dump(libxml_get_errors());
| 13:23:40 |
Pol | trying | 19:58:38 |
Pol | When it comes to DomDocument, I use this construction: https://github.com/ecphp/cas-lib/blob/master/src/Utils/Response.php#L63 | 20:00:31 |
Pol | Maybe you should try and see if it fails | 20:00:41 |
Jan Tojnar | Pol: should not the restore_error_handler(); be in a finally block, or otherwise it will never run? | 21:04:14 |
Jan Tojnar | * Pol: should not the restore_error_handler(); be in a finally block, or otherwise it will never run? | 21:04:19 |
Pol | Good question, will check tomorrow, I left the pc | 21:06:05 |
Jan Tojnar | I had to introduce a similar fix in https://github.com/ddeboer/transcoder/pull/5 | 21:06:18 |
Pol | I remember I got inspired by symfony. | 21:07:20 |