« first day (1482 days earlier)      last day (3482 days later) » 

6:02 PM
I fixed a lolphp someone pointed out on Twitter: github.com/php/php-src/pull/892
 
@AndreaFaulds Nice, just handling damn http error status codes now.
 
It's a bit of a general issue with PHP that our HTTP parsing code isn't shared :/
 
anybody know opencart ?
anybody there ?
 
Nope, and nope.
 
0
Q: How to add watermark in opencart 2.0 while uploading the product image

faizphpHow to add the watermark in opencart 2.0 in admin panel ? What I want to achieve is to add the watermark right under the bottom-right corner of each image and save the file under the same name. I want the watermark to be put right under the image, not over it and in the same time being cut to f...

 
6:07 PM
@AndreaFaulds lol
I'm trying to see how this bug could be fixed, and I saw that and was... wut wtf
 
@FlorianMargaine Is that really a bug?
 
I think it is
I don't see why it should be sent to stderr
 
I wouldn't say so... it's progress/status/error info. It's not output.
 
it's definitely not stderr :/
and status should be in stdout imho
 
6:11 PM
Someone just sent me a database draft for a new project (on paper). Below the password field was noted md5.
 
@FlorianMargaine Where else should it be sent to? Stdout is being sent to the browser, right?
 
@bwoebi ...
 
@Danack php -S already uses stdout
$ php -S localhost:8001 2> /dev/null
PHP 5.6.2-dev Development Server started at Thu Nov  6 18:58:05 2014
Listening on localhost:8001
Document root is /home/florian/src/c/php-src
Press Ctrl-C to quit.
for status output, actually.
 
user image
5
 
6:24 PM
@webarto >Windows XP
@webarto >Old Firefox
@webarto >Imported default IE bookmarks
hnnnnnghgh
 
Haha, nice.
 
@LeviMorrison if I put a return type and dont put an explicit return, will the function return that type by default?
 
@FlorianMargaine While you're free to do whatever you want, changing code because some output is being put to one std output rather than another doesn't sound like a great use of time. btw some of the time it is outputting errors - having the output of request logging change between stdout and stderr based on the response code does not seem great.
 
Because it's just logging. No one wants to have to listen to two outputs to get all the information. If you want a more meatier bug to tackle, imho two I opened recently bugs.php.net/bug.php?id=67481 bugs.php.net/bug.php?id=68343 are things that are actually broken and ought to be fixed.
 
6:38 PM
20 years of PHP development history :PHP didnt know that php is that old
good morning
 
@Danack I wanted easy to fix ones :P
but your bugs do seem interesting, indeed
 
@FlorianMargaine As I said, you're free to do whatever you want....but changing behaviour of stuff that is already working and being used by a large number of people won't make people grateful. Yes, technically it might be a bit odd that the output is going to stdout...but that's the way it is. Changing it to be slightly 'cleaner' doesn't have any real benefit, and will annoy people who have to change which output they monitor between different PHP versions.
 
yeah I guess...
 
Which is why the internals list is so resistant to doing new stuff....if you don't get it completely right, it's really hard to fix without making life a pain for lots of people.
 
still, inconsistencies itch me
 
6:45 PM
hello anyone uses SLIM framework
 
yes @RickRoy
 
I m having a very strange issue with it
i am new to it and have this code
<?php

require '../Slim/Slim.php';
\Slim\Slim::registerAutoloader();

$app = new \Slim\Slim();
$app->get('/fname/:name', function ($name) {
echo "Hello, $name";
});
$app->run();

?>
this works when i load the url in browser as localhost:8080/rest/v1/fname/Test
Hello, Test is the thing I get
but when I use REST Easy plugin
I get 404 error
why?
 
REST Easy plugin?
 
yes mozila plugin for testing REST api calls
 
oh [= Well.. are you sure you are hitting the same url?
 
6:50 PM
localhost:8080/rest/v1/fname is the url i m using n then passing the value as parameter
 
user652649
@LeviMorrison how about that new feature that allows foreach to return objects as keys via Iterator for maps? can't find any info about it. i'm using php 5.5.something
 
using the plugin
 
7:09 PM
Anyone??
 
@Patrick thanks checkinh
 
@FlorianMargaine why is that an issue?
 
@ircmaxell it's not :)
 
good, that's what I thought
 
7:18 PM
lol :D
 
:-P
 
Wow. What a day.
Deploy it now, fix it while it's live.
Oh, by the way, the assembly dependencies are out of sync.
So have fun merging with 2938748902374897239847 conflicts.
Oh, you managed to merge those two disparate branches which shouldn't have been to begin with? Good, something else broke.
 
wow, what a day. fly from New York, to Texas, to Argentina, then walk clear across Buenos Aires :-)
 
