« first day (1628 days earlier)      last day (3320 days later) » 

4:00 PM
@Ocramius So, how often do you overwrite Exception::__toString() implementation?
 
note: a dockblock on top of nothing is definitely not OCD friendly
 
oh, /r/PHP made everyone philsturgeon
except for philsturgeon
 
@marcio that's why I left the actual abstract method definition there... but I had to comment it out so that people could actually implement it without PHP yelling about strict standards
 
posted on April 01, 2015 by kbironneau

/* by Bruellhusten */

 
Anonymous
@Andrea yeah, that's why we are posting silly questions; )
 
4:09 PM
@Rican7 and now you have a docblock documenting a comment :D But let's not discuss this because somebody might think it's good material for a PSR: Documenting Commented Code :P
 
haha, its a PHP limitation that's causing me to comment it out, but yea it looks silly
I'd rather have good documentation for my users though, than care about some semantic like that
 
@Rican7 I don't really care. BTW I would never read any docblock inside a class called AbstractDelegateHydrator. The library looks fine ;)
 
@marcio no reason to be mean, now ;)
 
no. good job, really.
 
:) thanks
 
4:19 PM
Good morning people
 
morning :)
 
Nigth :D
Hi from Ukraine.
 
@NikiC I usually don't... I never cast exceptions to string IIRC
 
@Ocramius Good. If you're not doing it, I can safely assume no one else is either
6
 
Since PHP does not support inner classes, how do you implement the Builder pattern with having the parameters of the Buildee class private and inaccessible?
 
4:26 PM
You don't - why would creation of the class require the use of the builder?
 
@ziGi Closure::bindTo() to change the scope
 
@lisachenko can you use it to change the scope of the Builder class?
 
I can take a method from Builder class, convert it to the closure and run it in the scope (and instance) of another class.
 
@NikiC I do it occasionally. It's useful for when the extended exception has more information available to it than just line number, file and plain error message.
 
$method = (new ReflectionMethod('Builder', 'build'))->getClosure()->bindTo($anotherInstance, Another::class); $method()
 
4:29 PM
@Danack That might be a problem then
 
@lisachenko sounds a bit hacky
if I have 50 properties to be built from the Builder then I have to bind 5 setter functions from the Builder class. Kind of defies the purpose
 
I think that ignoring __toString for the purpose of displaying uncaught exception errors is a necessary precondition for diplaying engine exceptions like ordinary exceptions
 
@ziGi probably, @Ocramius and \me are master of dirty hacks )
 
Drupal does something like that
 
@lisachenko not really pretty
it kind of defies the purpose of the whole thing
 
4:32 PM
@NikiC Do you mean real uncaught exceptions, or exceptions that are caught by the uncaught exception handler?
 
@Danack real uncaught exceptions
 
@ziGi but this is an engine for hydrators/dehydrators, so it's one of possible ways to do this
 
hydrators/dehydrators?
 
@ziGi Dehydrator is alcohol basically
 
4:33 PM
@ziGi it's a common naming for Doctrine ORM )))
 
@NikiC anyone who has those has bigger problems...
 
I though it's a library for transition of data from arrays to objects and vice versa
 
@nikita2206 rofl
 
@ircmaxell Not totally sure what this should tell me
 
4:35 PM
@ziGi yes, you are right. It was a metaphor. Just mapping from arrays to objects and back...
 
I'm referring to the way how fatal errors generated by uncaught exceptions currently just stick Exception::__toString() into the error message
And wondering if it would be particularly problematic, if this would no longer honor __toString and instead use always use the "standard" way of stringifying it
 
@NikiC why not "Unexpected " . get_class($exception) . ': '. $exception->getMessage() ?
 
@lisachenko There's also a stack trace
 
Exception::_toString can contain a lot of mess...
 
4:39 PM
@NikiC and nested exceptions as well
 
yes
 
is it possible to have a "normal" trace for fatal errors?
without XDebug of course...
trace can be copied from the Exception->getTrace() for fatal exception
 
@lisachenko I think this is a better solution -> dsheiko.com/subpage/builder-pattern
 
