« first day (2279 days earlier)      last day (2684 days later) » 

6:00 PM
Session are just one way to store accesstokens. In your case just store the accesstoken in some other way
 
neo
php session will be stored in one disk but when the redirect page called can possibly in another instance
 
* two ^^^
 
@neo You get an access token back. You can do whatever you want with it
Store it in a session, write it down, edge sketch it whatever
 
neo
@PeeHaa let me get you my issue clear
 
@PeeHaa I'll ask
 
6:08 PM
\o/
 
neo
@PeeHaa i have called a script login.php in one system which includes the php session_start called and facebook oauth is intiated... now lets say i have callback.php in another computer.where sessions are not saved in root folder(because of multiple instance scaling)... can i still get the access token ?
 
6 mins ago, by PeeHaa
@neo You get an access token back. You can do whatever you want with it
 
neo
@PeeHaa simply asking does facebook sent me a access token to the redirect page ?
 
Yes
FB cannot magically add stuff to your session from another origin
That would be pretty bad
 
neo
@PeeHaa i'm not asking how but through url or post value ?
 
6:13 PM
URL
Err actually
That's not right
It's in response to the access token request
@neo You get the accesstoken in the response body as a json formatted string github.com/Lusitanian/PHPoAuthLib/blob/master/src/OAuth/OAuth2/…
 
neo
@PeeHaa does oauth allow its sessions to be shared with my website ?
i am newbie dont feel bad
 
Why are you still on about sessions??
 
neo
6:28 PM
i am facing a special issue
 
Yes you are special
 
neo
I want to use google compute engine with autoscaling
the principle of php sessions from what i learned is it stores its values in a directory of its disk
 
You want to use google compute engine with autoscaling but have no idea how to share state between machines.... yeah good luck
 
If running a HTTPS only site, is it better to use the SSL session ID than a cookie for maintaining a login session? Since you can't steal the SSL session ID, but you can steal the cookie potentially through other vulnerabilities.
 
neo
when it comes to autoscaling the server which intiated the login page wont be the one which must be handling the redirect page
 
6:31 PM
Would I need to setup a session handler to have it use the SSL session ID by default? Or is there a way to do it globally?
 
@crypticツ If somebody manages to steal the session cookie all hope is lost
imo
 
For them to steal the SSL session ID they'd need to steal the private key, no?
 
Also note that afaik session ids are not mandatory
 
So not all browsers would support it?
 
@crypticツ No. They can grab it from the client
 
6:34 PM
But SSL session IDs are never transmitted to the client. It's stored on the server linked to the current SSL connection.
 
@crypticツ They should. It's servers who may or may not decide to support session resumptin
@crypticツ What use is it if it's never on the client?
Isn't it used to resume a tls session?
 
ssl_session_cache    shared:SSL:10m;
ssl_session_timeout  24h;
So my Nginx config
it's stored for 24hrs on the server, as long as client does not close their browser the id stays the same. as far as I can tell.
 
The session id is sent by the client to the server and the server finds out what session this is about and resumes it when possible
 
@neo then you need a shared session storage
 
ah ok, so how would an attacker get that from the client-side?
 
6:38 PM
@crypticツ Dunno. Extract it from the user agent somehow. I mean the attacker most likely already has some access to the machine if he has access to the cookies
 
neo
@pmmaga yeah..thats right.. but i was trying to figure out how this oauth identifies the sessions
 
@neo then you're trying to figure out too many things at the same time :P
 
Seems the ID is stored in RAM. security.stackexchange.com/a/48878
 
Hi I have one year in php. but I feel that I am not improving much. Can you please give me idea how can I be a good devolper and make my skills more sharap.
 
neo
@pmmaga yeah i have to :D
 
6:42 PM
@crypticツ Seems like it's just about teim scale more than anything else if I read the answer correctly
brb food is ready
 
@Trowski why did you rename Amp\Process to Amp\Process\Process in v2?
 
how can I find out what version of PHP and wordpress someone is using? could I use fiddler for this
 
@Skullomania /readme.html will usually show their WP version as most people forget to delete it from the webroot
As for checking the PHP version, check the HTTP headers.
 
I was able to find both :)
readme was there and I used redbot to find php version
:))
 
6:59 PM
back
 
Does anyone have a good example of a PHP handler for Ajax validation requests and the HTML markup strategy that is used with it? I'm thinking about converting multiple switch statements in multiple scripts to a single AjaxValidationHandler class with a lot of methods, but I don't really like the idea.
 