@ircmaxell Trade'ya? ;-)
 
:-P
 
7:25 PM
Like, even for 5 minutes.
 
Can You help me? pastiee
 
you can't even board an airplane in 5 minutes :-P
 
@ircmaxell I'm okay with that. Even if it's 5 minutes spent waiting for baggage check.
 
@VeeeneX ewww static
 
@VeeeneX is that CI Forge?
 
7:27 PM
:D @Patrick Yes, and soo many problems
@kodeart nope I tried to write my own :D
 
last time I saw that was 2007
 
@Patrick I will take a look at it
@Patrick What about protected static $methods = [];
:D
 
@WesleyCrushed I think it is PHP 5.6 which allows objects for keys in foreach
But yes, this has been fixed.
 
@VeeeneX why?
 
7:32 PM
@Patrick Just a joke
 
@Gordon Sorry?
I didn't understand.
 
Gooooood almost friday monring
 
@LeviMorrison will function foo() : array { } return an array when I dont put an explicit return statement into it?
 
@Gordon No, it fails.
 
@LeviMorrison hmm, ok. good enough
 
7:44 PM
:-)
@DanLugg then make it happen
 
@Patrick while I check out the requestable could you answer the question I posted here? I want to know why this is happening
0
Q: 404 error on REST Easy

Rick RoyI am new into building restful php applications and as such was trying something simple here is my php code <?php require '../Slim/Slim.php'; \Slim\Slim::registerAutoloader(); $app = new \Slim\Slim(); $app->get('/fname/:name', function ($name) { echo "Hello, $name"; }); $app->run(); ?> ...

 
@RickRoy did you read the comments?
 
To the question? Yes I did, but it is not clear to me how I should then check the API using the REST Easy plugin
or is it not supposed to be tested using the plugin at all?
I just want to know that I will switch to requestable to any other framework to suit my needs just want to know what is the correct way to do this
using Slim framework
 
@RickRoy do you understand how a get parameter works?
 
7:50 PM
@ircmaxell "Sorry, I have to leave right now" "Oh? What happened!?" "Oh, it's not a particular emergency, but I need to go to the airport and wait to check some baggage for about 5 minutes; I may or may not be back"
 
lol
 
I am not sure I think I do but could use some clarification that is if you have the time to elaborate a bit I am totally new to this REST senario and just testing things
 
Oh well, I fixed all the things. Except for the thing I was trying to fix originally when I apparently broke all the things.
 
@DanLugg what I meant was start speaking
 
localhost:8080/rest/v1/fname/Test?test=abc
If you use this in your browser then you pass a get parameter with the name of test and the value of abc to your script.
If you open localhost:8080/rest/v1/fname/Test/test, then you are not passing a get parameter
 
@ircmaxell I'd love to, I'm rather animated and am reasonably good with public speaking.
Now that I have ~3 years of half-decent experience at an employer that's recognized quite well in my region, I could be eligible for a gig at the local college.
 
there you go :-)
 
I do like teaching.
 
Ok I get this but did you ever use the REST Easy plugin coz I am a bit confused on how to use it. I will post some pics maybe that will help you explain what I am doing wrong
 
I think I may have to revisit that plan. Thanks :-)
 
7:59 PM
@RickRoy No never used it, but I wrote a more elaborate answer on SO. Let me know if something is still unclear and I'll edit it in
 
just found ur answer thanks :)
 
So... when do I need to use TSRMLS?
I need to learn when it is and is not appropriate.
I can't go on slathering it everywhere.
 
I do trial and error
I don't include it, unless I need to call an API that needs it, then I refactor back
 
@Patrick so I need to modify the route then, thanks :)
 
@RickRoy Maybe to quickly clarify. Even when you just call an url without get parameters it is a GET request by default (in your browser). The get parameters are for passing data to the endpoint. ?page=2 for example
 
