« first day (964 days earlier)      last day (4209 days later) » 

15:02
i will stick with Sublime Text instead
@tereško have you tried Brackets yet? brackets.io
# arrrrrrr...
dd if=/dev/zero of=*Factory*.php
# I hate it to have always to open two files to hop form one class to the next because there's a factory between them...
btw guys
Packagist is having an outage.
EVERYBODY PANIC!1!
(or least composer+packagist can't get the latest verisons of stuff)
Hey guys
@DaveRandom VS is a good IDE as long as you only code C/C++ :P
From there, language support drops very quickly
or c#, or ASP*
@LightningDust *and no C++11 for that matter
@NikiC VS2012 has decent C++11 support
It's not 100% but it's getting there
@LightningDust I wouldn't call it decent
It does support some features
@NikiC What's missing? Not much
15:15
if anyone have a moment i have a very strange problem that prevent me from pursuing my objective
@LightningDust Most of it. VS is lagging behind quite a bit on that front
@NikiC You're running the Nov 2012 patch right?
@LightningDust Even the CTP is still lacking some important stuff, in particular the template aliasing
It should definitely be further ahead than it is
I wonder in how many years they'll get the constexpr support :D
@hakre lol
Do yourself an enormous favor; don't use the script you found. The ridiculous use of global variables is likely to ruin your script, steal your car, and order pizzas to your house at 3am. — Bracketworks 1 min ago
@Bracketworks using global == allowing the program to quit virtual space? =P
@bwoebi A buddy of mine once used a global variable. He lost his job, his house burnt down, the variable stole his wife, and now he has to pay child support for dependencies outside of his own object graph.
@Bracketworks to what can this answer be reduced when you remove the irony?
15:31
@hakre Can you tell me how to API? I don't know how to XML.
@Bracketworks bad troll.
@Bracketworks ah that's why all the pizza arrived yesterday... °
@Bracketworks you need to feed more
@bwoebi Who? The question asker?
yes.
m59
m59
Hey guys, I'm using jQuery serialize on a form and then sending it via POST to my php file. the form variable shows that everything is correct before I send it, but the php file is getting one of the vars cutoff (not the last one, either). Any ideas?
It's like there's a limit to how long a post var can be...
15:33
@bwoebi It can be reduced to my buddy getting royally fucked by globals?
@m59 you using .seralize()?
m59
m59
yeah
the result has the full amount, though
@m59 the form is properly formed in HTML? no missing tags or anything?
@bwoebi oh good point
m59
m59
15:34
@bwoebi but that would cause the end to get stripped off
but thats got to be a friggin HUGE form to hit that limit
m59
m59
No, the last var is present. It's a variable being clipped, not the post itself.
you posting anything other than text, IE images, binarys?
m59
m59
nope
can we see your php?
15:36
@m59 I don't know if there's any order in the post vars....
m59
m59
I stripped it down to just this echo $_POST['Message'];
clipped
@Bracketworks this is not a big problem
@m59 are their any non utf-8 chars in the Message?
m59
m59
nope
ahahaha I got it
dernit
what was it?
m59
m59
15:40
Well, actually, that's interesting...
I have it replacing certain chars with html entities
causing an &
protecting against injection?
m59
m59
yeah, just kind of over the top though
I can probably ditch that in js and just do it with the whole POST?
I use mysqli's function to clean the data before inserting.
real_escape or whatever it's called.
i forget
m59
m59
eh, it's not going in a db anyway, just email.
m59
m59
I can't think of anything that could go wrong even with no security
but I play it really safe.
good thats always best.
@hakre care to give a OO (not boobs) advice? :)
@webarto OO (not eggs) advice? :)
15:45
@hakre object oriented and stuff... :)
and these objects that he's going to orient... they wouldn't be boobs?
No, it's that time of the month... when I need to work.
@TheSnooker added to "watch project" list .. alongside with LightTable
@webarto yeah, so just ask as for this channel here, just ask :)
@webarto well ... at first you write <?php .. then you press enter twice and tab .. then write class
15:55
It's f* notification system... I'm not even sure how to make one... thoughts?
this sounds like the start of a good story
then you open synonym glossary and start looking for names which you could use
It's too complicated for my tiny brain.
Title: "The little _constructor that could"
m59
m59
Is it ok (or even possible) to modify POST when it is received, or do I need to make a new array from it?
foreach ($_POST as $key => $value) {
  $_POST[$key] = htmlspecialchars($value);
}
15:56
It's a normal array filled with crap data.
m59
m59
Is that the right way?
@m59 $_POST is a super global but it's just like any other array you can modify it if you want.
I'd make a copy, if you are 100% you don't need original POST, then do it.
@m59 I do sometimes.. but as far as if it's good practice.. I would probably say no.
m59
m59
I thought so, but I don't have a good grasp on how php thinks of some things. Like, what if I did....
15:58
yeah what webarto said
m59
m59
foreach ($_POST as $key => $value) {
  $key = htmlspecialchars($value);
}
I just wrote the most epic SQL query of all time, 113 lines
m59
m59
is $key a reference? or is that just nonsense?
that would just re-write $key with every iteration.
m59
m59
@DaveRandom poor guy
15:59
@DaveRandom 1 query? or a bunch?
@m59 You cant' reference $key, you can $key => &$value ...
m59
m59
@DaveRandom now you need ice cream. Your brain must be done in.
@DaveRandom 100 lines of poem and 3 lines of query?
@TheSnooker Technically 15 with subqueries and unions
oh man.. UNIONS.. I've not seen a UNION in a long time
Whats the difference between a UNION and a JOIN again?.. it's got something to do with Ven diagrams... I remember that much from SQL class's
16:01
It only produces (and will only ever produce) 7 rows as well
@TheSnooker Joins are horizontal and unions are vertical
oh yeah
hi5 Dave
Joins add more columns to a row, unions add more rows to the result set
Actually in MySQL it would be considerably shorter, but T-SQL sucks balls
@webarto that's not your question, is it?
@hakre No, I wanted to ask something specific... but now I see I messed up everything and there is no point :) Thanks.
@webarto Well, good we talked about it :)
16:06
@m59 Yeh that code does precisely nothing apart from burning CPU time
Also it looks like it was written by someone who favours carpet-bomb escaping
Read: someone who doesn't understand escaping
@hakre if you have a moment i would very much appreciate if you can have a look at something bugging me hard stackoverflow.com/questions/16965180/…
^ self-duplicator even
@Happyninja character encoding problem likely.
Just a reminder; Packagist is having a small outage, upgrading to the latest versions of anything through composer, is currently not working.
@Happyninja ensure the strings you put into the array are UTF-8 encoded. That's needed by json_encode. check the database field encodings, some / one / all are likely not UTF-8 encoded and/or contain wrong data / and/or the database connection is not UTF-8
16:18
@hakre is there a routing i can run on my database to ensure field encoding is correct? cause i wrote it from scratch and specified charset for every table
@Happyninja routing? I don't understand. normally there is no routing in databases (at least any I know of)
@hakre i mean a check i can loop through all my rows to check which one is "defective". i speak french so in my head i was thing of routine
it's probably not a database issue
just re-reading your question again.
check that you PHP file does not have a BOM at the beginning of the file.
Any article/link to a good notification system design?
9
Q: UTF-8 BOM signature in PHP files