ping @NikiC
 
@bassxzero Do you do that for "normal" requests?
switch statements / one yuuge class?
 
@PeeHaa my "normal" requests all have actions like display a page (GET) or save some data (POST). The difference is that my Ajax requests are purely for validation of a single form control that is about to be posted.
 
They are all just requests and responses
If it means you will have tiny things. Even better.
 
7:12 PM
That's true but i'm trying to move away from an Ajax.php script inside every directory that only handles ajax requests from it's siblings. Does that make sense?
 
testing tiny things is always easier
@bassxzero Why would you call it Ajax.php?
Try to give it a name that makes sense
 
@Danack I fixed the "composer issue". It was a git issue. Vendor directory was committed as empty. I had to rm dir, commit, composer install, commit. Fixed! Git didn't consider the empty directory changed, so it was more of a git issue.
 
I rolled my own JS validation plugin and having a set file name was easier than trying to tell the plugin where to look on each page.
 
@DaveRandom is there anything I can do to debug dns / libdns. Or are you going to rewrite it anyway?
 
@PeeHaa He's going to work on it tomorrow
 
7:15 PM
He better! cc @DaveRandom
@bassxzero Not the approach Ii would take, but hey if it works for you who am I to judge :-)
 
@JoeWatkins pong
 
@PeeHaa I was brand new to the web when i did it and now I hate it, which is why i'm here asking for a better way to do it. That and I'm trying to move from a bunch of server scripts to an MVC like architecture.
 
Just focus on separation of concerns
@bassxzero Are you testing your code?
 
sup gals and guys
 
@NikiC sorry you probably got pinged on github also, could you chime in on 1105 ... I think we can skip RFC maybe ?
 
7:20 PM
@taco yo o/
 
there is no response on internals to the discussion, and probably not because of email problems ... it's probably just that ... there are only a few people that know about this stuff, and they are involved in the conversation ;)
 
@PeeHaa do you mean unit testing? And its and MVC like arch it's more of just a S.O.L.I.D approach. github.com/PatrickLouys/no-framework-tutorial
 
yes unit testing
 
@PeeHaa If I am focusing on SRP then wouldn't I have one class that handles ajax validations?
 
Depends on how broad your term of single responsibility is :P
But no :-)
 
7:23 PM
class BlogWebsiteWithDatabaseAndFrills
^SRP
 
:D
 
lol
 
Use an airship to rig a rope across then reel the island in to the side. — Separatrix yesterday
 
Since my code is working and I'm just asking for a better way to do this, this would be a question for Code Review correct?
 
Not sure about CR. I haven't posted there enough (ever?). Check their faq
 
7:25 PM
are we moving my island @PeeHaa ?
 
TY
 
@JoeWatkins :p
@JoeWatkins Don't think you and your people are ready for that yet
 
@PeeHaa krakjoe is afk: outside waiting for airship
 
@JoeWatkins airship? Where are you flying to?
 
:-)
 
7:27 PM
2 mins ago, by PeeHaa
Use an airship to rig a rope across then reel the island in to the side. — Separatrix yesterday
wherever @PeeHaa puts my island, I guess ... hopefully somewhere warmer ...
 
Boy is this going to be dissapointing :p
 
@bwoebi No particular reason. The other sub-packages declare their own namespaces, so I stuck with the pattern.
 
@Trowski Dunno… when there is just one main class, I usually just put it at the top-level
e.g. Aerys\Session or Aerys\Websocket
 
@JoeWatkins Yeah
I think there is no objection to the function
I will review the implementation again after reading the RFC
 
@Trowski Anyway, I've left a few comments on your commits
 
7:32 PM
@bwoebi See… and I didn't even see the websocket interface there… it should be in lib.
 
@NikiC thanks, will leave you to do merge :)
 
@Trowski meh, that's stupid github displaying folders first… I hate that
PHPStorm pulls that bullshit too
 
That seems to be what people prefer.
Doesn't make it correct, but it is :-P
 
user895378
I tend to prefer directories displaying first
 
@Trowski Also, feel free to put it in lib, you just need to add it via classmap
@Trowski Well, it's just the default there… on github you can't even turn it off
 
7:37 PM
/me is srsly afk now, lata all
 
Anonymous
Latas joe
 
