« first day (1403 days earlier)      last day (3536 days later) » 

12:00 AM
@AndreaFaulds Is there any rush?
 
The WIP for PHP.net is looking really good right now: leviathon.homenet.org/manual/en/function.chunk-split.php
 
@Danack There's no real reason to rush, no...
 
@AndreaFaulds I just jumped in; sorry if I missed conversation. I think you should wait a few more days at least.
 
@AndreaFaulds It has to be long enough to let interested people see and comment, but short enough to get it done without interference... at the same time, there are also concerns like the ones you're having now, where non-trivial changes are being made right next to a vote, and unless voters pay attention to those changes (and know about them), their previous now-incorrect knowledge might influence their vote...
So really it's just as much about communication as it is waiting.
 
@LeviMorrison Wow so pretty
I like that overlapping text thing you have going on
 
12:01 AM
@LeviMorrison Really avant garde there.
 
The broken list formatting is really... post-classical
 
I will say that I love the colors. Unironically. They're awesome.
 
Oh, the colors are a bug, sorry.
Can't keep them.
 
Awwww
I really liked the mildness.
 
12:04 AM
It appears on status "302 found", this tell you something? But in localhost Im not having this issue, Im just having this error on my website already hosted
 
@AndreaFaulds my own personal preference is for stuff to be left as long as possible. Although it's unlikely in this case, it is possible for someone to think of either dramatic improvements, or problems for the RFC which may only be revealed with time. Obviously that needs to be balanced against getting shit done, but as it the target version is a year(?) away, slowing down the pace of RFC voting shouldn't be a problem.
 
Not sure I'm getting what Johannes is going on about here. @AndreaFaulds any idea?
How does ATTR_EMULATE_PREPARES affect the data types returned from ->query()?
 
@Marby 302 is a standard redirect. Look for redirects your code / your framework might do automatically?
@Ja͢ck Wait, does it impact return types?
I thought that return type stuff was entirely governed by the underlying driver library.
 
Not sure whether Johannes drunk or serious.
 
12:08 AM
@Ja͢ck no idea what's up with that, not familiar with PDO internals. Maybe it's related to fake prepared statements passing strings not ints??? (just guessing that's what it does?)
 
Like, I know that mysqlnd can return native types instead of everything being strings...
 
@AndreaFaulds even so, i believe he's under the impression that if both strings are numbers it will blow up.
But if two numbers are equal, their string representation ought to be the same too.
Ignoring the performance aspect for a while.
@Charles ah, really? that's interesting ... especially if you're dealing with BIGINT and the id > LONG_MAX ;-)
 
@Ja͢ck Oh, that's gonna be glorious
I need to go double-check this.
 
@Ja͢ck Not necessarily
 
@AndreaFaulds Example?
Oh, you mean '0' == '0.0'?
 
12:11 AM
"0xa" !== "11"
"11" !== " 11"
 
okay, that's fair enough
That's a far better example than what Johannes cooked up in his more elaborate code =p
 
$ php -r 'var_dump("11" == " 11");' => bool(true)
 
Hi
The weirdest thing is happening to my site,
 
@AndreaFaulds But php -r 'var_dump("11" == "11 "); => bool(false)
 
One day its working, next day my image uploading doesn't work.
 
12:13 AM
@Ja͢ck I know, that's dumb
 
haha
there's a PR for that iirc
But the author doesn't seem to want to change their code based on my suggestion =S
 
Anyone know what I should be checking to find the problem?
Its image uploading problems
 
try {
    return htmlentities( (string) $var, $flags, 'UTF-8', false);
} catch(Exception $e) {
    return $var;
}
I came across this code
does the try/catch really do anything?
 
@crypticツ maybe if $var is an object and __toString() is called?
 
@crypticツ Error handler -> ErrorException
 
12:16 AM
Oh yes, that too.
 
Well, what you said, and the ErrorException
Anything that would bork in that line, that could be pushed into an exception.
 
@Ja͢ck That'd be an E_ERROR unless /r/lolphp is out-of-date :)
 
@Ja͢ck no, since __toString can't throw exceptions
 
@ircmaxell I think @NikiC's reviving his Exceptions in the Engine RFC at some point
 