treznikI was writing some commented PHP classes and I stumbled upon a problem. My name (for the @author tag) ends up with a ș (which is a UTF-8 character, ...and a strange name, I know). Even though I save the file as UTF-8, some friends reported that they see that character totally messed up (È™). Thi...

@webarto inside your code or across users in your application?
16:23
@hakre Inside the code :) I'm not sure how to handle events/hooks and processing of notification for display purposes, there can be potentially dozens of notification types, etc.
@hakre THANKS A LOT. strangely enough there was a BOM somewhere, even if the PHP file was a controller and other calls were working perfectly this one wasn't. I still can't explain it but it works. I'm so happy, thanks again
i just register the file using ut8 without BOM and it did it
@Happyninja you're welcome happy ninja. now you're a really happy ninja I guess :)
@hakre yeah
@webarto maybe php.net/class.splobserver - also read about that design pattern.
how come isset($_POST) always returns true?
16:27
@hakre That's sort of it, possibly first part handled :)
@iroegbu because it's a superglobal always there. even in CLI. php.net/_POST -
Superglobals — Superglobals are built-in variables that are always available in all scopes
my headache is gone, thanks @hakre
Why are some coders obsessed with the practice of creating models in foreach loops?
It's so horrible.
16:35
It's on a par with database calls on every iteration in loops.
it's likely they don't know about iterators :)
Why can't they just make the model first?
well, you don't need a model for each application I guess
some just want to add some sugar on top of arrays they get from the database
$mTransactions = new Models_Transactions();
foreach(...

instead of:

foreach($whatever){
    $mTransactions = new Models_Transactions();
The former is always going to be more efficient
absolutely!
I mean why instantiate Models_Transactions more than once even here?
16:38
I have no idea
I can't see why anyone would do this
Unless they lack basic understanding of OOP/MVC
that is not even OOP I would say
you should fullfil resource requirements before processing code
@hakre oh thanks... that's good empty($_POST) is what I should use
solves my problem... or isset($_POST['submit'])
16:53
@LightningDust where you've got that from? (starred)
Heya room 11
hello user @PeeHaa埽
Heya @PeeHaa!
I most like the "If you are a dog" thingy.
Anonymous
17:19
@LightningDust lol, that picture is killing me
I really love the careers ad
Can you shoot it? Oh, I dog it.
yay. fixed my proxy. one problem down one to go
user895378
Goodness ... as if the PHP curl bindings weren't already an unmitigated disaster: wiki.php.net/rfc/curl-file-upload
@PeeHaa埽 yes, me too :)
17:33
I love how @LeviMorisson is always the opposition :)
user895378
Along those same lines I finished my http client rewrite before I left for vacation. It's about 1000000 times better than it used to be. Will need some feedback after I get home on Sunday.
@rdlowrey that's why you can also use a file_get_contents with stream_options
user895378
Which is also a terrible API
user895378
And how exactly do you stream a PUT request with a stream resource as the entity body with file_get_contents?
@rdlowrey then patch your PHP distribution ~.~
user895378
17:38
No need. HTTP is io bound so user land libraries are just as effective.
you mean munally with fsockopen?
user895378
More or less.
user895378
I don't ever use fsockopen because you don't get enough control.
user895378
(Sorry for lack of formatting -- on the tablet)
Hi guys I have a question, I have this javascript script that works well echo "<script language='Javascript'>document.location.href='http://etc' ;</script>"; How can I edit it to make the redirect after some seconds? I've tried to search but probably I wrong something
17:43
@rdlowrey For my current project I'm going to need an http client
@newbie I think it's over here

JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
A PHP redirect will occur before the client can pause
yes there are many example of how to do it with javascript, what I can't do is adding in a php echo"" and make the script works
for example here there are many example but I'm failing something stackoverflow.com/questions/9877263/time-delayed-redirect
user895378
I still have to add a few more tests but if you wanna see the API you can look at the examples in the 2.0.0-dev branch here @PeeHaa
@newbie As a general rule, echo "HTML CODEZ HERE"; is error prone. Jump out of PHP mode ?><HTML /><CODEZ /><HERE /><?php and back in.
user895378
Your Unicode makes it impossible for me to ping you on my ipad, BTW :)
17:46
I'll try thank you very much
@newbie Take from this suggestion to mean all (almost all) circumstances where you'd otherwise echo HTML.
@rdlowrey hehe @pee will do ;)
user895378
Hehehe
I'm new on php and I have to use it for a project, I didn't know it before now thank you again
@rdlowrey then, what do you use?
17:49
@newbie Well, now's the best time to learn the best practices :) Not to say that in itself is a "best practice", but when you're echo-ing HTML, there's a good chance you have SQL and a hoard of other concerns mixed in. Separate your concerns :)
@rdlowrey stackoverflow.com/questions/16968788/… and there's the next curl problem :-D
user895378
stream_socket_client or socket_open @bwoebi ... Just depends if I want to require the socket extension
user895378
Or proc_open if I want to work with stdin/stdout/stderr pipes
@rdlowrey is this enough control? do you really not want be able to write the TCP header yourself? :-P
user895378
;)
17:51
posted on June 06, 2013

