« first day (1937 days earlier)      last day (3011 days later) » 

6:01 PM
@ircmaxell PHP has a strict mode?
What does that do?
 
the certificate at youtrack.jetbrains.com/issues is untrusted. Is there an easy way to see why exactly? i.e. completely spoofed cert, revoked cert. etc?
 
trusted for me
 
trusted for me and ssl labs
 
me as well
@ircmaxell I'd strongly suspect that
 
Anonymous
same
 
6:06 PM
^^
I'd hazard it's a browser thingy
 
Wes
@FélixGagnon-Grenier i don't do motorcycles nor videogames
 
@Danack You share it's not bitching about sha1 signing?
 
horree shit - it's trusted when I switch to 3g.
 
Wes
but i'd do sports cars if i had the money :B
 
lolwut
@Wes counts as motorcycles :p
 
6:07 PM
@Danack Burn eberything down and start over
 
How can i do it
<?php

class Base
{
public function show()
{
echo 'Hello '.$name;
}
}


$name = 'John';

$obj = new Base();

$obj->show();
 
@Jeeves, please do it
 
is there any way?
 
Wes
by the way, i'm seriously thinking to buy an used ferrari from the late eighties :B just for keeping my "idiot" reputation active, i mean
 
6:10 PM
lol!
How you :P
 
Wes
a 348 to be precise, about 50k euros
it's not very expensive @PeeHaa :B
 
@PeeHaa can i pass that variable to the method?
 
Wes
i'd buy a new car but porsche's are a cliche, japs are meh currently and no other options available
could buy a corvette but they are so rare here
 
Anonymous
Can someone pls check this script on how to compile php from src I made this about a year ago. It still works, but I need to know if needs some improvements.
 
Anonymous
@PeeHaa get to work ^^ :)
 
Anonymous
6:15 PM
meh, git and autoconf are actually redundant.
 
Enable remi repo and yum install php70 :P
 
Anonymous
@PeeHaa that is sooo 2005 :p
 
Wes
ok i'm getting a corvette. 2007, 70k km, €30k and manual gearbox @JoeWatkins @Jimbo
 
Anonymous
The script irks me a little, because I can't access config files or logs in /etc/php.ini or /var/log/php
 
Wes
@PeeHaa tell me something like "think of your future, don't waste your money"
 
6:20 PM
Fuck the future. Buy the thing already!
 
A 2007 vette for ~$30k is a lot...
 
@Wes Wait, 6 Litre V8?
 
Wes
@Machavity in europe - italy. never seen a corvette here, they are as rare as jesus comings... so i guess it's the right price
@Jimbo yes. i can't afford the petrol, but what the heck, it's red :D
 
@Wes would you have to stop to for petrol, change the oil, or fix the engine most frequently?
 
Wes
@Danack second time you ask me that question :B
 
6:23 PM
MORBO DEMANDS ANSWERS
 
@Wes Ah... that woul explain it
 
I grabbed the certs I get from openssl s_client -connect youtrack.jetbrains.com:443 -showcerts for the 3g and ADSL connection - can anyone interpret the runes? gist.github.com/Danack/d754dca28cbc70466812
 
Wes
you might not believe it but i'm pretty sure that v8 consumes less petrol and oil than my current 1.3 liters engine
 
the 'Master-Key' for something seems to be different.
 
Am I right in thinking that the difference between trait and and include is that include cannot include class fragments but only complete class definitions?
 
6:27 PM
@QuolonelQuestions that's one way to look at it
 
@jbafford Thanks bro. You truly are the hero of this chat
 
@QuolonelQuestions Not quite. An include can stand by itself. A Trait cannot be instantiated or used without a parent class
And you can use include inside a class, it's just messy
 
@Machavity What? Isn't that implied given that one can only represent a complete definition and the other can only represent a fragment
 
@Machavity how would you use include to add additional functions to a class?
 
@jbafford you can't use it to define the class, but you can use it to define values within the class. I should have been clearer
 
6:31 PM
putting a method in a file
then including the file? doesn't include just like "pastes" code where it's called?
 
Using includes like that is not considered a best practice tho. Traits help a ton because they can be auto-included
 
@FélixGagnon-Grenier except you can't do that.
 
right. include in a class body will cause error
 
you can't use include in a class outside of a function. And inside a function, any further function definitions are actually global functions.
 