8:14 PM
@LeviMorrison wherever something uses module globals or calls an api that requires it
it's probably going to become redundant before 7 is a thing anyway, there is a working branch of master where the work has been done, so that we never have to pass it to anything ...
 
hmmm, I want to write a blog post, but I don't know what to write about
 
@JoeWatkins the native tls thing right?
 
@FlorianMargaine yes
 
@FlorianMargaine yeah
 
Is "under the dome" any good?
 
8:19 PM
@ircmaxell I got nothin'
 
@PeeHaa I liked the 1st season
then again, I liked gossip girl too, so I may not be the best to ask advices to
 
:P
Will download a couple of episodes to try it out
 
@JoeWatkins me neither, other than an itch to write...
 
Something on frameworks would definitely get you views...
Did you ever write down your thoughts on GRASP or is there just your talk?
 
oh, I did want to write a post on MVC
 
8:22 PM
@NikiC That would be this guy. In all his destructive glory.
 
@DanLugg I kinda feel sad you are making fun of a retard :P
 
that website looks like I made it ...
> Un-MD5
 
@DanLugg Ah I remember that thread
 
8:29 PM
brilliant ...
 
So much awesome
 
Yea, it was a hoot. /cc @ircmaxell ^^
 
9. Use https, for password and other sensitive data.
14. Obfuscate, obfuscate, obfuscate (hide .php)!
hmmm
 
> Obviously you are no expert!
Hm.
 
@DanLugg So he edited to include the "or use password_hash"?
 
8:32 PM
@NikiC He must have.
 
Because I definitely don't remember that part
 
Or the "but beware the dangers first" -- AFAIK, there were no dangers, according to him.
 
@NikiC yes he did
 
:-)
 
Anyway, that wasn't the only one
 
8:35 PM
Link please :)
 
so, argentinian snacks are awesome
 
Don't have a link - but there was someone in here who has been regularly showing code for his own crazy hashing function and nobody was able to dissuade him from doing that
 
yeah, I remember that
 
I also remember a self-proclaimed cryptography "expert" coming in here and arguing for hours about how there's nothing wrong with using sha1 for password hashing, because it has no known collisions. Because those two things are totally related.
 
8:38 PM
@NikiC Aaaah that guy
 
my
god
what the hell is this guy
 
Did you just find their website? I'm calling poe's law.
 
Which way is best to save Database configuration
1] .ini file { protected by htaccess outside users }
2] a .php file
 