12:18 AM
@ircmaxell oh :)
The question is really whether if escaping the variable is supposed to happen, should you return the variable as is if that fails?
 
@AndreaFaulds then I'll make an exception_compat() library :-P
@Ja͢ck no
 
@ircmaxell _compat ALL THE THINGS!
 
return false, or null, or throw an exception but don't return unescaped data...
 
@ircmaxell right, that's my opinion as well.
 
12:20 AM
I read through the entire conversation around password-hash on internals... Brought back memories
 
@ircmaxell I saw your Twitter post today about someone abusing 'salt' shudders
 
:-)
 
@ircmaxell I take it you're less against array methods as arrays don't pretend to be other types?
 
Sure they do, ArrayAccess, etc
and strings and arrays behave quite similarly in some areas
and it's less "I'm against", and more "I don't see how it can be done consistently without forcing explicit casts everywhere"
 
yeah :/
I bet strval($foo)->foo()->bar() would become a common pattern
 
12:29 AM
Perhaps I will blog on this...
 
Is there any host out there that supplies literally UNLIMITED amount of disk space? Im trying to run a stock photo website.
 
@RahulKhosla No
 
How do others do it?
 
By not using shared hosts, probably...
 
Dedicated is always fixed though?
 
12:32 AM
So get more servers.
 
I've got 112 images and I think my servers just full.
 
You can only stuff so much disk space into one machine
 
It said "unlimited".
Its shared.
 
How do you know it's full?
 
Im using a PHP form to upload and watermark the images, but...
I cant upload my images, I just get nothing., it uploads, then nothing happens.
When I upload a smaller file it works,
 
12:33 AM
Lol
 
And when I also manually upload the file... it actually works.
 
@RahulKhosla You might be hitting a maximum file size limit
 
So im confused on what the problem is.
 
Either a maximum upload size or file size
 
I work in the web hosting industry. Shared hosts that say "unlimited" mean that there is no cap. You'll probably get kicked off if you become a pest, though.
 
12:34 AM
I doubt it, I uploaded the same product as before.
Also I've set my max limit very high.
 
@RahulKhosla setup a phpinfo file to be sure
 
@taco What will this tell me?
 
@taco True, there are "unlimited" sites... though I wonder how true that is. For disk space it's probably true, for anything else it's oversold.
 
But look 1 sec.
 
@RahulKhosla a server wide directive could be overridden accidentally. You may be including something that's overriding your settings. It's a safe bet to check by including the phpinfo() call in your script.
 
12:37 AM
@taco What am I looking for in here?
 
search for the word limit, I think
something like max_filesize_upload_limit? I forget the actual setting name
there's a few limits that could prevent the upload
your form could also prevent it. Did you code the upload form yourself?
 
Yes
Although I suck at PHP.
Ok theres: pcre limit.
and theres memory_limit
 
aha
 
What one of these?
 
that could cause problems, memory limit
 
12:41 AM
Actually....stockdose.com
take a look yourself :P
 
Are uploads actually affected by memory limit?
I thought they went to disk
 
file_uploads = On
upload_max_filesize = 100M
post_max_size = 100M
 
those too
 
Ok well the file size:
13.9 MB
 
What is the filter module?
Never heard of that one
 
12:43 AM
Idk? In phpinfo()?
 
probably gonna be called mod_filter
 
So best idea is to...?
 
anybody know?
 
@RahulKhosla Contact your webhost
It might be in their web server configuration
 
Your process is allowed 128MB memory, so I don't know. it seems fine
 
12:46 AM
@AndreaFaulds What would I say?
I still don't know if its a file size problem.
 
You don't need to know the answer, just state the problem
 
Well, if it is a size problem, it is their issue
 
Alright. I'l tweet godaddy
 
Tweet?
Email/phone support
 
its like 1 hour wait time till they reply.
 
12:47 AM
Tweeting won't help...
 
Its 1:47 am, everyones sleeping, cant call right now.
 
I worked support for a while and maybe half thought they knew the problem, and maybe half of those people really knew. It doesn't matter as much as long as you give a detailed description of the problem to help them.
 
It always does... they tweet back and check stuff 24/7.
I've tweeted them about all my problems so far, + its free.
 
user3079266
@RahulKhosla well, are you actually sure that your code for uploading is correct?
 
