« first day (1069 days earlier)      last day (3878 days later) » 

12:26 AM
@tereško I thought that question was ok
 
news.php.net/php.internals/69217 how do I enable verification?
 
12:57 AM
@crypticツ I think you ask @rdlowrey ^
 
@rdlowrey ping ^
@Danack derp, didn't notice the message was by him
 
user895378
Well it's a little complicated (which is the same reason it's not enabled by default) :)
 
hello
morning all
 
user895378
@crypticツ Are you just looking to make secure HTTPS requests?
 
@rdlowrey Yes, I have PHP scripts which update server software via commandline, and the files downloaded are via HTTPS for obvious reason of I don't want want to be installing something not trusted. If they have signing keys I use them to verify, but most don't
HTTPS is better than nothing, but fake HTTPS is nothing at all
 
user895378
1:02 AM
Well you have a couple of options ... (1) You can just use curl_* because it verifies peer certificates by default or (2) Just use Artax because it also verifies peer certificates by default.
 
user895378
Peer verification is problematic when you want things to "just work" because you have to (1) have a local certificate authority file of signers whose root certificates you trust and (2) you have to set stream context options to tell PHP to use that cert authority file to verify the peers.
 
user895378
Any library that depends on curl will do this automatically for you.
 
@rdlowrey Artax it is, need to begin using it anyways =oP
 
user895378
FYI Artax uses the same open source CA file used by mozilla. This is also the same CA file used by curl.
 
user895378
The problem with curl is that it has to know the CA file up front when your PHP is compiled. This file changes a few times a year so if it's been a while since your PHP was built you could be trusting dangerous signers.
 
1:09 AM
@rdlowrey hrmm...quite interesting
 
user895378
I have a simple executable file in the Artax repo that updates the cert file automatically for you. After cloning the repo just run bin/cert-updater.php and it will auto-update the cert.
 
user895378
@crypticツ If you have any questions or problems feel free to ask. I'm happy to help.
 
user895378
@cspray Well. What I said is not quite true -- you can specify an updated CA file by setting options at runtime but almost no one is going to know they need to do that.
 
btw one of the most random pieces of informations I know; Curl does the SSL matching incorrectly - it allows foo.bar.example.com when a certificate is given for *.example.com which shouldn't match a two-level subdomain. forums.aws.amazon.com/message.jspa?messageID=308569#308569
but the exact behaviour changes with php version...
 
user895378
Interesting. Also, I'm not 100% sure that this is correct ... I need to look into it.
 
1:14 AM
@rdlowrey I'm using trunk for my dev build which is what my update scrips run on since it has all the debugging stuff enabled. So I should assume it has the latest. My prod build is the latest stable release always.
 
user895378
@crypticツ Well I'm pretty sure it would depend on the libcurl the curl extension was built against and not the php libs
 
user895378
(but I'm not 100% on that)
 
@rdlowrey cURL 7.29.0 is what phpinfo() says for the dev build. February 6 2013 release =o(
 
user895378
@crypticツ You're probably fine, but I suspect the CA has been updated since Feb -- it usually happens at least three or four times a year.
 
user895378
1:30 AM
In any case, later tonight I'll put together a gist demonstrating how to use file_get_contents securely for HTTPS transfers. That's the kind of thing I'm going to work on submitting to the php.net docs.
 
user895378
I'll ping you later once that's up.
 
kk, thanks
 
-4
Q: Why does smurfette keep hugging me when I want to got to sleep?

HandyShe sais it is smurf snuggle time but I don't know what that means. Besides, Papa Smurf might get Smurfy! Can I use jQuery?

^^ That's what jQuery does to people!
....oh smurfette...please stop! — Handy 34 secs ago
 
This how nerds do vandalism :)
 
PhpStorm still hasn't fixed a simple (I think) problem I reported 9 months ago. If I was a paying customer I'd be irritable about that, but I get my license for free, so I still love them.
 
1:38 AM
@LeviMorrison Link?
 
Voted :)
I have a few of those as well, actually.
That said, type inference is not easy :)
 
@LeviMorrison I'm surprised whoever has to do the PHP syntax parsing at IntelliJ hasn't gone round and broken Nikic's fingers yet.
 
@Danack Why NikiC's?
For all the RFCs? lol
 
Yep.
 
1:43 AM
Okay, this is just sad... youtrack.jetbrains.com/issue/WI-14737
Still not fixed...
 
When the vote is passed you hear curses emanating from their cubicle.
The quality of the questions today is just baffling.
 
Yeah. Baffling was a correct, descriptive word for that 'question'.
 
