logs archiveIRC Archive / Freenode / #php / 2015 / July / 26 / 1
marchelzo_
__adrian: Would you say you love PHP?
__adrian
rather personal don't you think
i love programming. php is the language i know best, fbow.
starmaze
__adrian: so charset in the dsn sets the connection+client charset?
__adrian
starmaze: it's db-specific. i assumed we were talking about mysql (and a current version of php, and the mysqlnd driver).
$dsn = "host=localhost;dbname=foo;charset=utf8mb4;";
starmaze
__adrian: does this have any implications on security?
__adrian
in thorey. not having the charset on the connection declared explicitly when you make it can allow some really wierd charset confusion attacks, which i am not qualified to explain. but i kow it can happen, between non-ascii-compatible charsets.
in any case, it is what shuold be done anyway (SET NAMES was a workaround in the first place).
*should
cquilty
fbow = ?
__adrian
For Better Or Worse
i'm really good at using acronyms that no one else can figure out (anoecfo)
PDO has only one serious drawback, imo: it always emulates prepared statements by defualt. it _should_ emulate them only if the underlying driver does not support them. it's important to change this behavior when creating a PDO instance.
cquilty
You've got a nasty habit of strtolower()ing random acronyms.
But you didn't do it for PDO.
         

__adrian
$options = [PDO::ATTR_EMULATE_PREPARES => false];
starmaze
I have a stritcly logical question and wish not personal emotions to be involved in this (as your personal emotions have no values for my strictly strategical decisions). How do you work professionally with PHP when the documentation is insufficient? What's the workflow when you need documentation especially about details that forums don't answer? This is often the case. Not that there were actual questions here, do NOT read between the lines.
note*
__adrian
starmaze: you'll hate me for this, but: i do not find the documentation insufficient, in most cases.
starmaze
if you're younger than 20, do not respond.
__adrian: hm.
__adrian
yes, there are some pages which are incomplete, and i hate that. yes, some functions have "gotchas" which make a _cursory_ review of the documentation unhelpful.
starmaze
__adrian: for example, the charset argument in the PDO consotructor is not documented anywhere. It just says "sets the character set"
__adrian
but in most cases, i need docs for the method signature.
starmaze
__adrian: sorry, not even that. It just says "the character set" which could mean that it's how PHP is going to interpret the connection but doesn't affect mysql.
__adrian
this is because it is driver-specific. are you looking at this page? http://php.net/manual/en/ref.pdo-mysql.connection.php
starmaze
will look
yes, that's what I'm looking at.
"the character set" says me nothing.
could mean too many things
this would be unacceptable in a professional environment
__adrian
could. did you follow the link which immediately follows?
cquilty
starmaze: For me, personally, I typically whine in #PHP on freenode until one of the actually knowledgeable people wake up.
(Sad but true)
__adrian
well, consider something else which is generally considered "professional" in a programming environment: docs are not repetitive. details about {x} are found on {x}'s man page, and should not be found _anywhere else_.
cquilty
I guess if you had money, there would in theory be people who could figure it out for you for payment.
Alphos
__adrian why are you trying to educate a troll ? :/
__adrian
heh. i wouldn't trust money to get me good code.
Alphos, trolls deserve an education too!
cquilty
I don't mean putting a bounty on some random IRC channel or forum, though.
I mean more something along the lines of hiring somebody for continued support.
Alphos
the past few hours, he's only been trying to diss php in every way possible, without any basis :/
__adrian
cquilty: if you mean hiring someone, sure. but you still have to invest a lot in hiring the right person.
Alphos
cquilty it's called "hiring a dev", it happens a lot
         

cquilty
But yeah... if you have that kind of money, you'd probably have some sort of "solution" already.
__adrian
Alphos: well, be glad he's taking something of a break now :p
Alphos
__adrian i guess
__adrian
when the legit questions stop, so will i.
Alphos
__adrian besides, i still don't get why he went for the baseless accusations when there are so many bjustified ones :/
__adrian
hence, the needed education
:)
starmaze, BTW, that linked page includes an answer to your "security implications?" question.
cquilty
Two points: 1. I agree very much with starmaze that the documentation frequently is very insufficient. 2. I recognize how thankless it is to work for free on open source stuff, so it's not exactly shocking.
Also, 3. In the context, the documentation isn't horrific.
Alphos
cquilty one page of documentation does not a documentation make
sometimes you have to read several to get all the information you need
cquilty
Yeah... I'm frequently overwhelmed by it.
I can only imagine what it looks like to newbies.
starmaze
__adrian: since I'm not using *_escape or pdo::quote, no. It doesn't address prepared statements. And it still doesn't specify if the server/client/connection charset is affected.
Alphos
it can all in all be a bit obscure, but i can tell you all you need is in there :)
__adrian
well, as i mentioned above, 9 times out of 10, when i open up the docs it's to double-check the function signature. most other times, it because i forgot what some function was called, or which of two similar functions behaves which way.
starmaze: it's the charset for the connection.
Alphos
__adrian function signature + check if there are params that could do what i need and don't usually use so didn't think of
__adrian
i did find that on php.net somewhere. i couldn't tell you where now.
Alphos, yes, right.
Alphos
__adrian like the second param for file()
to remove new lines
that one is just marvellous, too bad it doesn't remove \r ^^'
starmaze
__adrian: that's the problem. PHP is very hard to work with professionally. Hence my original questions.
Alphos
lawl
you can quote me on that
__adrian
point is: the one thing i do NOT look for on php.net, or in documentation in general, is tutorials. lots of people expect that docs=tuts, and I find that very frustrating.
i'm not accusing you of this. just expounding on my answer.
but i do find this a very common expectation/complaint.
cquilty
__adrian: If not in the documentation, then where?
Alphos
strange as it may seem, i find the documentation to be tutoring enough
cquilty
The examples should be plentiful and useful.
starmaze
__adrian: the tutorials online are often better than the actual documentation. Something is wrong then.
Alphos
cquilty there are plenty of examples out there, but the documentation is not a snippet book
cquilty
"Out there" is meaningless...
__adrian
tutorials and documentation serve different purposes.
Alphos
cquilty "on the internet"
cquilty
I can't find anything of value by searching, so I don't know what sites you refer to.
starmaze
__adrian: tutorials document php better than the official documentation.
Alphos
cquilty L2google-fu
__adrian
docs are reference material. they are like mechanic's guides: they don't teach you how to drive.
starmaze
__adrian: the documentation should be the source. This is not the case for PHP
cquilty
"the documentation should be the source" <- ?
__adrian
starmaze: that ("tutorials document better than php.net) is subjective, and i do not agree with it.
cquilty
I hope that doesn't mean: "the documentation should be the source code"...
starmaze
cquilty: just stay out of this pls.
Alphos
cquilty stop saying he's here only for trolling, that's just mean, and that's MY job !
__adrian
starmaze, chill. you have successfully started a convo here, don't shut it down unduly
starmaze
__adrian: the documentation does not cover the details needed in a professional environment.
ule
TML: hi
Alphos
yeah, you don't need arguments lists or return values in a professional environment. you need, uh, professional stuff !
ule
TML: if I add ¬e.regex.deprecated; on my pt_BR file
starmaze
__adrian: you're looking at this from the wrong perspective. This has nothing to do with emotions or anyones personal feelings. It's facts.
ule
it didn't compile
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 next »