« first day (4489 days earlier)      last day (444 days later) » 

12:28 AM
x.y only as x would be a better example IMHO in github.com/Danack/RfcCodex/blob/master/etiquette/…
 
anyone wanna play mini golf discord.gg/sgGup45m
 
sounds like fun but too complicated to join for me, giving up.
 
awww
if you join voice, you can join the activity
 
12:53 AM
nah its all the sign-up javacript process
not your fault, just 20th century internet usability.
 
gotcha
 
1:14 AM
is it web based or need a download?
 
just inside discord
it's a game within discord
I don't think it needs an extra download
 
1:55 AM
Recommendation question, if that's OK. I'm creating a small web app, one that mainly I will use, but that uses a MySQL database with a PHP backend and an HTML/CSS/JS (Vuejs) frontend. I'm just now learning about Restful API's and the like. Would it be worth my while to use a PHP framework for this? If I did, lightweight is the key. Thoughts?
 
are you going to be making server requests or receiving requests?
that is, are you going to be hitting other servers/APIs from your app, or are you going to be receiving HTTP requests?
because if you're going to be receiving requests, I think using just Slim framework would be helpful compared to vanilla PHP
"just Slim framework" = using it as a wrapper to make receiving HTTP requests easier, plus whatever libraries you want to use
 
2:24 AM
Thanks for the response. I'll be mainly receiving HTTP requests.
Have you heard of "Lumen"? It's a pared down version Laravel that focuses on RESTful API's, and is one that I've been looking at.
 
I've heard of it, haven't used it, can't say
I've used Slim in my past job though
 
Never mind -- The Lumen team states on their site that they โ€œno longer recommend that you begin new projects with Lumenโ€, and advises making the step up to Laravel to accommodate PHPโ€™s latest performance improvements.
again, thank you
 
 
11 hours later…
1:28 PM
Morning
 
2:16 PM
It looks like a cold front is moving in the week I'm in London
 
:|
I guess that's what happens when a conference is scheduled in the UK in Feb >.>
 
2:32 PM
@Tiffany on the one hand, weather forecasts aren't accurate over 7 days at this time of year....on the other hand, it's February it's going to feel cold.
 
Cold isn't a problem, rain is!
 
@Danack how cold it becomes depends on a cold front though
Parts of Texas are dealing with freezing rain
And it's -11 C where I used to live
Albuquerque will warm up to a nice 11 C today
 
2:50 PM
Would it be possible to store a persistent value in memory in PHP that would persist for the entire boot of the OS? (Without Redis, etc)
 
I think the direction the wind comes from can make a bigger difference than cold/warm fronts...the UK is surrounded by water, so a cold front from the south-west can be (a lot) warmer than any weather coming from the north/north-east.
 
@LucasBustamante environment variable?
Use $_ENV to access or an environment variable library
 
That's the point, I'm trying to avoid it. It's an access token
 
Anyway, bringing warm layers is a good idea.
 
@LucasBustamante like a secret that stays the same?
Or are you saying it'll change every boot?
Cause environment variable is the way to go to securely store secrets that persist, like API key
 
2:56 PM
I have a password-protected SSH key that I use in a CLI tool to decrypt a config file. I have to prompt the user on every CLI interaction for the password to decrypt.
I would like to persist the unencrypted key once I decrypt it once to use it in follow-up requests, for the duration of the boot
Similar to ssh-agent
 
Is it Linux?
 
We can assume it's Unix
(mac included)
 
Password store is pretty useful
 
It would be ideal, but unfortunately I couldn't see a way of using it in PHP.
Just for curiosity sake, I'm using this package to encrypt/decrypt: github.com/laminas/laminas-crypt/blob/3.10.x/docs/book/…
 
The value can be stored in password store, then piped into the CLI script with < ... the CLI script would have to handle STDIN though
I may not be understanding your requirements entirely, though
 
3:01 PM
No, no, that's a good suggestion actually.
 
