« first day (2347 days earlier)      last day (2615 days later) » 

user6845426
3:00 PM
awesome. I'll have a read now. I've been looking at different tutorials and I keep finding mysql -> mysqli versions. I guess I should learn the difference xD I'm a complete beginner
 
@kelunik I did, but only on getting Aerys setup first. Next step is to get the RPC working with it, which I'll do this week
 
@dipper check out PDO before you get too far into mysqli.
 
user6845426
thanks ill take a look now
 
@bwoebi @Trowski @Jimbo We should really solve that problem, especially for Symfony users. It has to be as easy as possible.
 
@DaveRandom No, my problem is only when people come in and are trying to spout rubbish without listening. Those who evangelise a given framework without accepting it's weaknesses (because they're too naive to think their are any) and who have been 'bought' by the marketing
@kelunik Which problem is this?
 
3:02 PM
@kelunik What problem are you now talking about?
 
Btw, "as easy as possible" literally means a few classes already existing that you tie together, like with Ratchet, and say "Here's my event handler, use it" and that's it. They only need to implement a few methods themselves and expand out from there
 
@bwoebi Symfony + WebSockets without requiring to know anything about async.
 
should a controller be asking for data from a view?
 
@PeeHaa PR it then :-P
 
@Jimbo was that what you were trying to solve earlier?
 
3:04 PM
@PeeHaa yup
 
@PeeHaa You were totally drunk when we had that discussion weren't you ;)
 
@DaveRandom At some point I started with it
> This branch is 32 commits ahead, 3210 commits behind WordPress:master.
But it was just too bad
@Jimbo No I wasn't, but your solution is the wrong one imo
 
@Tiffany Actually it's the model and view that communicate in some instances, and the controller is for 'putting', but we don't do this in PHP (which is why MVC doesn't exist in php)
 
@PeeHaa Why?
 
@PeeHaa Is not. Shove stuff off into a queue for horizontal scaling
 
Anonymous
3:05 PM
@PeeHaa for something like this github.com/DaveRandom/Jeeves/blob/master/src/System/…, success is determined by a private property being updated, so what would be the correct way of determining success out of scope? I presume that was the reason for oldskools logging test
 
@Tiffany No ^_^.
 
You want to make things simple right?
> Btw, "as easy as possible" literally means a few classes already existing that you tie together
 
@kelunik uh, that example is typical service locator…
 
@Jimbo The way how the codebase is written, the controller gets content from the view (in this case from a form). I'm more curious if it's the right way to do it, or if I need to look at rewriting this at some point.
 
Adding external services / workers into the mix does not make it more easy
 
3:06 PM
MVC gets morphed into all different sorts of things but Controllers asking Views for data is not one I've seen because it violates the idea of data ownership, which the View never has.
 
@bwoebi ?!
 
@PeeHaa Sure, but also we want to make things that work not only in your dev environment
 
Wat
 
> Shove stuff off into a queue for horizontal scaling
Wat
 
3:07 PM
If we use a process to not block, for stuff that blocks normally
What happens?
 
Now the targets is moving again
What is the goal?
 
@bwoebi I don't care about the content, just the problem.
 
Scaling? Simplicity?
 
@LeviMorrison what about a form that exists on a view?
 
Simplicity in scaling?
 
3:08 PM
@PeeHaa WebSockets without knowing anything about async.
 
@kelunik oh, fine. Well, you still have the problem of integrating the asyncness there … oh you mean the worker thingy?
 
@PeeHaa The goal is to allow us to write synchronous code that gets executed when we ask for it in a websocket context without having to worry about yield + asynchronous stuff, blocking or anything like that
 
@Tiffany In "true" MVC on form submission the data is sent to the controller from the view, but the controller wouldn't request it.
 
@kelunik Put it simply ;)
 
@bwoebi No, the workers can block as much as they want.
 
3:08 PM
… right, you do mean the worker thingy.
 
But if this is regular PHP then the view can't really send anything to the controller; that form information would come from the web request body...
 