7:56 PM
@Trowski @kelunik PHPDoc follows inheritance normally regarding overriding of methods - see phpdoc.org/docs/latest/guides/inheritance.html#methods - so… why are we actually specifying /** {@inheritdoc} */ tags for every single overrided method?
 
@bwoebi Good question – I always saw this in libs and just assumed it was necessary, I never looked into it.
 
@Trowski It feels a bit like an anti-pattern propagated through already wide-spread use
 
8:11 PM
@bwoebi because stupid
 
@NikiC or basically: because nobody was questioning it
 
@bwoebi Can process exit codes only be a single byte?
 
@Trowski AFAIK it's a value between 0 and 255 (When I return -1 in main() I get 255)
 
@bwoebi Ok, so reading 3 bytes will be sufficient then.
 
@Trowski yeah
 
8:20 PM
@bwoebi I like the idea of adding a class like Aerys\Message somewhere that's reusable.
Any suggestions?
 
@bwoebi PHPDoc recommends adding it.
 
@Trowski What type of suggestion do you expect?
@kelunik It does??? … I've interpreted the text as the exact opposite
 
@bwoebi It's like a specialized Stream that is emitting just bytes.
Not sure where that sort of class should go.
 
@Trowski into Amp directly?
 
Well, seems like it's just mentioned, not actually recommended.
 
8:23 PM
@bwoebi Ok, fair enough, guess I could even call it Message :-P
 
But I think it's a good idea to have it, signals that it's not something that still needs docs.
 
Just was wondering if that's what you intended.
 
@Trowski yes.
 
@bwoebi I think we should add /** @inheritDoc */ instead of /** {@inheritdoc} */
 
8:24 PM
@Tiffany exInception?
 
@bwoebi amphp/socket then.
 
@kelunik Dunno, it is three unnecessary lines… Well… Can we at least write it in a single line? /** @inheritDoc */
 
@bwoebi It's already that.
 
@kelunik Socket? It's not related to Sockets
 
@Dereleased more the fact that the php on windows site is having issues, like php on windows
 
8:24 PM
@kelunik already what?
 
@bwoebi Streams of bytes are very much related to sockets.
@bwoebi one line.
 
@Tiffany didn't even check the url, wow
 
@kelunik I meant in our source
 
@bwoebi Yes.
 
@kelunik Then somewhere where I didn't see it
 
8:26 PM
Oh, it's not. Guess PHPStorm autofolded it for me. :P
 
@Tiffany working for me tho
 
@kelunik …
 
@Dereleased yeah, figured it was a server fart or something, but still made me snicker
 
@bwoebi Hmmm. no it doesn't.
 
@kelunik ?
 
8:27 PM
now to catch the thought I lost, goddammit
oh!
 
@bwoebi I thought I saw it on one line somewhere.
 
@kelunik haha
@kelunik amphp/stream is in general about bidirectional streams
And not about quantized messages
 
@bwoebi what is the ZEND_TYPE_ENCODE_CLASS_CONST stuff for?
 
@bwoebi It would seem appropriate in that package.
Well… at the same time it doesn't.
It's not meant to be writable.
n/m… don't listen to me…
4
 
@NikiC arginfo
 
8:32 PM
@bwoebi Yes, but why doesn't it encode in the format?
and instead does super weird ? prefix?
 
Okay, no idea, ask Dmitry
@NikiC uh, can you even do pointer ops on text data inside text data?
 
@bwoebi you mean casts are not constexpr?
 
(not sure if compiler allows that)
@NikiC well… probably works…
as said, ask Dmitry @NikiC
 
k
 
+     * Returns the PID of the child process. Value is only meaningful if the process has been started and PHP was not
 +     * compiled with --enable-sigchild.
^ @Trowski What does --enable-sigchild do?
@bwoebi Doesn't it do that always?
 
8:46 PM
@JoeWatkins Would you be able to proofread my article on pthreads? I don't want to spread any misinformation if possible.
 
:35057626 That was code copied from Symfony\Process long ago.
If things have changed in 7, let's modify it.
 
no they haven't and I was confusing where SIG_DFL was used and where not
 
@bwoebi Did I understand you right that Aerys\Message always buffers?
 
@kelunik yes - until you consume.
 
is it wrong to create an interface so that it's abstract and can be extended, but will be empty at the beginning?
 
8:48 PM
@bwoebi So once I used the consume API, it doesn't buffer anymore?
 
and the class that extends it will have substance?
 