2:06 AM
the close vote backlog is about to hit 80K O_0
Can anyone explain to me how this is useful? github.com/blog/1633-3d-file-diffs
 
@crypticツ The same way a diff on any file would be useful :P
 
@cspray I mean showing the diff as text I understand since you can see what actually was changed, but showing a graphic without detailed text I see no point.
 
Hello Good Morning
I just want if anyone knows how to make work paypal IPN here?
 
@crypticツ You could use it to show the consumers of the manufactured 3D product. They might care more about the pieces that are missing as compared to the actual file diff
 
@cspray omg, I feel so stupid. I didn't realize it was for CAD files =oP, I thought they were making a 3D model of the repos diffs =oP
 
2:18 AM
@crypticツ Oh, no. That would be pretty useless ;)
Besides I think it is pretty friggin' cool actually.
 
Yes, it is. Problem only is that most things are slightly more complicated and machines won't be able to render that. Sadly :/
 
@crypticツ You could ask them if they want to make a 3d diff viewer for php code as well :)
@DrixsonOseña Obviously there are, what's your problem?
 
2:34 AM
hrmm...if I updated the underlying libpcre to enable utf-8/unicode support do I need to recompile PHP as well?
 
@Jack they already have something like that
 
The dog makes the diff? I don't get it :)
 
it makes a 3D model
 
I do too, but I don't show the world heh
 
user652649
morning
 
2:37 AM
morning
 
49
Q: How to create .gitignore file

LucaI need to add some rules to my .gitignore file, however, I can't find it in my project folder. Isn't created automatically by Xcode? If not, what command allow to create one?

That's just borderline troll.
How to create xyz file? Open text editor, save!
 
user652649
@DrixsonOseña i did, faith in baby jesus helped me
 
It's not rocket science lol
 
@Jack How do I create an empty text file?
 
touch empty_text_file.txt
 
2:47 AM
What is the pattern called where you take a class that implements a bunch of methods and use that to share code functionality between otherwise unrelated classes? I don't think it's strategy...... but maybe I'm wrong
 
Hey all! Logged in from IE10, its very good.
 
^ fake upvote in chat xD
 
@Jack we should close it and remove it
 
Hmm, fancy a close reason in particular? :)
 
2:52 AM
@Jack, i am trying to work on IPN , i already have function that will catch the IPN but I believe I am not recieving the IPN response
 
Not receiving the IPN is a configuration issue, not a code issue.
 
@Wes lol.. Can you help me fixing my IPN trouble?
 
user652649
i can try
 
@Wes , as Jack said not recieving IPN is a configuration issue
 
user652649
yes, you must have set the notify url wrong
 
2:55 AM
where do you think we can start? for checking
provided that, I am testing on the paypal developer IPN testing ground
url is correct
 
user652649
i have no idea what is that
 
user652649
i have used the sandbox
 
you mean the account? wait let me give you the link
 
user652649
are you sure you didn't receive the ipn? did you check in apache logs?
 
@Leigh I don't think William Barlett understood:
 
2:57 AM
The sandbox is pretty noise, actually :)
 
// this example of his has nothing to do with your proposal...
$i = 0;
is_three($i = $i + 1, $i = $i + 1, $i = $i + 1);
 
@Jack "too stupid to use electronic devices unattended" ?
 
@tereško lol
@LeviMorrison Are they still comparing it to logical shortcutting? I though it's meant as Array.all(predicate)?
 
im closing it as "file creation question should be in SuperUser"
 
2:59 AM
That's fair enough I guess.
 
user652649
@DrixsonOseña never used that
 
That's pretty cool actually!
Perfect way to test all kinds of scenarios without having to actually go through the payment process.
Added to favourites :)
 
@Jack , yes that's what IPN is all about. The scenario is that I assume user don't go back to our system/store after payment
 
Yeah, you always have both PDT and IPN in place.
 
is there any easier way(than this howtogeek.com/140576/… (450mb file required)) to block certain website from android device
 
3:04 AM
Taking out the SIM card and smashing the WiFi antenna is a sure way.
 
No longer a software issue
 
@Jack it says IPN sent successfully but I don't receive anything.. Try to put some line in my code to write a text just to catch the IPN but no luck.. Do you have any idea? is Wes procedure good btw? in sandbox approach?
 
When you visit the URL with a browser, does it get run?
 
Then it's a bug in PayPal. Just complain :)
 
3:09 AM
@Jack thankyou
 
lol.. you sure? hmm I guess you're right. It says there.. IPN sent successfully but it doesnt..
 
@NullPoiиteя You're welcome. I like helping people :)
 
Hello guys.. I have a foreach loop and inside one if statement.. if the if statement is correct it will print something and break.. Now what I need is if foreach loop finished without executing if statement to print something.. in python I could do for-else.. how I can do that using php?
 