I'm projecting what we had done at my last job with encrypting/decrypting data that was saved locally on a temp basis
The temporary files were always encrypted on the disk. We had a command that could be ran on the file, accepting a value from STDIN, it would decrypt the file
The file was passed as an argument to the command
The value from STDIN was whatever secret used for encryption. I and a couple other devs kept the value in password store because it was easy. I don't remember what other devs did.
 
Passing a secret through STDIN was my first approach, but unfortunately I have moved away from it because a coworker made a good argument that it could be leaked through screensharing/screenshots
I'm tempted on exploring php.net/manual/en/function.shm-put-var.php to hold the unencrypted ssh key in memory
 
Relatively sure the secret doesn't get revealed if it's passed through password store
As long as the command doesn't have an echo statement for STDIN
Like, the location of the file where the secret is stored would get revealed
 
Sorry, I've mistaken STDIN with local env vars, like:

SECRET=123 ./vendor/bin/foo
 
But... that would only matter if someone gains access to your dev machine
 
3:12 PM
The downside of STDIN is that I have to type the password on every interaction with the CLI tool
 
Welcome to hell: debugging the JIT
 
@LucasBustamante yes
It was frustrating for me at first, but I got used to it after awhile
 
Thus the desire of holding it in memory for the duration of the boot
 
Maybe someone has a better suggestion then, cause that's all I'm able to think of
 
Yup, exactly where I am, too :D
 
3:15 PM
@LucasBustamante it's possible to hide input: github.com/symfony/symfony/blob/… though I would just stick it in a file and move on to more important problems.
What is the correct command to get npm to actually update dependencies to the latest versions? npm update doesn't seem to work reliably.
 
@Danack thanks, I'm aware of the hidden STDIN. I wanted to ask the password once, decrypt the file, and hold it in memory in a way that I don't have to prompt fort he password again. It's a CLI tool.
 
> though I would just stick it in a file and move on to more important problems.
 
Indeed. AFAIK Composer stores GitHub auth tokens in plain text in $HOME.
My need is very similar, but I wanted to have the possibility of encryption
Worst-case scenario I'm as safe as Composer, and with over 75 billion package installs I have never seen anyone complaining.
Still, I would love to go the step further if I can
 
May I perhaps ask a stupid question? Why?
As you will - on the system level - at one point either have to enter a password or have to store some credentials in one way or another somewhere.
 
1. I store auth tokens on a file ($HOME/.my-config)
2. I encrypt this file with a user-provided password
3. On every interaction with the CLI tool, the user has to provide the decryption password

I wanted to avoid the third step, by asking for the password only once per boot session
I'm thinking about exploring Shared Memory: https://www.php.net/manual/en/book.shmop.php

I decrypt it once, store it in shared memory and don't ask again for the decryption password
 
3:24 PM
So storing the credentials in a file with erad-access only for your user seems like a valid solution. If you have the issue that someone can get at those credentials in that file you have a completely different issue...
 
and hello.
 
๐Ÿฆ„
Are you going to be at PHP UK @heiglandreas?
 
/me waves
@Tiffany Sadly no. Partly because they didn't accept a talk and partly because I'll be heading out to Montreal for ConFoo at kinda the same time :-)
 
Ahh, okay. @FélixAdriyelGagnon-Grenier will be at ConFoo
Never exactly got you the pint at Longhorn. I was busy being too shy to execute what I had planned. ๐Ÿ˜…
Had planned to do a little cosplay for pictures with someone else, had packed a wizard robe... didn't go through with it
 
3:42 PM
@Tiffany ๐Ÿ˜‚ Dammit! You should have let that slipped in somehow. I would have loved to get a picture with a real wizzard ๐Ÿ˜ - even better with a pint!
 
4:00 PM
When will 8.2.1 be released?
 
@heiglandreas next time :D
 
After 8.2.0 (true statement)
@PeeHaa Streamed Raft for 4 hours yesterday, btw. I think I saw you and @Ekin had played it.
 