@LeviMorrison Would web sockets, because of the bi-diretional communication, allow us to do what you just said?
"true" mvc?
 
@Jimbo Yes.
 
yes
 
I'd love to see that one day :)
 
3:09 PM
@bwoebi Sorry, but your arguments to continue using when() are very weak.
 
And I have the abandoned project as proof :P
 
I have another one
 
@Jimbo I imagine you can find a Single Page App around somewhere that does it.
 
It's doable, but really fucking complicated and probably just not worth it
I believe the next major of asp.net MVC is going to do something like it
Although it's microsoft, so "next major" probably means 6.4 or something
 
So basically the whole problem @Jimbo is that stuff like e.g. $this->getUserByEmail($payload['username']) from that post now needs a yield?
cc @kelunik
 
3:12 PM
@PeeHaa And an async MySQL client etc.
 
But that is all there :P
 
@kelunik @bwoebi After this weekend part of me wonders if we should offer the full A+ list of functions implemented on top of when().
 
lol, I'm reading this answer that explains MVC. Our codebase basically violates every point (stackoverflow.com/questions/18949844/…)
 
A+ is clearly how people understand promises.
 
user6845426
Is it best practice to keep everything stored on db tables encrypted?
 
3:14 PM
@Trowski And why?
 
user6845426
Obviously for sensitive information
 
Yes
 
Depending on what the information is, hashing may be preferable
 
And don't let the db itself handle the encryption
 
@kelunik The inability to chain them was confusing. However, I think that's because they hadn't grasped the concept of coroutines yet.
 
user6845426
3:15 PM
I'll create something in php to encrypt before storing
 
@Trowski Right, exactly that.
People are just used to JS, but there isn't just JS.
 
@Trowski The inability is just confusing to someone really used to react/A+
 
@bwoebi Which essentially represents all of PHP async.
Evert's talk focused heavily on chaining promises with then and otherwise.
 
@Trowski See also blog.slaks.net/2015-01-08/…, which is a really good series I discovered yesterday.
@Trowski Because people don't know otherwise.
@Trowski If we use that as an argument, we should just use React, as that's how people know async PHP.
 
@Trowski so, our task is to change peoples mind about what PHP async is.
 
3:21 PM
@Trowski I talked to Benjamin Gruenbaum and asked how he would implement promises now with generators / async + await, and he said exactly how we currently do.
@Trowski We just need to talk. Or let others talk about Amp.
 
@bwoebi @kelunik Fair enough. We'll have to have some key points right up front then. Hopefully I can get some time to help with documentation very soon.
 
Imo that's ^^ the solution for most things
 
@PeeHaa Just that Doctrine is blocking?
 
Yes I can see it being a solution for that
 
@kelunik If you ever looked at how React resolves promises you'll probably throw up a bit in your mouth.
 
3:24 PM
But that's unrelated to people not needing to know about what yield does imo
 
@Trowski I know exactly how it does it. And it's horrible.
 
For fun I quick used some of Icicle's code to implement thenables on top of Amp's promises. Was really easy, maybe I'll offer it as a separate lib under my own name in case people want it.
 
@PeeHaa If you don't know what it does, you won't know where to put it.
And you need all the libraries to support non-blocking I/O.
 
Again I can see the use case
 
@Trowski We just need to PR our interface to reactphp/promise.
 
3:26 PM
But the premise is weird
 
user6845426
If i'm trying establishing connections on multiple web pages, is there a more efficient way of storing username/password details for my sql connection rather than writting it out on every needed page?
 
@Trowski Also, A+ is not how people understand promises. Most people just know that they need to use then() and that's about it. People regularly are astonished about how they can get race conditions with async code etc. They do not really realize that things are really out-of order and won't be really sequentially.
 
I just think @Jimbo's explanation of why he wants it doesn't match with what I think he is saying :P
 