@Wes Nice! Never seen that one before, not many on auto trader in the uk
 
6:35 PM
no, an include needs to be syntacticaly valid php
 
Wes
rare here too, only 4 on autoscout. i heard it's a good car @Jimbo not supercar level but close, also not as pretentious as one of these... or even a merc, porsche or bmw
i'm so going to do this. lol
 
@wes I had a great Aunt once who had been to Europe a lot. Would never buy a Mercedes because they were taxis in Europe
 
Wes
german cars are like a businessman's suit
they are perfect, but they miss something
 
heh. throw in a tatoo
 
They bought a new BMW and drove it around Europe for 6 months, then had it shipped back to the States. Was cheaper now because it qualified as used
 
Wes
6:48 PM
@FélixGagnon-Grenier they miss the lunacy
 
Anonymous
Damn, forgot to compile php with intl extension :/ now I can't use CakePHP.
 
Anonymous
Is there any way to get around this?
 
Anonymous
can extensions be compiled separately and then integrated to the src?
 
> Is there any way to get around this?
Don't accidentally download CakePHP?
And just enable the extension and compile again. Only the bits added get recompiled.
 
Anonymous
I have an internship of 2 weeks beginning on Monday. Sadly, cakePHP is the latest technology thing there.
 
Anonymous
6:53 PM
@Danack do I have to just mention that extension or add it to the original list?
 
What is your opinion on saving files as base 64 on the filesystem?
 
Why on earth would you
 
Anonymous
It takes more than 10 minutes to compile, that's why I am reluctant to do it.
 
@samayo do configure again with it added to the big list of extensions, and then do make install again. Only the added files will be compiled.
 
Anonymous
6:55 PM
Yeah, that's what I was afraid of :\
 
@Wes Looks lovely and will do 0-60 in less than 4.5 seconds
Brilliant
 
so saving as base 64 is a bad idea? Just saving the file as is is better? Or save as binary?
 
Sorry I forgot the question mark
> Why on earth would you?
 
I was just wondering if that was a viable solution. Lol your question affirmed that it wsan't
 
solution to what?
 
6:58 PM
to saving images lol
 
yeah that makes no sense at all
 
What would be your go-to solution to saving images?
 
Save it as... an image?
 
Anonymous
save it as money
 
I like that idea, samayo
Anyone familiar with Slim PHP?
 
7:04 PM
@user2800382 are you like trying to do somesort of dynamically serving images through php script, after manipulating them?
 
I'm actually trying to save images through an ajax call.

An Ajax call to a POST route on SlimPHP

But I'm having trouble accessing the 'file' in Slimphp
 
save the base64 decoded (assuming you sent it as base64 encoded string) in an image file in your public directory
 
> in an image file in your public directory
That is not wise.
 
hmmmmk I give up. what do you mean?
 
if they're in the public folder they can be invoked directly.
If you don't sanitize all files properly....they could contain PHP code.
 
7:08 PM
oh
hmmmm
can a .png file really be executed as php?
 
put them in a data directory, and serve them through something like readfile()
 
@FélixGagnon-Grenier I'm gonna try to circumvent sending base64 string. Rather just save as file. I posted a question on slimphp to see if anyone knows how to access the file from $request object
 
@FélixGagnon-Grenier sure, if your server is misconfigured or you use include on it...
 
because any file containing <?php can be executed as PHP.
 
@Danack a PNG file, yes. A file ending in .png usually not…
 
7:49 PM
okay so I have a model class, and I have an API which uses it. how should I handle errors? Should the model class throw, e.g., ExistingEmailAddressException if you try to register a user with an email address already in use? Should the API catch that and return some error code?
 
@Andrea Check if the email exists (gracefully, aka a boolean value) and then throw if for some reason it couldn't be inserted (like an unique key constraint violation because of two simultaneous registrations)
 
@bwoebi gracefully? So I should do what, return null?
but if I return null, how do I know what the error was?
 
I would throw an exception if it's a show stopper (i.e. other processes rely on the email record succeeding)
 
@Andrea well, the check returned false, so you know?
 
@bwoebi I know there was an error, but that's it
or are you saying the caller (the REST API controller) should check if the email already exists?
 
7:53 PM
@Andrea I mean, you check for the specific thing first, before event trying to register the User
yes, the caller
 
that's a race condition and also duplication of effort
 
