!jngDrdMgndWibPCYsR:nixos.org

Nix PHP

78 Members
A room for PHP developers running on Nix22 Servers

Load older messages


SenderMessageTime
3 Oct 2022
@drupol:matrix.orgPolZTS was used when it was PHP was used mostly with Apache.14:16:32
@drupol:matrix.orgPolNowadays NTS is mostly used, this is the default now.14:17:08
@spacesbot:nixos.devspacesbot - keeps a log of public NixOS channels joined the room.14:25:32
@etu:semi.socialetuI see, so I guess we should just switch over to NTS then? Will it affect Apache usage though?14:55:24
@aanderse:nixos.devaanderse

Will it affect Apache usage though?

yes, httpd can't/shouldn't use threaded php with mod_php

15:43:15
@etu:semi.socialetuYeah, we have to... organize that in some nice way that doesn't get cluttered I guess15:57:06
@etu:semi.socialetuAnd gets cached15:57:12
@drupol:matrix.orgPol ramsey: 17:42:41
@drupol:matrix.orgPolThe message you posted on Twitter the other day, about immutability and stuff17:42:58
@drupol:matrix.orgPol * The message you posted on Twitter the other day, about immutability and PSalm stuff17:43:05
@drupol:matrix.orgPol Was it related to the class RandomNodeService of ramsey/identifier ? 17:43:26
@drupol:matrix.orgPolI guess this is the reason why you didn't do:17:43:36
@drupol:matrix.orgPolimage.png
Download image.png
17:43:39
@ramsey:matrix.orgramseyYes17:45:43
@drupol:matrix.orgPolAh right, so, you can discard my screenshot then :)17:46:02
@ramsey:matrix.orgramseyWell... sort of. It was about using that class within another class that's immutable17:46:03
@drupol:matrix.orgPolOkay17:46:23
@ramsey:matrix.orgramseyIt was about trying to designate the UUID factories as immutable, but I can't do that because I'm using that random service here: https://github.com/ramsey/identifier/blob/cd0fb1c321bf3c3c1fd418a3318f5904b3a8e9c3/src/Uuid/Factory/UuidV4Factory.php#L5217:47:48
@drupol:matrix.orgPolOh... what's the best pattern there?17:49:23
@ramsey:matrix.orgramseyI don't know. It technically mutates the state of the randomizer on the machine, so the class can't be considered immutable17:49:53
@ramsey:matrix.orgramsey So, I removed the @psalm-immutable annotation 🙂 17:50:05
@drupol:matrix.orgPolHaving a look.17:50:40
@drupol:matrix.orgPolIt's weird because no property is being modified.17:51:10
@ramsey:matrix.orgramsey Right, but random_bytes() and random_int() mutate the state of the machine 17:51:32
@ramsey:matrix.orgramseyso, the class performs mutating operations17:51:48
@drupol:matrix.orgPolYeah but you do not modify the class itself, so psalm shouldn't complain IMHO17:52:06
@drupol:matrix.orgPolGoing to make some experimentations :)17:52:17
@ramsey:matrix.orgramseyPsalm complains because an immutable class shouldn't mutate state anywhere (internally or externally)17:52:36
@drupol:matrix.orgPol Maybe you should not create the $bytes variable there, just pass the random service to Binary::applyVersionAndVariant 17:53:58
@drupol:matrix.orgPolSomething like that?17:54:35

Show newer messages


Back to Room ListRoom Version: 6