!jngDrdMgndWibPCYsR:nixos.org

Nix PHP

81 Members
A room for PHP developers running on Nix23 Servers

Load older messages


SenderMessageTime
3 Oct 2022
@drupol:matrix.orgPolimage.png
Download image.png
17:54:37
@ramsey:matrix.orgramsey it would still be mutating the state of the machine when it creates the bytes in applyVersionandVariant() 17:54:44
@drupol:matrix.orgPolmmh17:54:50
@ramsey:matrix.orgramseyYou'd have to create the bytes outside the class and then pass them into the class in order to keep the class immutable17:55:25
@drupol:matrix.orgPolTrue.17:55:36
@drupol:matrix.orgPolYou have to leave it to the user17:55:44
@ramsey:matrix.orgramsey but that's a cumbersome API, so I'll just not put @psalm-immutable on the class 🙂 17:55:52
@drupol:matrix.orgPolTrue.17:55:58
@drupol:matrix.orgPolAnd doing this?17:57:02
@drupol:matrix.orgPolimage.png
Download image.png
17:57:03
@drupol:matrix.orgPolBut that is not what you want right?17:57:42
@drupol:matrix.orgPol(you told me on Twitter)17:57:48
@ramsey:matrix.orgramsey 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
@drupol:matrix.orgPolDoah. Right.17:58:38
4 Oct 2022
@jtojnar:matrix.orgJan TojnarI wonder if we could make the flake update action trigger on the channel advancement20:28:54
@drupol:matrix.orgPolThat would be an amazing improvement20:36:49
@drupol:matrix.orgPolSo we can get rid of the cronjob20:36:59
@drupol:matrix.orgPolI've already looked for that20:37:09
@drupol:matrix.orgPolI haven't found anything20:37:12
@drupol:matrix.orgPolLet me know if you have found something, I'm highly interested20:38:51
12 Oct 2022
@jtojnar:matrix.orgJan 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
@jtojnar:matrix.orgJan 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
@drupol:matrix.orgPoltrying19:58:38
@drupol:matrix.orgPolWhen it comes to DomDocument, I use this construction: https://github.com/ecphp/cas-lib/blob/master/src/Utils/Response.php#L6320:00:31
@drupol:matrix.orgPolMaybe you should try and see if it fails20:00:41
@jtojnar:matrix.orgJan Tojnar Pol: should not the restore_error_handler(); be in a finally block, or otherwise it will never run? 21:04:14
@jtojnar:matrix.orgJan Tojnar * Pol: should not the restore_error_handler(); be in a finally block, or otherwise it will never run? 21:04:19
@drupol:matrix.orgPolGood question, will check tomorrow, I left the pc21:06:05
@jtojnar:matrix.orgJan TojnarI had to introduce a similar fix in https://github.com/ddeboer/transcoder/pull/521:06:18
@drupol:matrix.orgPolI remember I got inspired by symfony.21:07:20

Show newer messages


Back to Room ListRoom Version: 6