@ziGi better solution is just to use DiC
 
@lisachenko can you elaborate why?
 
4:46 PM
@ziGi because it's well accepted by community pattern that allows to use Dependency Inversion principle (not to ask from builder something, but just receive from somewhere already initialized instance). Also it preserves SRP for all object initialization, all logic in one place. From that point, builder pattern can be compared with Resource Locator/Singleton patterns. Both are not so good.
 
I see
One final thing, can you give me an example how a dependency injection container can be used
 
Also, builders are per-interface, so you can generate a lot of builders to produce concrete instances of concrete objects, whereas DiC can produce any instances
@ziGi i think there is a good reference on Symfony site: symfony.com/doc/current/components/dependency_injection/…
 
Ok, thank you, I also found that one
 
You are welcome
 
Someone really needs to reply to Francois and say "Are you seriously suggesting that every new function in PHP needs an RFC?"
 
4:57 PM
Although as I can see from the example $container->setParameter('mailer.transport', 'sendmail'); this is using reflection most likely to set the arguments
 
@Rican7 are you following the internals thread?
 
@ziGi parameters are not arguments in symfony, they're just a part of a parameters map. It doesn't use reflection anywhere IIRC
 
Anonymous
@Danack idea for php7: enable class aliases inside classes. What do u think?
 
I think either explicitness is awesome, or that I don't like April fools day.
 
5:05 PM
To be honest I still can't imagine how if you have a class with 20 properties you can use DIC to instantiate and set some of those 20 properties
 
@ziGi through a constructor
 
but that's a telescoping anti-pattern
 
April fools is getting out of control.
 
@Danack is there a generics thread? I haven't been reading internals much since STH was accepted. :P
 
Anonymous
5:08 PM
I'm serious. considering that we have 1file/class conversations it is difficult to put the class_alias function in the same file. So, if only it was possible to make this happen inside the class, it would be awesome @Danack
 
@Rican7 No - unfortunately Francois is being a fucking moron again - news.php.net/php.internals/85639
 
@sam_io you could use use?
 
@sam_io What would be the use case, other than wanting to make stuff more confusing?
 
@Danack oh christ
here we go
 
@Danack This… is an April fools, right?
 
5:09 PM
@Rican7 tbh I don't think you should reply - someone a bit more of a heavy hitter should tell him to stfu, and it's not my turn to do that.
 
@Danack yea, I'll leave it be
 
For the record - this is why I swore last time, he's a not particularly clever person trying to be the boss who makes decisions....even though he is not clever and hasn't contributed anything (as far as I can see).
 
I was happy to have contributed. I didn't mean to stir anything up. And yea, my "noobie" word won't have much pull/meaning anyway
 
@ziGi I think telescoping pattern is not what you think it is
 
Thanks for the heads up man
 
Anonymous
5:10 PM
I'll just do an RFC explain it better
 
@Rican7 You didn't stir anything - there's no way that we're going to start doing RFCs for every single function.
 
We really need a RFC to abolish RFC process. Hmpf. (Not seriously)
 
He's just pissed that he opened an RFC for changing a function and it was not well received - this one
 
When did we get into that state about RFCs? it wasn't like this a few months ago.
 
5:12 PM
hai
 
Anonymous
@bwoebi don't mess with my freedom of expression ;)
 
anyone know how to configure zf2 in godaddy shared host
 
@NikiC HARHAR
 
5:13 PM
my pblm is
controller action is not working
 
@Danack Yea, I mean I mentioned in the original email that I wasn't sure of what process it required since I didn't have RFC karma: news.php.net/php.internals/84320
 
but this all working in dedicated server
pls help me
 
I really don’t understand technology: took me 12 minutes to understand how to send an SMS. Can’t everyone just use hangouts, as normal?
Why can't people use a phone like anyone else (for twitter)?
 
@Ocramius Hangouts still confuses the hell out of me
Also morning room 11 regime
 
Anonymous
12 minutes from apple watch? maybe
 
5:20 PM
@PeeHaa it's the only thing I use for personal communication :X
 