If only chat search was good decent okish :(
 
a .yaml file of course
j/k.
 
8:39 PM
I don't remember where I got it, but I have this one: gist.github.com/ircmaxell/4112366
 
a .ini file outside of the webroot is a pretty good idea
 
@Rafee A php file because why would you use a different format? ever?
 
I don't know why, but password hashing seems to attract stupid even more than PHP does.
 
@NikiC Now combine the two: perfect shit storm
 
ohh, that reminds me
 
8:40 PM
hmm. thanks guys..
 
I don't know if it's that, or that there is no "meh" when it comes to hashing. It either works well or it's a terrible idea.
 
@Rafee why the hell you would depend on .htaccess for that ?!?!
put the damned configuration files outside DOCUMENT_ROOT
 
And I'm not meaning "stupid" as in doing the wrong thing, but "stupid" as in being absolutely convinced that you are right and know everything about crypto and all those experts can go f* themselves.
 
@ircmaxell thanks! I'll use that in my projects from now on
 
The Dunning–Kruger effect is a cognitive bias manifesting in two principal ways: unskilled individuals tend to suffer from illusory superiority, mistakenly rating their ability much higher than is accurate, while highly skilled individuals tend to rate their ability lower than is accurate. In unskilled individuals, this bias is attributed to a metacognitive inability of the unskilled to recognize their ineptitude. Skilled individuals tend to underestimate their relative competence, erroneously assuming that tasks which are easy for them are also easy for others. David Dunning and Justin Kruger...
Aka what all of reddit thinks they're immune from because they know what it is
 
8:42 PM
@NikiC Schneier's Law: Anyone, from the most clueless amateur to the best cryptographer, can create an algorithm that he himself can't break.
 
@PeeHaa I use a hamster ... every project I start, I buy a hamster (they are cheap, a few bucks only), I shave it, and I tattoo the configuration on it's belly ... the password is only 5 minutes away with a decent shaver ... I find it to be secure, but you have to weigh carefully the cost of hamsters against your security needs ...
18
 
@KevinMGranger yeah .. most of people from this chat room tend to avoid r/PHP to preserve some vestiges of sanity
 
also
> Few false ideas have more firmly gripped the minds of so many intelligent men than the one that, if they just tried, they could invent a cipher that no one could break.
 
@JoeWatkins lol!
 
-1
Q: How would I implement Password_Hash

TerrabyteI want to implement password hash with this old code used for verifying login credentials how would i go about doing that? I have the registration working, it creates the hash passwords and stores them in the database, but i cant get the login verify to work. EDIT: I changed it to the current w...

 
8:45 PM
I love it when I already acted on a linked question. Makes me feel all gispy and shit :P
 
okay.
 
@Fabien awesome & sad at the same time...
 
@JoeWatkins 5 minutes? What size of hamster are you buying?
Also, what happens when the hamster dies? Rotate passwords?
Also, what happens if the hamster runs away?
Also, I prefer gerbils.
 
Hello
i'm having a dynamic form
3
and that form i'm using its values in the backend PHP.. so i'm serializing the form values and making ajax call to php
php looks if certain $_Requests exist
on the HTML side: <input type="text" name="project_1">
<input type="text" name="project_2">
<input type="text" name="project_3">
<input type="text" name="project_4">
 
@JoeSaad do not use $_REQUEST. Use $_GET or $_POST (depending on your form)
 
8:59 PM
the php retreives those values depending on the how many projects are there and runs a loop to retreive accordingly
 
Would it be inaccurate to refer to collection operations such as any, all, first, last, etc., as "aggregations"? They aren't performing a full collection reduction as in the case of reduce or sum...
 
for ($i=1; $i < 10; $i++) {
$projRoles.$i = getIfSet($_REQUEST['projdescitems_'.$i]);
}
where that function is:
function getIfSet(&$value, $default = null){
return isset($value) ? $value : $default;
}
 
any ideas?
 
@DanLugg anything that aggregates values would be accurate, wouldn't it? So all sounds right, but ones that return singular values... hmm
 
9:01 PM
<input type="text" name="project[]">, foreach() empty() and indeed use either $_GET or $_POST
 
that loop takes forever to run and see over those values
@PeeHaa ok i got the first part, can you please elaborate
i'll use post
that's not a problem..
the php looping for all those elements takes forever
 
@KevinMGranger Yea, first/last are more like filter, except they just return an element. any/all are just predicates, but any can short-circuit.
 
@JoeSaad oh I didn't answer your specific question. Just made it more sane :P
 
Right now, I've externalized the behaviors into classes, however ones that pipe the collection along are enumerators and ones that end in a non-collection value are aggregators
So I've got MapEnumerator implements Enumerator and ReduceAggregator implements Aggregator
But then I have AllAggregator -- which seems off for some reason.
 
9:04 PM
@JoeSaad $projRoles.$i = ... I think this is your problem
 
@Patrick so what should i do?
@Patrick i think you are right
 
@JoeSaad Use an array.
 
i commented that line and the script didn't take that much time
 
òk who pushed the last changes to main? Stop tweaking the fucking templates
 
$projRoles[$i] not $projRoles.$i because it looks like you're trying to use varvars, which would actually be ${"{$projRoles}{$i}"} -- but don't do that.
 
9:07 PM
but the php script doesn't know the how many fields have been added on the frontend
 
5 mins ago, by PeeHaa
<input type="text" name="project[]">, foreach() empty() and indeed use either $_GET or $_POST
 
^^
 
^^^
 
^^^^
 
Is stackoverflow.com/questions broken for everyone or just me?
 
The bottom questions are misaligned and shit
 
@JoeSaad 3v4l.org/LmuCE this is what you are doing
 
@PeeHaa floating problems?
 
@HamZa yeah
 
Who cares about new questions :P
 
9:09 PM
True :)
 
We have enough questions.
SE should have "answer hour", where the asking of new questions is disabled.
 
ThW
morning
 
ok, i'm getting it now..
thanks so much guys!!
everyone :)
 
@ThW Morning
 