It did 2 days ago.
 
12:49 AM
@RahulKhosla Does it work fine for a smaller file?
 
Yes.
 
What's the largest file you've managed to upload, and the smallest you've failed to upload?
 
not tried smallest.
 
@RahulKhosla your max_execution_time is set to 30 seconds. If the upload takes longer than 30 seconds, it's going to fail
 
OH
how does one edit this?
it takes me 1 min.
 
12:54 AM
switch it to 60
 
How?
 
I assume its an ini conf.
 
user3079266
you can just disable time limits in your script by using set_time_limit(0); in the beginning of your script, if I remember correctly
 
Yeah since you have access to ini, you could do it there if you want to do it site wide
 
12:56 AM
Wait, do time limits affect uploads? o.O
 
Great I'll give it a shot, thanks guys.
Or girls.
 
I'd assume execution time starts when the request has been completely sent and the PHP code starts executing
 
@AndreaFaulds That's what I would assume too
 
So... no set_time_limit(0);
?
 
Try it, I just doubt that'll fix it
 
12:57 AM
I'l give it a shot.
 
user3079266
@AndreaFaulds ofc they do, lol, your script won't finish until PHP's written the recieved input down to the filesystem
 
So just put this before my php form?
 
Yeah, maybe you're right. I can't remember when the worker process fires off
 
@RahulKhosla I would give it some kind of time limit. It doesn't seem good to have a request just running forever.
 
@Mints97 Writing that doesn't take much time...
 
user3079266
12:57 AM
it is best right after <?php
 
Is this in seconds?
 
yes
 
I'l just do 5 mins
300
 
19
Q: Can file uploads time out in PHP?

Ben McRaeHi im quite new to PHP, i have created a form for very large csv files to be uploaded to my server. Some one mentioned to me that the browser can time out due to the uploading file being to big, is this true? and if so, can it be prevented? Thanks for your help!

 
Yeah, I think @AndreaFaulds is right. It's max_input_time for file uploads
 
1:00 AM
set_time_limit will not fix a problem with a too big file timing out on upload.
 
user3079266
I guess set_time_limit should cover max_input_time
 
@Mints97 us2.php.net/set_time_limit Nope, it only covers the max execution time
 
His max_input_time is -1, so he has effectively no time limit, so that's not the issue
 
@Mints97 It sets max execution time, not input time
 
1:00 AM
Not the time PHP will spend parsing input
 
user3079266
@AndreaFaulds interesting, thanks, I'll try to remember that
 
Lets see..
 
@RahulKhosla how big is the file?
 
nothing happend @cspray wins.
13.9 MB
 
Hi guys, when user uploaded his avatar i made it to be renamed to "hisUserName_random_number.jpg",

If I made It to be renamed to direct username Is this will be useful for attackers to pull a big number of users avatars via their usernames ?
 
1:02 AM
post_max_size is set to 8M
 
I meant that they may help them to make a load for the server ?
 
upload_max_filesize is 2M
 
@Ahmad Save it in a directory called /images/asdjoidisfajsodfijfoisdfjasodfas/
 
user3079266
@taco looks like this is the problem, then. I wonder why PHP has such low limits for file upload by default...
 
Look at the link @cspray posted
@Mints97 his host probably set it low
 
1:04 AM
@Ahmad Why is people downloading user avatars a problem?
 
user3079266
@taco yep, sorry, I meant the host
 
If they want to spam your site they can just download same file multiple times, surely
 
@AndreaFaulds Copyright I assume.
 
@RahulKhosla User avatars being a copyright problem? o.O
 
@AndreaFaulds I'm afraid as i made a parameter to set size as you like, ex:
ahmed.jpg?s=1024
 
1:05 AM
Yeah I heard, some dude uploaded his face as a profile pic, it ended up on a porn advert.
 
user3079266
@RahulKhosla WHAAAT? O_o never heard of that
 
Well you do have a privacy policy right?
Read facebook's, im 98% certain it will talk about pictures.
@taco So should I do the ini set thing or set_time_limit(300); thing? Because set_time_limit(300); didn't work.
 
Man, dude...
I posted a link that one-boxed into a nice SO question that says "upload file time out"
It lays out exactly what you need to look for
 