Yep we sure did
We got frustrated by the snarks attacking us though :D
 
yeah, they were something :) @StatikStasis you might like Grounded
also, happy monday all
 
Yeah... that shark is always right there. I'm starting to get the hang of it though.
 
4:43 PM
Wellow everyone, I'm back :-) Last year I put forward the is_literal() RFC. I'm going to try again, but focusing on the Type, in the same way it's been added to Python 3.11 (LiteralString). I appreciate I sound a bit mad by saying this stops Injection Vulnerabilities, so I'm hoping to get Scott Arciszewski to review (who has agreed, time permitting); but I was wondering if there was anyone else PHP-Internals would recognise as an expert in this field?
 
@Tiffany, @Danack, @heiglandreas quick update, shmop did the trick
 
 
2 hours later…
7:05 PM
So I just realized what the operator would be called if php ever got one that is the opposite of null coalescing. It would be called the null preferring operator. Would be useful if you want to do something like, keep a value as null if it is null, or cast it to a string if it is not null. It would also be interesting to call it null divorcing, but null preferring is definitely better.
Sort of like the nullsafe operator ?-> except you could use it for things other than calling methods. Perhaps someFun($what ?> (string)$what)
Currently I have a Nul class I use for this that has an orString() static function. But it's not as performant as a built in operator would be. You copy the string or whatever into it the function. I could make it pass by reference but then you can only call it by passing in variables, so the syntax gets worse when it doesn't need to be a variable. I guess I could make everything immutable and pass by reference and return by reference. Would be kind of awesome...
But then I would need things like, a function called false that returns by reference a variable set to false. So it's still really bad.
 
7:22 PM
@StatikStasis welp, Adderall shortage is now affecting my ability to get vyvanse filled :/ they can refill 20, but I'm going to have to figure something out when that runs out
 
@Tiffany Please try this. I'm not against medication and I know most "tricks" don't work, but I swear this works really well for my ADHD. Wake up just before sunrise and then go outside and walk around for about 10 minutes in the sunlight during sunrise and enjoy the sunrise. It helps trigger your morning 1 hour cortisol pump and helps set your circadian rhythm due to the morning sunlight and the nature of the light due to the angle of the sun. Helps with my energy, mood, and focus
Should only take about 3 days to see if it works for you
 
@Tiffany oh no! I'm about to put my request in.
But I have 2-3 months of backstock.
@Tiffany I bet I could make a killing on the black market right now!!
Ahem... DEA... I'm kidding.
 
@StatikStasis don't even joke about it, everyone already thinks we are all druggies / dealers as is :)
 
7:43 PM
@still_dreaming_1 i think it would be called nullable casting, i think someone suggested it before. $foo = (?string) $something;
 
I hadn't thought of it quite like that, it's quite elegantly for this very specific use case
 
well, it does exactly what you described, in the example i provided, if $something is null, i will stay null, if it's a string, it will stay a string, and if it's something else, it will be casted into a string.
 
(?int) was also considered where null would be the result of being unable to cast cleanly.
 
8:22 PM
@still_dreaming_1 I'll give it a try, but I don't have high hopes it'll work for me. I deal with depression as well, so trying to force myself out of bed without the prospect of a stimulant (medication/caffeine) is an uphill battle
I've found that an energy drink is pretty decent at mimicking my medication, but not a replacement
 
8:35 PM
It's worth a shot. Supposedly about 50% of people that think of themselves as night owls just don't get enough morning sunlight. According to Andrew Huberman.
 
 
1 hour later…
9:46 PM
@heiglandreas I'm no actual wizard but I would love to take selfies / pints with r11 folks at confoo!
am also looking for help to crash @Derick's talk (:
 
10:11 PM
... wait you will be speaking at the same time :(
 
10:29 PM
I don't see Derick on the list
He's going to be at PHP UK though
 

« first day (4489 days earlier)      last day (444 days later) »