with hangouts they managed to make a gui that is even worse than gtalk's one
 
all this "numeric ID" for "contacting people" is just so useless
 
which is incredible
 
@Ocramius Maybe it is just me, but in my experience even skype works better than hangouts
s/maybe/probably
 
I can't use Skype, as it allows only one screen-sharing user at a time. I usually get my clients on hangouts or gotomeeting
 
5:21 PM
I'm "obligated" to use skype for meetings. But I prefer hangouts even though that plugin is sheitty.
 
i've never used hangouts, does it have obnoxious ads like skype?
 
@StefanoTorresi it doesn't have ads, but its user interface makes up for it pretty well
 
:P
 
@StefanoTorresi Not that I noticed. But the browser plugin is shitty enough.
 
I use skype to call people in other countries
 
5:23 PM
I didn't have any issues with the UI... what's the problem there? the fact that you need to hover?
 
hangouts? what?
 
@Ocramius check your twitter
 
what's that UI? :|
multiple open chats? I usually close them after 3 or such, or detach them to separate windows
 
it's google wankouts gui @Ocramius
 
Ah, wait, you installed the desktop app?
 
5:25 PM
it's a chrome extension, the only existing afaik
 
@Ocramius it's all like "HOW'S THIS SHIT SUPPOSED TO WORK? WHERE SHOULD I CLICK? WHY IS IT LOADING SOMETHING NOW? WHAT HAVE I DONE?" I feel like an old man when I have to use any google product
 
the one i personally hate the most is facebook webchat, that is incredibily aggravating, expecially when it turns itself on for no apparent reason
 
never used that: browser interaction with max 3 people is enough. Also, I don't use chrome ;-)
@nikita2206 eh, I feel like a dinosaur when I have to do anything with phone numbers. Anything with a phone number triggers a phone call or such
as for FB, I'm lucky that:
(mainly because I'm not interested in hairdresser drama. PHP drama is enough)
 
rofl
 
5:29 PM
@Ocramius Well in the time that I posted that and now...I've done SOOOO much. It's crazy. :D
 
@MatthewH IKR? And how much of that will need a rewrite by a top-paid consultant? :-)
/me is a bit poisonous today
 
Actually, not much. Followering PSR standards ;)
4
 
so true
lol
 
I think it was PSR. Not sure
Off the top of my head
 
stabbit, you're killing me!
 
5:31 PM
Plus the guy I'm working with, I'm learning a lot more from him.
 
yeah you can't do nothing wrong while following PSR :D
 
#sarcasmdetected
 
@MatthewH yep :P
 
I mean, I knew ways of doing things, but he's commiting even cleaner ways of doing it and I do the rest of it a clean way. :)
 
@MatthewH I'm literally laughing my ass off. Sorry, I'll make up for that, but lemme have a good laugh :D
Seriously tho, I hope the mentor is good at design :-)
 
5:35 PM
There was a time where I thought I code in a "clean" way... I was sooo wrong... But I realized I suck when I came to this room and have learned a LOT since then (or at least I know what I need to learn)
 
It's fine. I guess the standards are a joke more or less. It just helps me keep unity in the code style. Just so he's not like 'wtf' when he sees how I layout my code.

I know I don't code cleanly. Then he came in and helped clean it all up ;)
 
neat
 
@MatthewH nah they're not a joke at all, there actually are people that work hard to make them. but they're not a guarantee of doing things right, at all.
 
@MatthewH Chances are that his code isn't all that maintainable either, I'm not saying it ain't but from my experience most people suck at producing great maintainable code
 
Like I kept doing DB::tablewhen I should be doing things like User::where
 
5:38 PM
@MarcelBurkhard "most people suck" is enough
 
@MarcelBurkhard Define maintainable in that context.
 
@FlorianMargaine well thats true aswell :D
@MatthewH testable, readable, extensible, ...
 
@MatthewH The minimum number of seizures per second
 
@PeeHaa lol :D
 
@Ocramius stopped laughing yet?
 