The PHP development team announces the availability of PHP 5.5 RC3. This release fixes some bugs against RC2. THIS IS A DEVELOPMENT PREVIEW - DO NOT USE IT IN PRODUCTION! You can find an incomplete changelog of PHP 5.5.0RC3 here : Fixed bug causing segfault in gc_zval_possible_root) Fixed bug about a heap based buffer overflow in qu

@Feeds why does the announcement take so long after the branching in the git?
@Feeds I like how people are still trying to cram in changes in 5.5 :P
@CarrieKendall Object Oriented Objects?
@PeeHaa埽 but they don't really succeed to do so^^
17:52
@bwoebi o+? ;-)
But no the pdo changes don't make it luckily :P
@PeeHaa埽 this was before beta
BTW does anybody get an SSL error on my certificate? cv-pls.pieterhordijk.com
@PeeHaa埽 nope.
@PeeHaa埽 I'm sure we can still get accessors, or at least AST compilation ;)
@Bracketworks hahaha
accessors are a little more realistic than AST
user895378
@pee no ssl error for me
@bwoebi I'd guess that a) to allow retagging it if some critical issue turns up and b) for QA + various builds
AST is wonderful as RFC but nobody cares to write it
@bwoebi Accessors would be a little more realistic with an AST.
17:55
hmmmmm must be one of those quantum errors
tnx all
@bwoebi Yea I know, I linked it earlier.
@PeeHaa埽 you need to show that footer whose boss. i'll get the duct tape ;]
2-phase compilation would fix the syntax soup that is PHP. Language features would be easier to implement from a syntactical perspective.
user1596138
So I need to do a few things that are conditional based on the date. How would I write something like if (date is after 060213) {do this}?
18:00
@Bracketworks I don't know. The hardest is not the language parsing but to write the code.
@Bracketworks While the second point is true, I don't think it would change much about the first point ;)
that moment where you realize you unknowingly hit spacebar while watching a youtube video and the video didn't just stop for some crazy amount of time.. DERP
user1596138
Obviously I'd use date('dmy')
user1596138
But I'm not sure how to run the condition...
Some syntax decisions PHP made in the past make variable-syntax parsing rather unpleasant, even when generating an AST
18:02
@NikiC Such as (what wouldn't be made more manageable)?
Variable-variables and interpolation?
user1596138
Will ($date >= 060613) work somehow?
@Jhawinsss Only if you live in an octal universe.
@Jhawinsss 20130606 will work, but not the inverse.
user1596138
@bwoebi Spot on! I don't know why I didn't think of that.
@Bracketworks There are quite a few things, one example is $$foo['bar'] being parsed as ${$foo['bar']} instead of ${$foo}['bar']. Seemingly harmless misjudgements like that prevent you from parsing variable syntax in a nice left-recursive fashion and require lots and lots (and lots and lots, for that matter) of ugly hacks in the grammar
18:06
@NikiC I see; if I recall, some languages that appear to use the $-prefix notation for variables actually treat the $ as a variable-dereferencing operator; shame that wasn't the case.
@Bracketworks You are talking about the jquery language right ;-)
Variable-variables have such a limited scope of use anyway.
@NikiC really, I also expect it to be parsed as ${$foo['bar']}, at least when I know how the ternary operator etc. work.
Another example (and this requires you to use some kind of monkeypatching, no way around it) is that Foo::$bar['baz'] accesses the offset baz of the property bar while Foo::$bar['baz']() calls the method name contained in $foo['baz'] (rather than the callable contained in Foo::$bar['baz'])
@PeeHaa埽 Of course not! jQuery uses the $ operator as what in the docs is known as the "god-operator".
user1596138
18:08
One other question... What is the preferred method for including html source files? Someone said the other day that using include() should only be done for a php script.
@Bracketworks :P
@NikiC Which sort of drags us back to the issue of types; had the language supported only closures as callables, rather than the others, this would probably be a non-issue. You'd still need the ability to manufacture callables from strings, but still.
@bwoebi Okay, so you think $$foo['bar'] should be ${$foo['bar']}? Now tell me what $$foo->bar will evaluate to. Surprise: It's ${$foo}->bar, not ${$foo->bar}
@NikiC also you could thing it accesses the class constant the method call of $bar['baz']() may have returned.
@NikiC ${$foo->bar}?
not a surprise, I naturally expect it to be coherent
@bwoebi see edit
18:10
yeah.
@bwoebi it's not coherent ... it's the exact opposite
Unless you of course expect that PHP is inconsistent - which is probably the right thing to expect ^^
@NikiC was there any reason to not think of consistency when PHP was designed?
@NikiC Haha, you're absolutely right!
Anyway, the point was that PHP's variable dereferencing and call syntax has no strict left-to-right semantics, but is also partially right-to-left (the $$foo['bar'] example) and partially needs infinite context to decide how to parse something (the static call example). This is what causes all the problems
Ironically, php == coherent; is perfectly valid.
hehehe
Anonymous
18:13
I think all my sites are hacked. They are saying ERROR class PDO not found
looooool
@Bracketworks I supposed when you typecast coherent it will be equal. like incoherent.
@bwoebi PHP IS A LOGICAL FALLACY!
;)
@phpNoOBఠ_ఠ Had you downgraded to PHP 4.4.9? XD
Anonymous
@bwoebi I did not even tough it a bit.
Anonymous
18:14
Never changed anything at all
no. your server has recognized what awful piece of software runs on it and now tries to destruct it systematically.
Anonymous
It is shame, sometimes I go upto two weeks without checking my sites, not God knows how long they have been like this. 7 sites the same errors. completely defaced.
@phpNoOBఠ_ఠ You wouldn't have these problems if you used mysql_* :)
7
@phpNoOBఠ_ఠ Probably your hosting provider disabled PDO
From which I follow that your hosting provider is incredibly stupid
disable_classes = PDO?
Anonymous
18:19
Why would they disable PDO? I was testing a sites yesterday, it gave me the same error, and when I asked them, they upgraded PHP. But when they error remained, they told me the don't know anything, ad that I should hire a developer
Anonymous
I am on a shared hosting, that is the problem
then switch to a vserver?
Anonymous
I am switching to VPS, but it will take time, until I figure out how it works. I signed up last night, and bough one package. from vpscorner.
Anonymous
Anonymous
this is how incompetent they are btw
18:22
you should ask: you do I build PHP myself?
(on the server and use its apache module)
@phpNoOBఠ_ఠ I'm not quite sure whether it's a good idea for you to setup your own VPS
Unless, of course, you know how to setup SSH with public key crypto and how to configure a firewall :)
Anonymous
@NikiC Yea, but this one I bough is just for playing, until I can get the fee of it, and learn the basics. I am not going to use it for hosting anytime soon.
Anonymous
@NikiC do you think it could be a malware, or the sites may be compromised?
@phpNoOBఠ_ఠ I doubt it
put online a phpinfo() file and have a look at it
It will tell you which extensions are enabled
18:26
@phpNoOBఠ_ఠ If it would have been compromised, there would normally be only hidden signs or very visible thing; but not a boring error with PDO...
Anonymous
they put that file yesterday to show me, that PHP is upgraded, but forgot to take it off
Anonymous
@bwoebi I wish it was boring sign, all the sites are defaced.
@phpNoOBఠ_ఠ Doesn't look like PDO is enabled, even though it is in the configure line...
@phpNoOBఠ_ఠ PDO is built shared (look at the configure command)
@phpNoOBఠ_ఠ So? If all the sites use PDO then they would all fail if it couldn't be found.
18:28
@phpNoOBఠ_ఠ Try adding extension=pdo.so to your php.ini
@NikiC and the drivers too...
Anonymous
@NikiC Ok. But, they must have disabled it. Because, the sites were working for like 6 months.
5.3.15? Blech.
@phpNoOBఠ_ఠ nothing explicitely disbaled, only changed the ./configure command what automatically disabled it as a side effect
@phpNoOBఠ_ఠ your php.ini is located at /usr/local/altphp/lib
18:30
when it's built statically into PHP, there are no problems
Anonymous
I'm just waiting until they could give me an explanation. saying they crewed up my sites. This might have been going one for like, days.
user652649
@phpNoOBఠ_ఠ one of our hosters kept register globals on until 5.3, because they said "oscommerce" wouldn't have worked
does anyone use FOSUserBundle?
user652649
people that still uses oscommerce in 2013
Anonymous
lol @Wes
Anonymous
18:35
I am very embarrassed, the full path of my files is just shown to the world. One of the sites is even classifieds :)
user652649
i mean not new installations, apparently is people that runs oscommerce since 10 years ago without never updating it
@phpNoOBఠ_ఠ don't make any enemies ;]
user652649
@phpNoOBఠ_ఠ delete the phpinfo.php file at least..
Anonymous
Anonymous
Can you believe that guy.
Anonymous
18:39
He wan't me to thank him, I think
Anonymous
"The PDO extension was not enabled, I have enabled it using php.ini file which is placed under public_html folder."
user652649
@phpNoOBఠ_ఠ not a smart idea placing it in the public_html folder
user652649
what about .user.ini instead?
@phpNoOBఠ_ఠ Just FYI, if you didn't notice that your sites were offline for days, then they are probably not important enough to be concerned about it ;)
user1596138
18:44
@phpNoOBఠ_ఠ Use a reverse-bound shell and you can most-likely access php.ini yourself.
user1596138
Or even a phpshell. I don't want to name any publicly because script kiddies cause a lot of problems... But I have root access to all of the files on my hosting provider. I have 777 access to 14 other websites hosted with the same provider.
Anonymous
@Wes @Jhawinsss The problem is my noobness. I have't taught myself, about that ... yet
user1596138
@phpNoOBఠ_ఠ That isn't actually something you'll be learning as a Web-Dev ;)
@phpNoOBఠ_ఠ change it^^ become an expert :-P
Anonymous
@NikiC kindf, but I have like 6 sites running. I gave three for charity, church... and others are like yellow pages, so I can't really check them out every day. But, I have made a script, sort of like a page counter I will upload it, and will get the all sites status under one page.
user1596138
18:47
@bwoebi Exactly. Learn it anyway. I'm fairly good with security, but only because I'm better at breaking security.
Anonymous
It feels good to be up and running again.
Anonymous
The agent said, sorry only.
user1596138
@phpNoOBఠ_ఠ You have a yellowpages site...?
Anonymous
I mean wtf!!!
Anonymous
@Jhawinsss Yup.
user1596138
18:48
@phpNoOBఠ_ఠ Why?
Anonymous
Because, it's all about the yellow :)
user1596138
@phpNoOBఠ_ఠ You mean you have a listing on yellowpages? Or you have your own phone directory site?
user1596138
@phpNoOBఠ_ఠ Wait, these are just pages that are yellow? I thought you meant YellowPages.
I return :)
@Jhawinsss Exactly. Try to do sth and to deal with the resulting mess, using only google. Instead of asking...
If you ask, you may get an answer, but not the problem.
user1596138
18:50
@bwoebi I have absolutely no idea what that sentence means.
Anonymous
@Jhawinsss What I mean is that, I have a site which functions as a yellow page. It is a business lisiting website, currently with 500 addresses, and though 4 months old, it gets as little as 25 visitors a day.
Anonymous
I don't know, to what that constitutes
@Jhawinsss If you do something and it goes wrong, you should try to deal yourself with the resulting problem

« first day (964 days earlier)      last day (4209 days later) »