@RahulKhosla remove the time limit stuff
 
A lot of the time the answer in programming really is RTFM
 
1:09 AM
lol
 
My problem Is that I'm building websocket chat application
If every user changed his picture, site had to sent to his connections the new avatar name, In case of using his username as avatar name, It did't have to be sent to them "connections"
 
0
Q: Base64 String HTTP Post

Destiny DawnThis is my last two questions essentially merged into one. I'm building an app in Xamarin Studio for iOS using MonoTouch (C#) with a PHP HTTP Post backend. On adding the feature to allow users to upload their own images I have the convert the image object to a Base64 string to save in PHP. The...

 
I didn't see that @cspray :P Thanks.
max_input_time = 300 should work
Do I need an S at the end? max_input_time = 300 s ?
 
oh boy Rahul. It's been clarified that wasn't the issue. Did you miss that?
19
Q: Can file uploads time out in PHP?

Ben McRaeHi im quite new to PHP, i have created a form for very large csv files to be uploaded to my server. Some one mentioned to me that the browser can time out due to the uploading file being to big, is this true? and if so, can it be prevented? Thanks for your help!

Look at the accepted answer @RahulKhosla
 
I have it says use max_input_time.
 
1:14 AM
compare it to your phpinfo
leave your max_input_time alone
it was set to -1 which is basically no limit
 
So what else is it???
file_uploads = On
upload_max_filesize = 100M
post_max_size = 100M
max_input_time = 300
I've covered them all.
 
I would make sure to quote "100M"
not sure if it matters, though
 
I dont think it does, I had this problem when I didnt set that
 
Then restart Apache
 
Im on shared hosting.
 
1:19 AM
maybe it's php cgi
?
 
Thats on server side?
 
check phpinfo() now
 
Sec.
What should I look for?
 
I feel like this conversation is an infinite loop
 
1:22 AM
the same damn things, man. lol
 
file_uploads = On
upload_max_filesize = 100M
post_max_size = 100M
max_input_time = 300
these?
 
yes!!!!
ding ding
 
You just said maybe it's php cgi, so I thought ok lets f3 and type cgi :P
upload_max_filesize = 100M set at 2M :O
 
yeah, i was thinking it would update when the fcgi process spawns but apparently not. it has the same settings as boefore
 
Are you on shared hosting?
 
1:23 AM
You might need to contact them now for apache restart I guess
 
Yes.
 
Yea, nothing to do outside of those options. Contact support.
 
they might do a reload for you since its shared
 
Or get on to your own host ;)
 
I don't get it, i've been uploading 13MB files earlier.
Why would it change to 2m?
Im not even sure what the M means tbh :P
 
1:25 AM
That's because you're not reading the manual
 
VPS are cheap these days. I'd rather spend $5/mo on my own controlled server
 
Who has VPS for $5?
 
@cspray I've got large photo files.
 
@taco I pay $5/mo for cloud server on Digital Ocean
 
@cspray hmm interesting. Thanks.
 
1:26 AM
@RahulKhosla Aaand?
 
Ok M is for mb, got it.
$5 wont cut it?
 
yep! good job
 
Clearly those large photo files aren't playing well with your current hosting
 
I've got 1000's
I paid £40 a year for this
Works well for personal sites.
@taco My question is, i've been uploading 14.1 mb files the other day, why change to 2 now?
 
no idea
 
1:27 AM
How? Why? Did godaddy do something?
Anyone @cspray ?
 
You're asking the wrong people
 
@RahulKhosla So, uh, how much does that equal out to per month in USD? Somewhere around five bucks?
 
5.52 a month
 
Yeaaa... if $5/mo isn't going to cut it your extra $.52 isn't going to either
 
@cspray But most wont allow me to upload 10000 files.
Im talking 1000's of 5–20mb files.
 
1:31 AM
And a shared host is going to allow that? I mean, if you wanna stick with your host by all means go for it
I just don't see the point unless you don't wanna fool with managing your own server
 
It said unlimited, so I assumed so.
@cspray Im willing to change to one, but im just asking will I have the same prob?
 
@RahulKhosla This particular problem, no. You have control over the server, restart it when you need to. You have direct control over the php.ini configuration ran, change it when you need to.
 