5:43 PM
still catching up with breathing
@sam_io holy moly!
 
@sam_io what has been seen cannot be unseen
 
Anonymous
Yeah, I know
 
Anonymous
I should repent soon
 
@salathe ping
 
Anonymous
It started as a self-challend/code-fun thing to see, just how much can you do in php with just 100 lines of code.
 
Anonymous
5:49 PM
apparently, debugger, router, crud, http, and sanitization ...
 
Anonymous
not bad PHP, not bad at all
 
If I pass the following object user back (with sub-properties), how can I get its content on the PHP side of things?
service.AddUserTest = function(user) {
      return $http.post('./Scripts/tryToRegister.php', {user:user});
    };
 
Every time I look at the reserved types RFC I get annoyed. It could have been an instant pass had it just been case-sensitive
gah
 
Do I have to point something like this, at 'user' somehow?

$data = json_decode( file_get_contents('php://input') );
 
@Austin Can't you just do $_POST['user']?
 
5:52 PM
@PeeHaa depends if it's sent as json
 
@PeeHaa that is an undefined index, PHP says.
 
@FlorianMargaine Yeah not sure whether it whatever it is sends it encoded or not
Looks too javascripty for me to understand ;)
@Austin In that case looks like you indeed should do what you do now :)
 
I am trying to match up the right send, with receive. What I am turning it FROM, is something like the following

service.AddUser = function(name, password, summonername, summonerID, email, callback) {
      $http.post('./Scripts/tryToRegister.php', {name: name,password: password, summonername: summonername, summonerID: summonerID, email: email})
        .success(function(response) {
          callback(response);
        });
    };
Which PHP could read as..
$data = json_decode( file_get_contents('php://input') );
$name = $data->name;
$password = $data->password;
$summoner = $data->summonername;
$summonerid = $data->summonerID;
$email = $data->email;
but now I am just making it a whole object containing that, so I am not sure how to do that.. would it maybe be $data->user?
 
@Austin I personally always pass true to json_decode
 
@PeeHaa What do you mean?
 
5:56 PM
@Austin var_dump() is your friend here
@Austin It gives you an array instead of a stdclass
 
@PeeHaa Sorry new to PHP, I have been mysqli_error, so var_dump will give me more raw data?
 
i.e. var_dump($data); so you can see what it contains
 
Anonymous
@Austin var_dump($data)
 
Anonymous
if($_POST){(
 $foo = (object) $_POST;
 $foo->name;
}
 
Ah I got it!
$data = json_decode( file_get_contents('php://input') );
$data2 = $data->user;
$name = $data2->name;
$password = $data2->password;
$summoner = $data2->summoner;
$summonerid = $data2->summonerID;
$email = $data2->email;
I just literally called the object the same way, then assigned stuff that way
 
6:00 PM
Or just $data->user->name
 
OOOH :D
 
;)
 
Thanks everyone! :)
 
@sam_io i'm not sure that works because IIRC angular's $http doesn't send data as application/x-www-form-urlencoded
i may be wrong tho
 
Anonymous
@StefanoTorresi Well, I am not familiar with angular, so I can't say anything. :)
 
6:05 PM
Does anybody know if x-sendfile uses the apache caching configuration? I can't seem to get the caching working :(
 
Anonymous
I probably should start learning it. Every job on the market has a thing for angular these days.
 
@sam_io you should however evaluate react js too
from what I read its "better"
 
@sam_io you'll love it, the first 2 hours
 
Anonymous
I'll give it a shot, but my problem now has to do with the concept and what it can/can not do at all. So, I will go with angular, as there are more tutorials, and better more community.
 
wait for 2.0
 
Anonymous
6:08 PM
I guess, once you understand the concept, it could be easy to switch
 
1.x is deprecateware
 
@sam_io there is more tutorials for mysql_query spaghetti code compared to pdo, doesn't make it better
 
Anonymous
true
 
Anonymous
I am not sure if angular is that bad though.
 
Anonymous
I can see already some lynda/pluralsight tutorials for angular. but non for react
 