@Trowski A+ is largely detailing semantics, which nobody cares about until they conflict with their own code. I'm pretty sure if we say "amp is like react, just no then(), but when() and you need to pass the promise itself around instead of the return value of when()", you pretty much already cover the people knowing A+
 
@LeviMorrison That's all front-end though. I'd like to see it happen with backend + front-end working together over WS
 
3:28 PM
I mean you always will have to yield something at some point
 
@PeeHaa It also needs async stuff for it to work. And if I ever approach something that I want to work with async but doesn't yet, I'm screwed.
 
@Jimbo Why is a SPA all front-end?
 
My point is @Jimbo
22 mins ago, by Jimbo
@PeeHaa The goal is to allow us to write synchronous code that gets executed when we ask for it in a websocket context without having to worry about yield + asynchronous stuff, blocking or anything like that
At some point you do have to yield something
 
@PeeHaa yes, but the library will do that for you
 
@LeviMorrison SPA has it's own MVC , say in JS, and then when talking to the back-end it'll typically use REST. I'd like to see the back-end updating something in a mysql DB, and instantly the front-end reflects it. Think Angular ng-bind, but not just front-end
@PeeHaa Nope
I don't have to yield anything, that's the point
 
3:32 PM
@Jimbo Yeah but what about SPA requires REST? Nothing. Just use websockets ^_^
 
is there any async email library ? ( no spool please )
 
@LeviMorrison Sure. I haven't done that yet :)
 
confused look
 
@Vamsi nope (not that I know of)
 
@Vamsi I have started writing one like 8 times and swiftly lost the will to live
 
3:33 PM
@DaveRandom what's the problem? the RFCs and the shitty protocol?
 
So the library just wraps yield Process->run() and that's it?
 
@PeeHaa We use yield because of stuff that can block, right? So, my point is that anything that can block we just do in a worker somewhere else. Only when it's done do we pass that back into the event loop to return to the client over WS
No, not process, because that's on one machine
 
@bwoebi Have you ever read the SMTP specs?
don't
 
Plus, in @DaveRandom's words "A process is a biggest unit of execution a machine can perform. File descriptors, handlers etc"
 
parallel whatever it is called foo for all I care
 
3:34 PM
@DaveRandom not really, but I have a vague idea.
I know it's shit, but not how shitty.
 
Not a box you want to look in
 
sending an email is generally considered an I/O task right ?
 
what is 'sending an email', really?
 
@DaveRandom Well, how shit is it compared to SOAP?
 
@Jimbo yes so the thing that does that is that wrapper I just wrote?
 
3:35 PM
@NikiC I think SMTP is worse than SOAP.
 
@NikiC worse
 
@NikiC differently equivalent. The key difference is that SMTP does actually have a spec.
 
in my case, calling swiftmailer $mailer->send($message);
 
@PeeHaa The libraries does the complete websocket communication and fetching from the queue. The actual app just has to provide a callable to execute practically.
 
@PeeHaa No because it's not a process or parallel or any of that jazz, although tbh sure it can be... but it can be offloaded into a job queue
and a worker does it's stuff then puts back in without blocking
 
3:36 PM
@Jimbo yes but at some point something has to yield it :P
 
@kelunik drew a nice diagram
 
@DaveRandom It's not that bad. I implemented it once to send some mails :D
 
That should be the wrapper
 
@PeeHaa When I used Ratchet, I never used the word yield once.
 
@PeeHaa something, yes, but not the users code.
 
3:37 PM
@bwoebi yes
 
Exactly, all the magic sauce is done under the hood
 
@kelunik for synchronous usage it is doable, for async stuff it's a nightmarish ball of branching state
 
@DaveRandom yup.
 
And, all the user cares about, is that they can write sync code somewhere and events are triggered when a user connects / disconnects etc
 
Does ratchet do coroutines?
 
3:37 PM
Ratchet's shit and still polls under the hood (with ZMQ anyway)
 
@DaveRandom uh, if it's doable with sync code, it's with async code too… the parser just needs to be a generator
 