@kelunik eih
@kelunik I mean, once you consume a chunk of message, it will discard that chunk.
 
@NikiC "non-atomic RCs" … what does RC stand here for?
 
@bwoebi So after I stream it, the buffered retrieving method doesn't work anymore, right?
 
8:51 PM
@kelunik yes
Either you buffer (i.e don't stream) - or you ignore the value of the Promise.
Otherwise the whole Message thing would kind of miss its whole point
 
@bwoebi refcount/refcounting
 
@MadaraUchiha are you around?
 
@NikiC can't we just mark these as non-refcounted?
 
@bwoebi I was thinking simply this for Message: gist.github.com/trowski/2536f743a279eb4c52a15e99ce317390
It does not implementStream, since the class has a stream() method that returns the underlying Stream object if the consumer wishes to use subscribe().
 
Read the comments ^^
You're not the first person to mistakenly apply that patch ^^
 
8:59 PM
@Trowski and where's the issue?
 
@bwoebi No issue. It's just slightly different from what Aerys\Message currently is.
 
@Trowski No, I mean where's the issue with implementing Stream?
 
@JoeWatkins Could you install the bz2-dev lib on Nevis? configure: error: Please reinstall the BZip2 distribution
 
@bwoebi It will call emit() each time a value is emitted, which is probably unnecessary most of the time.
 
9:03 PM
I think the voting thing is broken cc @Wes
 
@JoeWatkins And readline please. :)
 
@Trowski Yeah, but here we could just call subscribe() on the original Stream? so no need to call emit() again?
 
@kelunik do you know about php_cs and can I bug you for a quick question?
 
@PeeHaa I know what it is, but nothing more.
 
@bwoebi Right, it would be $message->stream()->subscribe(…)
 
9:05 PM
kk
 
eih, you mean $message->subscribe()?
 
ar: `u' modifier ignored since `D' is the default (see `U')
^ What's that? Appears while compiling php-src.
 
@bwoebi With the gist I sent, no.
If you think it should implement stream, that's not a problem.
 
@Trowski function subscribe($cb) { return $this->stream->subscribe($cb); } ??
 
@bwoebi Yep, exactly.
We did it a silly way in Aerys\Message.
 
9:09 PM
@bwoebi Do you know how I can get debug-non-zts-20160303 after compiling PHP? lib/php/extensions/debug-non-zts-20160303 is created and I want to put extensions compiled separately into it with a script.
 
I just wonder whether we should maybe not buffer in case subscribe is used… @Trowski
@kelunik that's governed via phpize?
 
@bwoebi So I just use the --prefix again there?
 
no?
… oh
yes.
look at your phpize script, line 4
it will contain the prefix of the installation
 
@bwoebi I originally had all streams (observables) buffer until there was at least one subscriber.
 
I mean specifically for Message
because Listener will buffer normally
 
9:15 PM
Does Aerys provide an opportunity to subscribe before pushing some bytes?
 
yes
 
Then it's probably fine.
All Streams have this issue if we don't buffer.
To be honest I never cared for the subscribe API. I didn't even offer it in Icicle, only Listener.
 
yeah… it's the Streamers task to first provide a chance to subscribe
 
Exactly.
Even with Listener you have to provide a chance to attach a Listener, so it's not a total solution.
 
@PeeHaa hey, sorry to bug you, just a quick question about phpOauthlib. Slowly making progress and learning myself some stuff, but wanted to ask about adding a redirect as described here etsy.com/developers/documentation/getting_started/oauth (under obtaining temporary credentials)
 
9:19 PM
yes
 
@PeeHaa where would i add that as can't seem to find the right spot
 
@Trowski I just mean, you now have combinators for Streams… so, it might be that people want to stuff Message into these… but then obviously don't want to buffer…
 
@LewisThomas Anywhere before sending the user to the login url
So if you want the user to authorize your app run this to get the correct url. And redirect the user to that address
That address will be the etsy login / app authorization screen
Once the user logs in / authorizes your app he will be redirected back and you will have his access token github.com/Lusitanian/PHPoAuthLib/blob/…
 
@JoeWatkins Does Derick have access to Nevis?
 
@bwoebi Yeah, that's a good point.
 
9:25 PM
@kelunik no … users are me, Joe, you, piihöö, Nikita, Chris and Markus
just look at the /etc/passwd… it's world-readable…
@kelunik do you need him to have access?
 