6:12 PM
@sam_io community is not better at all, it's just bigger. you would do fine with emberjs too. angular is more spread, so it has the same problems of any widespread community: very low quality bar, but A LOT of resources.
 
> You do not have access to use this feature!
uggggh why can't I reset votes?
 
seriously though, wait for 2.0 or you'll eat your hat.
they removed a lot of nonsensical stuff
 
@StefanoTorresi Lots of BC breaks right?
 
Anonymous
@StefanoTorresi You really think the current version is not good to get the basic idea?
 
@PeeHaa yep, a LOT, but an angular app usually has a codebase so thin that BC breaks are not difficult to deal with
@sam_io well it is, sure, but as soon as you start actually making stuff with it, you will lose your mind
because it's brilliant and awful in equal parts :D
 
6:15 PM
Are we still talking about angular or php? :P
 
My favorite April Fool's Joke, from BBC News in 2012 http://t.co/ggyCT9RVKX
 
Anonymous
@StefanoTorresi So, are there any time-frames for v2?
 
q3 2015 IIRC
may be wrong tho, GIYF
 
6:20 PM
 
Anonymous
@StefanoTorresi silly question. Can you do with (angularjs, foundation, bootstrap) anything that is done with jQuery ?
 
@sam_io absolutely
 
@PeeHaa it's actually true
 
@ircmaxell Yes, but who would create a benchmark to test that? :P
 
@sam_io angular-ui.github.io/bootstrap that's pretty common
 
6:22 PM
who and / or why ;)
 
@PeeHaa micro-optimization
 
I think we need a whole new level for this :P
nano-optimization!
 
nevermind, it's not true
it gets compiled to identical code
 
yeap
hmmm let me get back to that note and burninate it
 
@sam_io tho consider that jQuery is quite distant from the concept of "framework" compared to angular/backbone/ember. it's more of a library like lodash, so you can use that like you would use any super bloated library in any project :p
 
Anonymous
6:27 PM
@StefanoTorresi Anything I have to do with Javascript, has something to do with AJAX always. So, I'll probably use angularjs for this reason only.
 
Anonymous
I understand jQuery has a nice API for that
 
that would be as overkill as loading the entire jquery to only use jquery.ajax. you'll surely find a streamlined version of an XHR client somewhere
but, if you want to play with it, yea, why not
 
hello
 
Anonymous
@StefanoTorresi Actually, I use vanillajs most of the time, unless I need some other things
 
I'm a university student, I'm doing a project with three collegues in which we're building a website with php
 