http://stackoverflow.com/a/18885086/1723893
this answer is like WTF^^
 
@xoemab , having foreach loop and inside of it has if statement but you don't want to execute it?
 
3:14 AM
@xoemab Set a variable before break;, then after the loop, check the variable.
 
@DrixsonOseña I iterate through an collection and if my if statement (that is inside of foreach loop) will be executed then I using break to stop. If now the the foreach loop iterate through all items without executing if statement then do something
@Jack oh that was smart :) thank you
 
@xoemab, Jack already had the answer
 
Excellent idea.. but I love for-else.. Is something that only python have :)
 
It's an interesting concept.
 
FB , instagram and etc concept started here
 
3:17 AM
I can't video chat with telephone :D
 
user895378
 
user895378
@crypticツ ^^
 
don't you just love all these network-related function that rise warnings when something goes wrong
 
@rdlowrey Exactly :)
 
user895378
lol you mean every single function that uses streams? Yes. Love is definitely the right word :)
 
user895378
3:24 AM
@Jack BTW that guy who was saying PHP can't handle multiple certs on the same IP didn't know what he was talking about.
 
What warnings? I always use @, I just don't always admit it =D
@rdlowrey That's an SSL thingy and has nothing to do with php.
Since 0.9.8 they started to support SNI afaik.
 
user895378
@Jack Yeah pretty much anything that deals with streams gets an @ and an associated throw in my code ...
 
last time I had to deal with was when I was making a part of app which used SCP for sending files to permanent storage
for next few days none of my coworkers dared to ask me questions
 
I had a very naive error handler before that would turn all notices, etc. into ErrorException ... it didn't check the error reporting though, so @ would still cause an exception =D
But logically, if the return value of file_get_contents() is used in the caller code, why bother issuing the warning at all?
 
user895378
@Jack That's what I don't understand about those warnings ... all the relevant functions all have an associated return value that indicates the failure.
 
user895378
3:30 AM
I guess you can capture information about the "why" of the failure from the warning but that's a really clunky way to do it
 
Meh, you can always check the magical $http_response_header =D
 
3:42 AM
@DaveRandom Man, you've been working a lot with the LDAP documentation.
 
Is there a way to coerce the response header out of the file system called like file_get_contents?
 
user895378
@Orangepill Not sure what you're asking. Can you clarify your question a bit?
 
@rdlowrey is there a way to differentate a 404 from a 500 or some other error with file_get_contents?
though now that I've used artax i doubt I will be going back to using file_get_contents :)
 
user895378
@Orangepill I know it's possible but I'm not sure exactly how to do it.
 
user895378
oh wait:
 
user895378
3:46 AM
$response = file_get_contents('http://google.com');
var_dump(current($http_response_header));
 
user895378
@Orangepill ^^ that gives you the response's status line:
 
user895378
string(30) "HTTP/1.0 301 Moved Permanently"
 
user895378
So just parse the status code from the first element in the crazy magical terrible $http_response_header array that should never have existed in the first place.
 
user895378
What an awful design that is.
 
that is a side effect that I wasn't aware of
 
3:48 AM
It's really, really bad design >.<
 
user895378
Free global local side-effects with every file_get_contents() call! Hooray!
 
emm ... I have to ask
 
At least it puts it in local scope...
 
See, told you $http_response_header was magical :)
 
how the fuck you people managed to elect Louie Gohmert ?
 
3:50 AM
ummmm Texas ???
 
user895378
Last time I voted I saw a sign above the booth that read:
 
user895378
Abandon all logic ye who enter here.
 
user895378
 
user895378
^ Clearly he's an alien who used mind-control to get elected.
 
Yuri indeed..
 
3:53 AM
@DaveRandom I was looking at some of the strict standards and came across array_column and was reminded how horrible that function is.
 
How does one gain the ability to vote?
 
Ignore me. I'm an idiot
 
user895378
@cspray lol this cracks me up because I do the same thing from time to time.
 
4:00 AM
@rdlowrey Context is important ;)
 
user895378
I have no idea what was removed but it's still funny.
 
@rdlowrey For some reason I thought he was talking about how to vote in American political elections
 
@Orangepill Basically, you have some bit of karma somewhere in PHP. In my case, I have php-doc karma.
 
@LeviMorrison proudly didn't vote
 
I think we don't have enough array_ functions /hides.
@LeviMorrison Is that "if you want to revert back" message going to haunt me until the second coming or is it meant to only show once? :)
 
4:05 AM
@Jack It expires, but if you are looking at my mirror it expires like, all the time >.<
"revert back" is also not grammatically correct.
 