It's not a duplication of effort. And yes it's a (unlikely) race condition.
The database will handle the unique key
 
for this case yes
 
Yes, that will end up in you not exactly knowing what failed if the database insertion failed, but this doesn't matter
 
what about, say, validating a username?
 
7:56 PM
@Andrea still responsibility of the caller. The low-level insertion routine shouldn't validate an username (like you might (theoretically) once insert fake users)
the task of the insertion routine is maintaining integrity, not validity.
 
hmm :/
 
That is … if you want to avoid using exceptions for flow control, which is my design philosophy. You can surely do it the other way round, it's not wrong per se, but IMHO not the cleanest way … but just IMHO ;-)
 
well, ideally I'd have go style err = ..., I guess
 
which is basically like light exceptions^^
 
@Andrea "that's a race condition" - multiple trying to register at the same time is a race condition....and yeah, duplication here is good. It allows you to separate normal errors from exception errors.
try {
     if ($model->isEmailAlreadyRegigistered($emailAddress)) {
        // normal error handling here.
        return;
     }
     $user->addEmailAddress($emailAddress); //This throws.
}
catch (ExistingEmailAddressException $eeae) {
    // possibly different error handling here....like rate limiting the IP address.
    // or logging at a higher priority than normal.
}
 
8:05 PM
@Danack right, but this then should be a general exception that anything failed.
 
why?
A duplicate email is a useful thing to know about.
 
yes, in the normal handler
but not to catch
 
I'm going to be like Marco and not argue with you on this. You've got strong opinions, which is nice! but you're just wrong about what is useful in larger applications.
 
/me cringes
 
@Danack true, the biggest/most complex application I've ever architectured is Aerys. I've done other things, but that's more like a simple interface serving a bit collected data from a database in various ways.
 
8:19 PM
@Ocramius Which continent are you in today?
 
@Danack with the penguins in Antartica, I'm sure… (reference to twitter.com/Ocramius/status/693935973936267264)
 
lol php
 
I'm going to stick with my original plan.
UserManager::register throws exceptions on failure. The API catches the ones it's aware of, gives generic error otherwise
it makes the code neat, so I'm happy
 
@Danack Teutonia
Gonna be rainy island again in a few weeks
 
8:39 PM
Passing Bristol? And we're not really that rainy.....it's just that the grey makes it feel like it's raining, even when it's not.
 
SO new mobile ui is pretty good
 
@Danack nope, gonna be at PHPUK
 
I swear, Yasuo should just rewrite ext/session
Session2 or something
 
Or maybe drop sessions and make them work in userland <_<
 
PHP's built-in session handling is a strength
hey, another question
 
8:47 PM
it is a mess that is abused most of the times, and the default doesn't really work for large setups anyway <_<
 
for Exception subclasses with nothing added, should they get their own autoloadable file, or should I just put it in my UserManager.php file along with my UserManager class
 
@Andrea just their own file - principle of least possible astonishment when somebody tries to instantiate them outside the context of your lib
 
@Ocramius was thinking the same
Hmm, I just realised that my API client will probably look basically the same as the model used by the API
might even throw the same exceptions :p
 
If they are specific enough
 
API\UsernameAlreadyInUseException -> HTTP/1.1 40something Blah -> API\Client\UsernameAlreadyInUseException
 
9:00 PM
AMAZE \o/
Super pleased to announce release of @RoaveTeam Better Reflection 1.0.0! read about it at http://jamestitcumb.com/posts/better-reflection-1.0.0 & https://github.com/Roave/BetterReflection
 
@Ocramius WOOOHOOO
 
@Ocramius composer.json … nikic/php-parser … ah alright then.
 
About damn time. Now I can finally do more horrible things - this time with autoloading!
 
@bwoebi be afraid, be very afraid
 
@Andrea I am.
@Ocramius does it work with anon classes?
 
9:10 PM
@bwoebi not sure, tbh
I don't think that we reached parity yet
 
And that's already 1.0.0? :o
 
well, yeah, we worked one year on it, time to get people to use it and complain
I tried it with ProxyManager (which is already doing some fucked up stuff, if you allow this technical term), and had some very edge-case failures 6 months ago
this thing will be very useful to do basic security analysis of codebases, IMO
 
posted on February 04, 2016 by kelunik