Anonymous
6:31 PM
function XMLHttp(){
    var xmlhttp = false;

    try{
        xmlhttp = new XMLHttpRequest();
    }catch(e){
        var IEversions = new array(
            "MSXML2.XMLHHTP.6.0",
            "MSXML2.XMLHHTP.5.0",
            "MSXML2.XMLHHTP.4.0",
            "MSXML2.XMLHHTP.3.0",
            "MSXML2.XMLHHTP",
            "Microsoft.XMLHTTP"
        );

        for(var i = 0; i < IEversions.length && !xmlhttp; i++){
            try{
                xmlhttp = new ActiveXObject(IEversions[i]);
            }catch(e){}
 
Anonymous
that's my bulletproof code :)
 
@sam_io You really don't need those ie fixes I hope
 
is that IE 3?
 
@StefanoTorresi not sure… but looks like the x axis is in the wrong direction…
 
Anonymous
@PeeHaa sadly, I do. Most of my sites visitors are from Ethiopia/Eritrea
 
6:32 PM
jesus your people suck
 
Anonymous
you would be surprised, how long a computer lasts in those areas :)
 
That must be painful to do anything for :(
@sam_io hehehe
 
but I need some advice actually for some things
 
Anonymous
@PeeHaa Eritrea is even worse. It takes sometimes minutes to load a page. Youtube never works.
 
Anonymous
No one in Eritrea has seen a video on youtube :)
 
6:35 PM
:P
 
can someone give me some advice ?
 
You didn't tell us what you are looking for. So...
 
@sam_io there is a bit more to angular's $http than that ;)
 
ok , the thing is our website
needs security and a high one(let's say we'll do good not high, high is hard for a student)
and we know nothing about security
 
Isn't getting high all being a student is about?
2
 
6:41 PM
@bwoebi i feel ya ;)
 
Anonymous
lol
 
@niceman pay someone who knows about security
 
and we're especially talking about hackers
 
Anonymous
and English
 
@FlorianMargaine but I don't know any
 
6:42 PM
@StefanoTorresi yes. Time goes backward with Angular getting better…
 
@niceman that's why you need to pay them
 
I'm just confused as to what should I start from, I love books but don't know what to read, and should I get hackers tools and learn how they work(without tring them on real ofcourse)
 
well, you should've picked a different topic :P
 
@MarcelBurkhard man, if I don't know them how do I pay them, well that's our project, what to do ?
 
Anonymous
@niceman google
 
6:44 PM
@niceman When trying to prevent something you would indeed at least have some basic understanding on what you are trying to prevent against
 
@StefanoTorresi From "oh the most fantastic framework ever" down to "oh, yet another JS framework"
 
This is a decent starting point
 
@niceman It's just for university right? Security is an illusion, so just pick some common vulnerabilities and adress those... (XSS, mysql injection, CSRF, ...)
might be enough ;D
 
@bwoebi it's just the curve, you're on the low side of it atm, you'll appreciate it again in a while, to then come back despising it again :D
 
mhm.
 
6:46 PM
@MarcelBurkhard well yes but they mark you, they don't expect high but they expect to see what you told them and I mentioned "good security"
 
@bwoebi in the meanwhile, tho, learn react! ahahahah
 
well we decided to use codeignitor
 
@niceman head -> table
 
wouldn't that take care of mysql injection ?
@PeeHaa I'll look for that , thanks
 
@StefanoTorresi React? php or js? the php variant is shit and slow (well, mainly slow and so shitty unusable) … js variant, no idea.
 
6:47 PM
@niceman that's why I said adress the most common ones (another one that pops to my head is brute force)
 
the js thingy that no one has come up with a definition for yet, because it's not a framework
 
@niceman I guess it will take care of mysql injection, and it might even be taking care of other things, but the framework still sucks and advocates bad code design.
 
@MarcelBurkhard what framework do you advice us then ?
advise * sorry
 
@niceman composer ;D
 
@MarcelBurkhard wait, are you talking about codeignitor 2 or 3 rc ?
 
6:50 PM
@StefanoTorresi JSX … XHP sucks and so does jsx.
 
@bwoebi yea, i'm not a fan either
 
@niceman doesn't matter
 
ok , got it , is composer easy to learn ?
 
@niceman well... that's a though question and composer is not a framework, it's a package manager
@niceman it is, but you can't stop there :S
 
@MarcelBurkhard ahhhh, so it can help me find libraries ? frameworks ?
 
6:52 PM
@niceman are you serious about php or will you drop it in favor of another language after the university project?
 
@MarcelBurkhard I learned it this semester, if you're asking about asp.net , well I must see facts to decide which to use
 
you can tell it what libraries you want, and it installs them for you, there is a lot of superb libraries that are specialized for exactly one thing (e.g. a router, or a template engine) and you'll need to wire them together
however that'll take time and If you don't care much about php I would advise you to just go with the symfony2 framework
 
symfony2 is a framework for php, I wouldn't program a plain php
well that has a netbeans support and that's the IDE we're using, thanks but is it easy to learn, the thing is well we have many projects and courses, learning is fun but time argues
 
My god… we really need the Vanilla PHP framework
 
@niceman it has a large community and thus a lot of resources to learn from
 
6:57 PM
@MarcelBurkhard thanks, going to tell my friends, ok farewell now
 
@bwoebi make it more attractive
@niceman good luck, cu
 
@MarcelBurkhard the input/output sucks… but everything else…
 
@bwoebi you use composer right?
 
yes
 
alright, and you use a router, and maybe even templates?
 

« first day (1628 days earlier)      last day (3320 days later) »