@PeeHaa I guessed it would be something to do with that part of the code. Because i'm building a skill to use with Alexa, Amazon provide a redirect URL that it needs to redirect to, so instead of coming back to me they need to be redirected to the amazon url
 
You are giving the user's accesstoken to amazon?
 
they store it with the skill and manage it as far as i am aware
 
No idea about that. Haven't ever seen something like that.
Some services allow you to set the redirect URL as a get param iirc
 
@bwoebi piihöö...
 
9:37 PM
@NikiC :-D … I mean, it's him…
 
9:52 PM
am now
Sup?
 
@bwoebi Would be cool, he says he cannot reproduce the crash. (bugs.xdebug.org/view.php?id=1387)
I've set things up on Nevis and can repro it there.
 
10:26 PM
 
10:41 PM
@Andrea Ah, I had forgotten about the enum semantics with regards to size. But it's not necessarily a problem; just something to check if our compilers support it or not.
As a side note, C++ does not have this issue because you can provide an exact type for the enum or alternatively use a static_assert. C11 would let you do the assert but... the C community doesn't adopt new versions as fast as the C++ community does...
 
@LeviMorrison we could always do enum _zend_type_code { /* etc. */ }; typedef zend_uchar zend_type_code; or so
 
The typedef would at least be an improvement.
 
user6061856
Okay, would it be too heavy if every time someone would view a topic it would update how many views it had, because it would have to do an update to the row.
 
@LeviMorrison yeah. C's enums aren't very powerful so I don't think there'd be much real benefit otherwise
@Danack I wanted to do that, but it's something not worth removing. It doesn't really hurt anyone if we keep it, and removing it would break some code.
trying to improve PHP is demotivating sometimes
I realised that scalar methods offer dubious benefit really
 
11:01 PM
@Andrea Practically all the time.
 
@LeviMorrison yeah :/
 
There are technical issues, BC breaks or politics on basically every RFC.
 
I'm annoyed we didn't get enhanced callable types
 
This is partly why I want 2/3 for every acceptance vote; it removes something to bikeshed about.
 
Maybe I need to introduce typedefs. Hmm.
implementing typedefs that work outside of a single file would be difficult though
I'd need to overload zend_class_entry, blegh
mind you that wouldn't be so difficult to do, it'd just be a little messy
hmm.
fires up Terminal.app
 
11:06 PM
@Andrea Yes, similar to how union or intersection types or a variety of other type extensions would have to do.
 
@LeviMorrison to implement typedef, yes
 
I'd prefer a complete refactor of zce as soon as we get our next type extension ^_^
It's already arcane and certain members are only used in certain cases, etc... would prefer something much cleaner.
 
Sure.
 
user6061856
So guys, would it be too heavy on a server to update how many views a topic has?
 
user6061856
That would happen every time a user would view it.
 
11:15 PM
Too subjective - there are many ways to do that ... But since every kind of forum board software does it, you probably don't have to worry about that
 
user6061856
@Narf So it would be fine to do that?
 
Wes
send help https://t.co/eg3OFpEfr9
 
Anonymous
Gross
 
user6061856
@Wes Jesus, that's a nightmare!
 
@Antono Sure.
 
Wes
11:27 PM
must be JS :B it can only be JS :B
 
user6061856
lol why?
 
user6061856
@Wes Actually your right since PHP doesn't often have });
 
Wes
because every language and generation of programmers is doomed to repeat all the errors that were done in the past by all the other programming languages... and now it's JS's turn
 
I wonder if we store zend_class_entry in arrays very often, and if splitting it into a hold/cold structure would be beneficial.
Oh goodie! _Generic in C11 is supported in Intel's 2016 compilers.
I believe that's the last compiler I personally care about.
 
11:44 PM
… crap, implementing typedefs this way is complicated
let's just make them file-local…
wait I'm doing this all wrong, silly me
I shouldn't try to put it in the class table, only pain lies that way
I should give it its own table
 
@Andrea I am just going to assume you said this to provoke me and I am going to ignore it (^_^)
 
@LeviMorrison internally, I mean
@Levi it's easier to fix the few places we declare classes than every place we access classes
 
@bwoebi Thought about it for a little while, and I think this makes a lot of sense: gist.github.com/trowski/2536f743a279eb4c52a15e99ce317390
 
another option: store non-zend_class_entrys in the class table, but, ugh…
 

« first day (2279 days earlier)      last day (2684 days later) »