**[Commit Log](https://github.com/kelunik/acme/compare/4f4109afcd27085afe8a73fadcd05fc6a96e8fdf...01c72e7a3d844e715a0c35e7fe43b35e06b9f7d0)** * Prevent certificate requests with empty `$domains` array. * Retry requests with a `badNonce` error. * I...

 
9:48 PM
farjing headhunters part 2. The go who was pushing me to go for an interview as soon as possible, sent this as the complete job spec.
> The job is making changes to a little APR calculator we built for a small UK bank in C#.
This calculator works out interest rates on credit cards and personal loans. We have sold this to another bank so the app needs “some tweeks” etc.
That was advertised as a PHP role btw.
 
@Danack php, Java, OCaml
same stuff
newbie
 
> The key part to this role is to modify a pier to pier application, which is an investment portal.

There is a screen design already made but it needs to be integrated into the application as well bug fixing and testing.
Even ignoring the speeling, does that set anyone else's alarm bells off?
"We've done the design, all we need is someone to program it."
 
Pier to Pier is awesome - does it involve a lot of Ship-ping?
 
2 days ago, by Danack
Job must be in Brighton.
 
@Danack Yeah... bells... lights... flags... all of it
 
10:00 PM
@Gordon yes
 
10:12 PM
is that an air raid siren too?
 
The whole shebang
 
Seems like a perfectly clear question to me.
There's a lot of words around it, but the question is, "How do I manually close a RabbitMQ channel to simulate an error?"
 
11:12 PM
@tereško Is Google's Clean Code Talks mainly on the basis of TDD?
I was reading/watching stuff from your and a few others people's answers last two days
some of them considers testability of small pieces in overall code as the most important thing, from what I understood
 
Small pieces are easier to understand. Making code testable means abstracting away hard dependencies. Small pieces of code acting on abstractions can be harder to understand than larger pieces of code that have hard requirements on outside resources... but the bang is often worth the buck, especially when dealing with complexity.
The goal with doing tests first (or even tests very early if not doing them first) is to help make sure you're doing small, targeted tests of small, targeted code.
You don't have to do TDD in order to get it right, but it's one methodology that can help.
Personally I can't stand TDD because the code I design to pass the tests often flows very awkwardly otherwise. I'm probably doing it wrong.
 
"You don't have to do TDD in order to get it right," - the thing that TDD actually does is stop the programmer or manager from saying "right, the code works now, let's ship it and not worry about writing tests, or worrying about if the design is even going to be easy to test."
And I hate TDD because I am terrible at api design.....but can write tests for anything......so I end up with a well tested piece of crap.
 
"I end up with a well tested piece of crap." -- me_irl
Sigh.
 
Indeed that makes so much sense. I don't have much experience or complete understanding over TDD but from the description below, it's sounds like a solid structure to follow which would make you easily cover the edge cases on the way.
- "TDD relies on the repetition of a very short development cycle: first the developer writes an (initially failing) automated test case that defines a desired improvement or new function, then produces the minimum amount of code to pass that test, and finally refactors the new code to acceptable standards."
 
"it's sounds like a solid structure"....actually to me it sounds like the phrases used by cults to indoctrinate people....
But some people find it useful.
 
11:29 PM
again, I never used it before nor understood completely...just that it sounds like it could've lessen risks that may come up later on.
Also sounds like more time consuming, but then again otherwise it could've taken even more time in total.
 
Testing in general is time consuming.
You'll often find yourself spending more times getting the tests right than writing application code.
This is intended.
We've recently started doing more detailed breakdowns of our time spent writing, and I've been highlighting our meager automated testing efforts.
The tl;dr of all of it is that there's already a 50% overhead on each project before we even start writing code.
This is fine, it's just higher than we thought.
Actual, real metrics are very useful tools.
 
Indeed they are
 
11:52 PM
Hey @bwoebi @kelunik I noticed the most recent version of Artax doesn't include the default user-agent functionality from github.com/amphp/artax/pull/78. I was wondering if this was intentional?
 
@cspray Definitely not. Maybe I've missed it when cherry-picking
 
@bwoebi Ok, no worries. There was another PR that fixed a bug that was introduced as well. If you'd like I can put together a new PR for this.
 
@cspray nah, I'll just cherry-pick and be fine
minute
 
Ok, just make sure to hit github.com/amphp/artax/pull/87 too
 

« first day (1937 days earlier)      last day (3011 days later) »