Oh I see.
 
If you have as many files as you say you're still gonna have to figure out how to handle all that storage regardless of whether you're on shared or private hosting
But it seems like it would definitely be easier to solve on private hosting because you don't have some company telling you what you can and can't do with the server
 
But then he will have less support and is going to ask for more help in here and in Linux chatrooms
 
1:36 AM
@taco Tou-fucking-che.
 
lol :|
 
I own a server from bluehost I think
But its like 1.5gb.
I use it to host rocketcss.com
But a friend set it all up for me.
 
does anyone have thoughts about PHPSpec?
 
2:02 AM
@seagoj yes:
 
2:20 AM
@Ocramius That looks amazing.
Peppercorn bacon steak? What is that?
 
That's Speck
 
Today I learned about Speck.
 
Funny resemblance to the word "spek" in Dutch :)
 
What's Duck?
 
in Dutch?
 
2:24 AM
Yes, in Duck
 
ehm
not sure whether trolling or dislexic
 
nvm, I'm just messing around :P
 
This DNS issue is driving me nuts: "php_network_getaddresses: getaddrinfo failed: Name or service not known"
The problem is that if you try one second later, it will succeed.
even with RES_OPTIONS="timeout:10 attempts:3" it still gives me that sh*t
 
@AndreaFaulds I don't think null would make sense there. Expecting an object would save us soooo many bugs in future
 
@Ocramius You responding to my reply to someone's reply on Twitter? :P
 
2:34 AM
yeap
 
Thing is, before I changed the behavior, null might've made sense
 
But now that it uses both the given scope and the given bound object, what on earth do you do for NULL?
 
yes, but even there, I'd like to have my nice exception "OBJECT OR GTFO!"
 
 
1 hour later…
4:14 AM
morning
 
4:28 AM
@ircmaxell "My philosophy is that you should write a whole method at one point in time. " .. did you mean "should not"?
 
@tereško, because of a) 'active record is bad' is a myth. Claiming that active record is 'inherently harmful' is populism and plain wrong. It wins where over-engineered stuff like Doctrine is harmful regarding complexity. b) the responsibility in single responsibility principle has limits. Splitting all possible things up makes it unnecessary complicated and hard to understand and to maintain in some ways. c) Keep it simple is more important than SRP. — MArc 6 hours ago
.. the internets
 
who says 'active record' is bad?
 
Dear, @MArc , are you even aware that "active record" is a name of an architectural pattern while "doctrine" is a a library? What exactly where you comparing? Also, since when KISS and SRP have become opposing principles? The memo must have got lost in the mail. — tereško 16 secs ago
 
gotten*
 
fixed .. I am still mixing up latvian and english "times"
 
4:44 AM
it's funny to see fowler's opinion on active record ... each time it's mentioned his argument would be that he prefers domain model :)
@NikiC Awesome work on the AST RFC; all proposals should look like that :D
 
@Ja͢ck because AR has extremely limited range in which it can be described as "pragmatic"
 
5:14 AM
i am a total noob with this git command line..
github.com/pigeonhole/first_app/branches this is the state of my branches
i want to merge all the branches to the master
how do i do this?
the one that has that violet colored merged , was done by me directly from github. there was an option called pull and merge , i clicked it and it happened..
in my commandline i can't do it
 
@shortCircuit There's nothing to merge.
Probably because each branch was stacked onto the previous one.
So by merging the deepest into master, you've merged all of them.
 
then why is the lag
 
@shortCircuit what lag?
 
5:34 AM
one of them says 10 commits behind master
uff, i forgot to generate ssh keys too
 
@shortCircuit that just means master has progressed since the branch was created.
 
ok
so i need to merge the master to those branches?
 
That only makes sense if the branch has commits that 'master' doesn't have.
OR if you're going to use that branch for something else
 
I would recommend you read the git-scm book
 
5:40 AM
0
Q: how to get proper (full) image path with extension from google api result

Sagar PanchalI am using google oauth 2.0 playground API, its giving ma the result of contact's but the problem is its not giving the full image name with extension as well. below result I am getting <link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*" href="https://www.google.co...

 
hello all
is anyone knows its answer ??
 
moin
 
morning
 

« first day (1403 days earlier)      last day (3536 days later) »