@PeeHaa It's just React. You can use Recoil and you're fine.
 
@bwoebi oh it's totally doable, it would just be a lot of work to make it robust
 
Yes, but saying that with ratchet you don't yield is... obvious? :P
 
@Vamsi yes, but another reason I've never put the time in is that I've never been confident it will be that useful. Servers will impose rate limits that will eliminate all of the benefits you get from async
/cc @bwoebi ^
 
3:39 PM
Tnx btw I didn't see recoil before
 
When you send messages via SMTP most servers take ages to respond because of artificial delays as anti-spam measures
 
@DaveRandom If you write me a sync implementation, I'll asnycify it :-P
 
No no no
 
@PeeHaa You understand now? :)
 
!!dave
 
3:39 PM
@DaveRandom should work on DNS lib.
 
@Vamsi @DaveRandom Just use a provider with some HTTP API and you're fine. :P
 
@Jimbo Wat? :P
 
Omg
 
@DaveRandom so, the benefit is that SMTP can easily run in background and notify when done?
 
I thought you had a moment of lucidness for a second
 
3:40 PM
It's a different way of doing async
 
@bwoebi you may as well just steal swift or phpmailer in that case
 
8 mins ago, by PeeHaa
confused look
Yes, a different way
Hidden from the user
 
Sorry I mean "fork"
 
haha , curl is the mother of all async requests in PHP
 
@Jimbo No it's not hidden
It's just not there at all
 
3:41 PM
@DaveRandom As long as it's MIT, perfectly fine.
 
@PeeHaa I mean the complexity is hidden from the user
 
@kelunik 10000% this
 
@Vamsi I just read monster, and wanted to agree.
 
SMTP is the tip of the iceberg of how hard a problem email is in general
have someone else do it
always
 
@Jimbo You are using that word complexity again. While I think you mean non async supporting libraries
I guess
 
3:42 PM
@PeeHaa Basically, but not only.
 
That's what making it hard for me
 
If you have workers executing in sync, debugging can be a lot easier.
Because you will have useful stacktraces for example.
 
I am trying to get it, but I keep hearing complexity, scaling and non async support in the sameish sentences
I am not trying to be a duck for once btw :P
Or a dick
@kelunik That I can totally live with. Although they are scattered now :P
stacktraces in amp suck
 
Honestly, most often the line, file, and message are enough.
 
But when it doesn't I yell at bob :P
 
3:47 PM
Perfectly reasonable. :P
 
@DaveRandom well, the only thing I care about, is that the mailer doesn't block everything else running in this process
 
Evenings o/
 
\o
 
@bwoebi Usually I also care that a mail gets actually sent.
 
@kelunik yeah, sure
 
3:48 PM
mornings
 
@kelunik that wasn't in the original spec
that's going to cost extra
 
@DaveRandom I know. As said, use an external provider.
;-)
 
I just tattoo my message on an intern and send them in person
 
:-)
 
@bwoebi I really don't understand why you want to keep when.
 
3:51 PM
Just pick something and go with it
It's just a name
/me runs
 
Anonymous
I agree with @kelunik, when sucks
 
@kelunik For one part, I just have some intuition that we'll regret it later if we change now.
I feel like we're going to complain about how clumsy it is.
 
I've got a circular dependency and I seem to have hit a brick wall, anyone got any suggestions for techniques to resolve such a thing?
 
hehehe
 
3:54 PM
@DaveRandom What kind of circular dependency? And why is that specific dependency problematic?
 
...I'm not sure what else I was expecting
 
@bwoebi It would maybe matter if that'd be the main API, but coroutines are the main API.
 
@kelunik it is the main API for libraries.
 
@bwoebi Then you're writing your library wrong.
 
@kelunik I don't think you can generalize here.
 
3:56 PM
I spent the last two hours working on a problem and wondering why it's not working, to just now realize that I was testing in production.
 
@bwoebi in writing out an explanation I realised the solution, thanks rubber ducky! :-P
 