ThW
hhvm finally fixes the dom node bugs, yeah ....
 
9:17 PM
@JoeWatkins Wait, seriously?
 
1524
Q: Proper use cases for Android UserManager.isUserAGoat()?

Ovidiu LatcuI was looking at the new APIs introduced in Android 4.2. While looking at the UserManager class I came across the following method: public boolean isUserAGoat () Used to determine whether the user making this call is subject to teleportations. Returns whether the user making this ...

^ people at google :P
 
If so that is freaking awesome.....I was looking into the behaviour when PHP runs out of memory. Altering was going to be a nightmare, as the gc_collect_cycles needs to have access to TSRMLS; but because the allocation code knows nothing about that it was looking impossible to alter the behaviour.
But if the TSRMLS are available wherever - then it becomes not a nightmare.
 
@DanLugg hahahaha
 
lulz
 
9:35 PM
I am writing a function that checks that a zval contains something that matches the type check (zend_type_decl and an optional zend_class_entry).
I am not sure what to name it.
zend_check_type? zend_verify_type?
 
I cannot wait for return types.
 
10:00 PM
@FlorianMargaine Ew, no
 
@AndreaFaulds I just thought about your RFC :P
 
Using & to implement isset is a horrible hack
We have null coalesce now...
 
in php 7 or php 5.6?
 
zval_is_type() is what I have, but... dunno about that.
 
10:18 PM
@DanLugg I cannot wait for return types.
 
Hey, what do you guys think of the for this:
static zend_bool zval_is_type(const zval *variable, const zend_uchar type, const zend_class_entry *type_ce TSRMLS_DC)
I hate naming things in PHP core. So hard :/
 
@LeviMorrison Maybe zval_fits_type? It's not that it's an exact match, it's that it fits that typehint
If that makes any sense
 
That's better.
 
ARGH
PHP-src doesn't use const qualifiers nearly enough.
I want to make sure I have one little thing that's const and BOOM everything gives warnings now even though it is const.
But that propagates into other things, etc, and now I'm changing half of zend to make things const.
 
@Duikboot Then you need to read The Breaker :)
 
ThW
@HamZa actually I just have
 
@ThW Where are you at?
 
@JoeWatkins So... why do so many zend_string methods use it?
 
ThW
10:44 PM
seuol is going to explode
 
Oh, up to date :)
I'm really excited for tomorrows chapter. Again, I'm afraid there will be another delay in its translation but I might just check out the RAW version :P
 
ThW
:-)
brb
 
10:58 PM
Oh man, a realisation I just had...
So, the University traffic-shapes SSH down to 4mbps because of tunnelling, but allow 20mbps for HTTPS
But, wait, what protocol does Tor use? ;)
:D
 
@AndreaFaulds you really want ssh over https? :-D
 
@bwoebi No, I don't. I mean (unfiltered) web browsing.
 
phew :-)
 
Though SSH over SSL (or just plain telnet over SSL) would make sense, to avoid filtering... except who needs 4mbps for a terminal, and I use mosh
I should try FTPS instead of SSH for my file downloads, though.
also, for some internals discussions I just, well, stop reading
too tiring and pointless
 
@AndreaFaulds I only lurk on internals and I have to take long breaks from time to time. I don't know how you guys can do it. It would drive me insane.
 
11:08 PM
Oh, the insanity goes without saying.
 
Well, I'm really excited about some of the changes coming. Even though it might be a long, arduous process it is awesome to see you guys making progress with these things.
 
Wrote a new chapter for the vanilla php tutorial. I'm sure I messed up a few things, so let me know what I need to fix :)
 
@LeviMorrison zend_string methods? The primary API certainly doesn't use it.
But just guessing at what you might mean, the empty interned string is part of the compiler globals, so that needs tsrm
 
11:26 PM
@NikiC Do we have a zend_string_equals that works for case insensitive comparison?
 
@LeviMorrison Wouldn't we just use strncasecmp?
 
Yeah, I guess.
 
Except, wait, that's dangerous, because Turkey. Don't we have a zend_ thingy for lowercasing? So therefore our own comparison function
 
11:51 PM
@AndreaFaulds that's wise… ;-)
 
@cspray Patience and effort required ^^
Venting off-list helps sometimes.
 

« first day (1482 days earlier)      last day (3482 days later) »