user895378
Redundancy FTW FTW!
 
Can I somehow to pass a parameter to one of my php page from my main php page and then load the html output? So in pseudocode I want this:
$html = get_html("myphp.php", "parameter1"); where the $html will be the html generated from php.
 
@rdlowrey that's way too complicated for me. Are you trying to have my head explode? =oP
 
user895378
@crypticツ Well I know it's not that complicated but if I had said "you just need to procure a CA file and pass that to the stream context" securing your transfers would have been much more ... dare I say ... cryptic ...
 
Ha. Ha. Ha.
@ircmaxell On what grounds did you decide not to vote on that one?
 
user895378
4:09 AM
Oh, @LeviMorrison for those of us in the EDT timezone it's now officially BC Break Thursday
 
@LeviMorrison Thanks ... just realized that some pages go to php.net, some end up at a local mirror ... that's probably why the message shows up again :)
 
@rdlowrey woof, that's pretty awful ;)
 
user895378
@cspray I'll be here all week!
 
@rdlowrey Oh, jolly good. I bet you have quite the changes coming down the pipe :)
That is, if you get them commit-ready today*.
* Still tomorrow for me.
 
user895378
@LeviMorrison pfft sadly I don't know if I'll be able to. We'll see.
 
user895378
4:11 AM
Maybe if I work really fast tomorrow. It won't be for lack of trying, anyway.
 
Bah, I should have waited to change php.net until Thursday. Why did I forget that? Why on earth did I do it on Monday?
It's actually because I got around to fixing merge issues on Sunday night and since the project was long over-due I went ahead and committed it.
 
I forked up my php-src fork =(
5
 
4:26 AM
@rdlowrey Artax is really cool
 
user895378
@NullPoiиteя Thanks :) There are a couple of things I'd like to fix/improve but I've been super busy lately. Let me know if you have questions/problems though.
 
@rdlowrey yw :)
 
user652649
4:46 AM
@Orangepill sexy sister
 
user652649
@LeviMorrison may i ask you why did you vote no? technical reason or because it's as useful as a pint of beer in a church?
 
user652649
@Orangepill for to gain the ability to vote you need to have a sexy sister (it is a joke xD)
 
user652649
actually a pint of beer in a church may be really useful
 
@Wes I'm SOL then :)
 
user652649
4:48 AM
worst metaphor ever
 
@Wes I have several reasons. 1) We don't need another array_ function. 2) It's name is not very helpful 3) It should have been done via callback 4) It's really poorly documented and has been from the beginning.
There may be more I cannot think of right now.
 
0
Q: Confusement Logical Operators when Blocking values

Drixson OseñaJust recently I have a coworker asked a help from me regarding her work. She has this condition statement if ID is not equal to 1,2,3. Now I got lost explaining it to here because I am getting some weird interpretation but I know && (you need all condition to be true) and || (only one to be true...

 
@Wes What I meant by 3 is that it works on a multi-dimensional array: he should have had family of functions that performed smaller units of work that can be combined to create what is currently array_column.
 
user652649
yes it seems a framework function, not a language function
 
I really, really cannot believe it made it through.
And look how many people voted: it is unusually high.
 
user652649
4:54 AM
i don't know what to think, i hope this wasn't considered a "priority"
 
We should have had something more like:
(See array_column example #1 for $records)
Actually, screw that. Updating it to use generators.
function map_with_keys(Traversable $a, callable $valFn, callable $keyFn) {
   foreach ($a as $key => $value) {
       yield $keyFn($value, $key) => $valFn($value, $key);
   }
}

$last_names_with_ids_as_keys = map_with_keys(
    new ArrayIterator($records),
    function($val) { return $val['last_name']; },
    function($val) { return $val['id']; }
);
var_export(iterator_to_array($last_names_with_ids_as_keys));
^ That would have been way better than array_column.
And we could have had a default for the keyFn for a function that will generate incremental ids.
 
user652649
5:13 AM
actually i don't see reason why even that should be in the core, since it is that simple... idk
 
user652649
also, is this array_column made for who uses fetchAll ?
 
function map(Traversable $a, callable $valFn, callable $keyFn = NULL) {
   if ($keyFn !== NULL) {
       foreach ($a as $key => $value) {
           yield $keyFn($value, $key) => $valFn($value, $key);
       }
   } else {
       foreach ($a as $key => $value) {
           yield $valFn($value, $key);
       }
   }
}
^ That one should be in core, imo.
Reasons:
- It works on any traversable object, not just arrays
- It maps values via callbacks to let you do whatever want
- It maps keys via callbacks to let you do whatever you want.
There is nothing that really lets you do this at the moment.
 
user652649
yes i'm starting to see the utility
 
And we could define some standard functions that help you do common things. For instance, it's common that you'd want to preserve the key during map, so you could pass:
function preserve_key($value, $key) {
    return $key;
}
 
user652649
yes, as a core predefined function
 
user652649
5:23 AM
it's a shame that so many people voted yes
 
I suspect the author found every person he knows via frameworks to come out of the woodworks to vote on it.
It's rare to see that many votes period.
 
user652649
this voting method is sort of wrong
 
Here is array_column using my revised map:
function array_column(array $a, $column, $key = NULL) {
    $keyFn = $key === NULL ? NULL : function($val) use ($key) {
        return $val[$key];
    };
    $valFn = function($val) use ($column) {
        return $val[$column];
    };
    return iterator_to_array(
        map(
            new \ArrayIterator($a),
            $valFn,
            $keyFn
        )
    );
}
 
A generator would be nicer :)
 
@Jack In this instance, no.
Note that map is the generator.
 
5:32 AM
Why?
 
array_column returns an array, not an iterator.
map is a generator, though.
16 mins ago, by Levi Morrison
function map(Traversable $a, callable $valFn, callable $keyFn = NULL) {
   if ($keyFn !== NULL) {
       foreach ($a as $key => $value) {
           yield $keyFn($value, $key) => $valFn($value, $key);
       }
   } else {
       foreach ($a as $key => $value) {
           yield $valFn($value, $key);
       }
   }
}
That function could deprecate several functions, I think. I'm going to go look. Nope, seems we only have one array_map, no variants. Thank heavens!
 
Yeah, nvm :) it should have been iterator_column haha
While you're at it, you can do array_filter() as well =D which reminds me, I have to ping the ML again to see if there's any major concerns with my PR
 