@DaveRandom :-)
 
although depressingly I now have a class called WebSocketEventDispatcherFactory but I can kill that later
 
How Java
 
@DaveRandom I think… you should eliminate that immediately.
 
3:59 PM
Maybe what I need is an AbstractWebSocketEventDispatcherFactoryInterfaceBuilder
 
Now you're just trolling
 
@DaveRandom softwareengineering.stackexchange.com/questions/306483/… this guy suggests using Interfaces
 
@bwoebi We have exactly 13 usages in Aerys.
 
The fundamental problem was shared state at the wrong level
 
┌[kelunik@kelunik] - [~/GitHub/amphp/aerys] - [16:58:45] - [amp_v2]
└[6011] $ grep -r "\->when(" . | grep -v "Test.php" | grep -v "vendor" | grep -v "docs" | grep -v "~"
./lib/Http2Driver.php:            $client->bufferDeferred->when(static function() use (&$keepAlives) {
./lib/StandardRequest.php:            $ireq->body->when(function ($e, $data) {
./lib/BodyParser.php:                    $body->when($when);
./lib/BodyParser.php:                    $body->getMetadata()->when($metawhen);
./lib/Websocket/Rfc6455Gateway.php:                $promise->when(function () {
 
4:01 PM
it's broken, it's prepending them instead of appending them
must be written in Java
 
@bwoebi Why should libraries not use coroutines?
 
Well there is a performance overhead
 
@kelunik we have less promise yields in Aerys, if you ignore the filesystem fetches
 
it shouldn't be mandatory
 
@bwoebi Well.
┌[kelunik@kelunik] - [~/GitHub/amphp] - [17:05:55] - []
└[6016] $ grep -r "yield" . | grep -v "Test.php" | grep -v "vendor" | grep -v "docs" | grep -v "~" | wc -l
585

┌[kelunik@kelunik] - [~/GitHub/amphp] - [17:06:21] - []
└[6017] $ grep -r "\->when(" . | grep -v "Test.php" | grep -v "vendor" | grep -v "docs" | grep -v "~" | wc -l
93
 
4:08 PM
@kelunik I said promise yields
most yields are from incremental parsers, middlewares or yield from's
 
Don't tell me it's mostly generator parsers.
 
@kelunik really, check it yourself…
 
┌[kelunik@kelunik] - [~/GitHub/amphp] - [17:09:06] - []
└[6019] $ grep -r "yield" . | grep -v "Test.php" | grep -v "vendor" | grep -v "docs" | grep -v "~" | grep -v "yield from" | wc -l
547
 
Are you checking /lib or also /test?
 
@bwoebi It's actually mostly ./redis/lib/Redis.php :P
@bwoebi grep -v "Test.php"
 
4:11 PM
@kelunik … i thought you excluded vendor?
 
@bwoebi I'm in GitHub/amphp
┌[kelunik@kelunik] - [~/GitHub/amphp] - [17:11:15] - []
└[6022] $ ls
aerys  artax  dns   file  mysql     phpunit-util  react-adapter  review.txt  stream
amp    cache  docs  loop  parallel  process       redis          socket      test.php
 
oh … I was talking about aerys, …
I do not know about redis, that's not my lib :-P
 
@bwoebi Aerys has 13 not 93 whens.
@bwoebi It has a lot of @yields in docblocks.
 
@bwoebi From my experience people equate then() as the defining feature of promises. We'll just need to educate them.
 
@Trowski The term promise is way older than then
 
4:21 PM
@kelunik s/people/PHP developers
 
@Trowski This is, honestly, my extremely limited and very narrow view of understanding before I actually put in effort to understand otherwise
 
@Trowski right.
 
sorry, childish colleague :-/
 
@DaveRandom Chill dude, it was funny
(and also reminds you to lock your pc ;) )
 
I'm literally sitting right here doing something on a different screen
 
4:25 PM
 
god damn this really is going to end up with a factory interface
I am not a big fan of myself right now
 
@DaveRandom nightmare are sort of fine as long as they're just fantasy…
 
I just cannot see another way right now and it's for the greater good, I will come back to it and eliminate it at some point
 
@DaveRandom That's just an abstract factory..
Then you need a factory for that
 
I think I just need a gun to shoot myself with
> No suspicious code found
It didn't look very hard
 
4:36 PM
@kelunik faggot and gay transitioned meaning based on contemporary usage; even if "promise" once held meaning independent of "then" that does not mean... hmm... I forgot where I was going with this ^_^
 
i'm stuck, and tried everything to fix this bug:
Warning: mysqli_query() expects parameter 1 to be mysqli, null given in
What am I doing wrong:
mysqli_query($conn, $isql);
 
@MadaraUchiha what's so funny?
 
@acoder Nothing you said
 
4:46 PM
lol, not a GLOBAL
 
@DaveRandom There's nothing really bad about that.
 
@acoder passing null instead of a mysqli instance...
 
Wes
5:17 PM
\o
 
o/
 
5:43 PM
\o/
 
The letter o is trending on stackoverflow chat
 
6:00 PM
@kelunik Most of our libraries use when instead of yielding. We also use pipe in several places. Coroutines in amp libs are actually pretty rare…
 
evenin
 
ThW
morning
 
Why is this possible in_array(); 3v4l.org/jX5Ze
 
6:17 PM
@Duikboot because it uses the same rules as == and they are bad; pass true for the third parameter
@Wes 'twas on /r/lolphp, so yes
@Danack might be belittling your talk a bit there :p
 
Oh :D thx
 
ThW
"adding story" to a talk about PHP extensions is difficult. :-(
hopefully adding some minifig pictures will help
 
6:33 PM
Is there a sandbox like 3v4l that lets me use HTML with PHP?
 
ThW
@Tiffany Store output into a local file, open it in your browser?
 
@ThW that requires opening xampp :( but if that's the only way
 
ThW
most of the time if you're using something like 3v4l you want to see the real output - meaning the source. Looking at the rendered output is not as useful.
Why would you need XAMPP, just use a local file
 
this time it is, because I wanted to see what the output of multidimensional $_POST was
because I need PHP
 
ThW
php -S
 
6:36 PM
Testing environment is not giving the output I'm expecting and I'm trying to understand why.
 
ThW
php includes an simple http server
much easier then all the hassle with a full webserver
 
I'd have to find my IP and port :/ XAMPP is easier in that case.
I'm too lazy to find it >.>
 
ThW
you don't you provide the port, and you can use localhost
 
Damnit the number isn't shown in full :(
 
6:41 PM
I'll just use xampp
thanks anyway
 
Just have a playground directory where you can dump in random crap on demand
No need to touch xampp after it's set up
 
ThW
@Tiffany I run CMS development instances that way (with SQLite as the database). It allows me to just start up a small webserver instance as needed. Haven't had a "real" webserver installed for some time.
 
I just wanted to run a quick file to see the var_dump results. Using the built-in webserver would require setup that I don't have time for right now.
I already understand how to use xampp. Sure, it's more than I need, but it does the job.
 
ThW
Sure whatever works. But the only setup I need is to have PHP in the PATH environment variable. After that you open the console, got to the directory and call php -S localhost:8080. Usually I have a batch/shell script for that in the project.
 
lol, the developer who wrote this did it wrong. I was testing to see how the $_POST results of a multidimensional array would be from a form. It resulted in what I expected. There's a method that's supposed to "getContent" that's being used with $_POST, but it literally just gets all of the content from a file.
It is something I'll probably set up eventually because it would enable me to get rid of xampp, just not right now while I'm working on a problem already.
one step at a time :P
 
They wrote the method with a parameter $contact like they were going to get various details from a form. But then rewrote it to just get all of the content from a file using ob_get_contents. Course I can't judge 'em, I can't write better at this time.
 

« first day (2347 days earlier)      last day (2615 days later) »