@Jack If I can convince people, I'd love to add new functions that can deprecate hosts of old ones :)
 
@LeviMorrison They would probably tell you to create an extension that offers those new functions in a namespace or something.
 
My library 'Ardent' would be another way to get a map function like that sexy one above.
 
We can call it the normality extension =D
 
@Jack Which is exactly what I'm going to do.
 
user652649
go with the normality extension! i'll make the logo
 
user652649
xD
 
Why would you want to redirect to a www. ? That doesn't make sense to me.
We can give it a nice tag line: Normality restored.
 
user652649
5:37 AM
all this sounds fun but it is actually really sad :(
 
@LeviMorrison So you're keeping the name :D
 
@Wes It's a big project, did you expect a warm welcome to a bunch of new functions? :)
 
@Orangepill Probably not: I just haven't renamed it yet.
 
ummmm good start for the day... mornin
 
Damn...
 
5:38 AM
I'm glad I went through all of that, though.
I have some refactoring to do in Ardent :)
Good night, all. See you tomorrow.
 
Yay for refactoring!
 
user652649
gn @LeviMorrison
 
@LeviMorrison Does Ardent come with monadic patterns too? =D
 
I like Reiterate as a name for it :)
 
@crypticツ Hmm I know the dupe of that ... hold on
Oh crap, it's for nginx though =(
Contact your SSL provider and ask them to add SubjectAltName for the apex. — Jack 21 secs ago
That's basically the answer :)
 
5:43 AM
@Jack no one uses Apache these days =oP
 
@Jack I need to a non-contrived use case for monads to make them stick...
 
@crypticツ I agree, they should all use Amp
@Orangepill Get a ticket lol.
It's often dubbed as the programmable semicolon, though that probably doesn't make sense either.
 
@JAck after looking at you implementation I watched about 3 hours of video explaining the how and I have a decent grasp on that.... I just need to get the why.
 
Recognizing the pattern is the hardest part.
@Orangepill How did you like my prototype class? hehe
 
user652649
the only thing i know about nginx is
 
user652649
5:47 AM
 
@Wes That's not nginx fault =p
It's telling you to spank that bad gateway!
 
@Jack it was clever.... I'm on the fence on if that is a good clever or a bad clever though :p
Monkey patching in php yay...
 
It was necessary here because of the ->lift().
 
user652649
@Jack so why it proudly writes "nginx" underneath the error message? xD
 
@Wes Perhaps nginx should say "This is not my fault, btw!"
 
user652649
5:50 AM
exactly
 
user652649
xD
 
@Orangepill Oh, and because of the Maybe monad; otherwise I would have written the bind() method on monad itself.
 
Enchanting
 
good mornings :D
 
mornin
 
user652649
@Orangepill toptip: watch it HD
 

« first day (1069 days earlier)      last day (3878 days later) »