« first day (1522 days earlier)      last day (3652 days later) » 

Morning gentlepeople
user895378
morning
From the loadHTML() documentation it would seem that DOMDocument::loadHTML() can be called statically, but this 3v4l seems to suggest otherwise.
Wondering whether docs bug or php-src bug
@AndreaFaulds Looks good to me ^^ only scanned it though
@Ja͢ck Check other methods which you can supposedly call statically.
00:15
@LeviMorrison Do you know of any?
Also, it may be that you do DOMDocument::loadHTML($domdoc, $html);
(kinda like with mysqli_* statics)
It would be fatal then
@Ja͢ck Probably same thing as bugs.php.net/bug.php?id=64945 ?
i.e. ZEND_ACC_ALLOW_STATIC vs ZEND_ACC_STATIC ...
Ah, that does sound similar.
@Ja͢ck Also given that since the beginning it can't be called statically... inclined to say docs issue.
It probably was intended to be called statically.
If you want to support it PHP 7 is the version to do so ^^
00:18
Yeah, but it does work.
I.e. $doc = DOMDocument::loadHTML('<p></p>'); actually gives a valid object.
I'd still say fix in PHP 7 is a good idea.
ZEND_ACC_ALLOW_STATIC may be the issue here.
I'd say why not fix it in all the places.
Keep it to minor releases at minimum.
Eh?
It's not a security or regression fix, so keep it out of patch version
00:20
I have no idea what you're talking about.
Then maybe I don't know what you meant with:
1 min ago, by Ja͢ck
I'd say why not fix it in all the places.
Meaning fix it in 5.5 and 5.6
and master
Please don't do that.
Because <enter important reason here>
@Ja͢ck btw the documentation does need updating as well, as I'm guessing it returns the new instance when called statically.
00:22
PHP >= 5.5.10 (but not <= 5.6.3) type of things really sucks.
@Danack Yeah, it handles differently.
@LeviMorrison Why would we need that? It works in all those versions.
It just raises a strict in versions that weren't patched.
It's a bug not a new feature....
Right.
Odd though, you would think that ZEND_ACC_ALLOW_STATIC really ought to be enough.
Hello.
Are there any PHP masters in here?
It is not possible to master PHP, only to become resistant.
00:28
PHP slaves :)
Ok. I'm new to PHP. Could you recommend a book to learn from? What's the best way to learn PHP?
I've been using codeacademy.com, and w3schools.com. Are there any good books?
@Godisgood There is a lack of good books - the only one I know of that appears to be up-to-date is:
Almost all the others are horribly out of date.
But I haven't looked at that one to see if it's actually any good.
Ok @Danack. I'll take a look at it. Thank you!
@Danack, do you have any suggestions for learning MySQL?
@Godisgood learn SQL from M Gruber's book
this one
'January, 1990'
00:33
Thank you very much, @zerkms!
so?
@Danack it is an amazing book
SQL hasn't changed since then much
especially keeping in mind vendors don't support even ANSI SQL 92' completely
To be fair, that is less than half of SQL's lifetime....
well, I have read it long ago and I find it the best for learning pure sql
if there are better alternatives - okay
Have you all used xampp?
it's a good idea to develop under the same OS your project will be run under
00:38
@Godisgood Yes - I suggest using it to get something running quickly, but you should really look at installing the stuff separately sooner rather than later. And yeah, vagrant all the things.
@Danack Installing what stuff?
what you want to learn
php, webserver, dbms
@Godisgood xampp installs apache, PHP and MySQL for you - those bits.
Hmm, so ZEND_ACC_ALLOW_STATIC seems to be just there to prevent a fatal error ...
curious if there is a xampp-like thing with nginx
00:41
That's all I've even heard of. I didn't know that dbms and others even existed.
dbms == database management system
eg: mysql, postgresql
HMMMM. Never heard of them.
I think I'll stick with 1 language at a time.
9 mins ago, by God is good
@Danack, do you have any suggestions for learning MySQL?
yay .. I wrote an answer this month
@zerkms No....I guess one of the O'reilly books. But I'm not sure that learning MySQL from a book is a great idea. tbh it might be best just to buy an advanced book - and learn it by jumping in the deep end shop.oreilly.com/product/0636920022343.do
00:47
Thanks both of you for helping me!
@Danack it depends on the aim. Gruber if amazing if you need sql
when you need a particular vendor dialect - you just open documentation
that nickname urges me to poke at its owners beliefs
My nickname?
see what nuggets fall out
yeah
God is good?
00:49
"ban hat - get blocked from chat twice in one day!"
What does that mean, @Danack?
You're blocking me?
@Danack don't tempt me
@Godisgood Teresko got blocked earlier by an over-eager mod. But your name is probably not a great choice for an online forum.
And why not, @Danack?
Sorry, I'm 15 years old.
It's weird
00:51
That God is good?
treat it as an "id that means nothing"
That's not wierd . . .
"it's weird" not about your nickname
it's about Danack's phrase
@Godisgood yeah ... we will return to this after you have gone to college
that it's not a great choice
00:52
@Godisgood Which country are you from? People from quite a few countries don't like having religion thrust into a place that is not about religion.
I won't thrust it anywhere. I promise.
USA
That's what the priest said!
/ba-dum-tish.
@Danack and then they use "godlike object" as a semi-official term
Who's they?
developers
oh I was wrong, it's even "God object"
In object-oriented programming, a god object is an object that knows too much or does too much. The god object is an example of an anti-pattern. The basic idea behind object-oriented programming is that a big problem is separated into several smaller problems (a divide and conquer strategy) and solutions are created for each of them. Once the small problems have been solved, the big problem as a whole has been solved. Therefore there is only one object about which an object needs to know everything: itself. Likewise, there is only one set of problems an object needs to solve: its own. A program...
00:54
yeah, it's a term .. well .. actually it's a description of "code smell" (an indication of mistakes in underlaying architecture)
it is
and in his nickname it's a description of... what?
MY NICKNAME?
Religious (and political) discussion is incredibly divisive; it's counter-productive in a technical setting.
also, to make piece with my conscience , I will give you only one link
it's funny that this discussion was started not by a nickname owner :-D
00:58
Oh in particular, your nick would discourage Jewish people from typing it - chabad.org/library/article_cdo/aid/1443443/jewish/…
G_d is good
fixed
Also, I would object to the name myself... there are many adjectives I might apply to God, but never "good".
Okay, can we go back to the normal OT stuff? :)
@AndreaFaulds "it works for me"
@Ja͢ck just run rollback;
I just really like that video
01:04
@tereško ikr
Really makes me wonder if people are using that library as much as I thought people are.
Ah, gotta love burden of proof arguments on internals :)
Hmmm. It sounds like you all are not the same as me.
You're unique, like everyone else.
Oh well.
01:06
@Danack anybody using it looking for a stable api likely moved to graphicsmagick a long time ago
what would be fun in that ?
Just remember, you're unique. Just like everyone else :)
I love that joke.
imagemagick just decides to change shit, how it works and what it does, at random.. without so much as a note in a changelog
meh, you can always stick with ext/gd
Yuck
Was somebody offended by 'shit'?
01:11
Like me?
Were you?
@PaulCrovella Do you actually know that or is that just an impression? Graphicsmagick didn't seem to be being developed for quite a while, and seems to have struggled to kep up with the features in ImageMagick.
Yes, @Ja͢ck.
@Ja͢ck Teresko got temp-banned for saying fuck after someone mentioned the winterbash.
\o/
lol
01:13
i was soooo pissed
@Danack I actually know that, though my knowledge might be dated - I haven't worked with either in a since a handful of years ago
@Godisgood You'll make a nice addition to my ignore list, then.
Me? Why?
wait, did my comment get flagged or something?
01:14
pls
@AndreaFaulds room owners sleeping?
you guys can star it though
pls star
Look guys, I have a hat
no not the link, click through damnit - theeeeere we go
@Ja͢ck you also have a hat :D
nice
01:16
I have 6 i think.
Yeah :D
anyway, argh. good night
haha sleep tight
don't let the bed bugs bite
01:19
Do you even Fortran?
Is there an easy way to check if files exist in ZipArchive using wildcards/regex without extracting the zip itself?
for fuck sake .. my previous answer was in september
I really should try to invest more time in this, if I ever want to get that gold badge in oop
Fake internet points are not necessarily a wise time investment.
It's not the points, it's that shade of green.
@PaulCrovella Hmm - I may ought to check more thoroughly, but my understand is that the features in graphicsmagick are basically frozen, e.g. these useful functions are missing 1 2 3
/Also I am aware that the image caching is broken, and that the design of the last page is horrific....
01:24
@Danack weeeeell .. a gold badge in oop and architecture might be useful for some additional job opportunities
"Hello, I would like a job, please note how much time I waste help teaching others on the internet." ;-)
@Danack oh, feature parity was never a goal for graphicsmagick - sane development and releases were
It would probably be good, but I'm still going to mock it.
@PaulCrovella Yeah......sanity is a little lacking in the ImageMagick guys....
@Danack during work time (sorry for the conversation interruption, flies away)
They have stopped breaking shit and changing apis - but they don't always test using valgrind....even when people are reporting corruption issues.
01:29
they stopped breaking shit? it's about damned time
02:11
ANyone worked with OpenCart before and have implemented an "order again" feature [specifically, add all items from a previous order to the cart again]
user3949359
03:10
Does the class name have to match the filename in PHP like it is in Java?
I have a large array with subarrays something like this:
$array[0] = array('name' => 'test', 'value' => 5)
$array[1] = array('name' => 'test', 'value' => 10)

How can I do a search to
a. Check if duplicate "name"s exist,
b. Add the values of the duplicates to the original values
c. Unset the duplicates
03:29
can't you just sum the values while you add new ones?
and if not, organizing the values like $array['test'] = array(5, 10); makes the problem far more trivial
Sorry I'm not actually adding the values like that, that was just my textual representation of an array
it's possible to solve the problem with your current data structure, but your runtime will go through the roof
an alternative would be to sort by name and then sum up all duplicates. but i would prefer the solution where you use name as key to $array
got it to work=
?
03:48
@foobar sorry back now, just had to do something
its a one time thing so runtime isn't really an issue
and the array is imported from a csv
so maybe just iterate over each array and then make a new array with the name as the key? Yeah I think that will work
Thanks for your help
well, as runtime doesn't matter there's a lot of possible solutions. that's even an efficient one
yeah I just wasn't really sure where to start but you got me on the right track, thanks
04:34
I would appreciate if anyone could help me with a technical question about implementing an "order again" functionality in OpenCart: stackoverflow.com/questions/27497384/…
 
1 hour later…
05:47
@Ja͢ck We are too liberal in what we allow in patch versions, imo.
I know it's restrictive to say "only security and regression fixes allowed" but that's really what I think is best.
06:40
hi everybody..
I have a problem generating dynamic sitemap for the site. I could find numerous PHP scripts that does this job. But, the problem is, they just fetch 1000s of URLs from DB table and create the intended sitemap.xml at once. And I want to just update the existing sitemap 1 URL at the time. I don't want to rewrite the whole XML file for just 1 URL update. Do you have any link or script that does this job?
it would be great if this is done with XML reader/writer because they are more efficient than the above approach. This is example site that talks about this: stackoverflow.com/questions/20234072/…
07:05
@LeviMorrison Sure, I just don't think that reasoning applies here.
I have plans for creating a big application in PHP that helps in accessing web pages in a smarter way. I am able to create this script myself but I think it's a common scenario so I don't want to reinvent the wheel or waste time rewriting the whole logic. A script is already available here php-ease.com/classes/sitemap.html but it does not update URL with count 1 at a time. Any help greatly appreciated.
A preview of the app I am talking about could be found here (osipage.com) but the new app will be much more elegant, public and useful.
07:21
Hello
07:33
@PeeHaa ping
user924016
07:47
morning
@RonniSkansing wassup
user924016
Morning @meda not much just really tired atm
morning? Where are you guys located
Germany. Way too cold here...
07:54
@meda ugt
Switzerland. +1 for way too cold
Its freezin oug here too
user924016
Morning @BenjaminGruenbaum;
moin all ...
08:05
replace bright light with grey skies, some rain, and some pigeons ... replace falling over with shrinking by two inches because the outside world has sucked all the air from your body ....
@webarto that looks amazin
Too bad mine looks nothing like it :-)
@webarto I used a 1080p static version of that as my wallpaper for the longest time
@JoeWatkins So... one of the good mornings? :-P
that is a cool image, pleasing to look at ...
completely normal morning ... @webarto
08:15
Woah. Last week my superior declined to buy a vimeo pro account to host some videos that would be played in a web app and told me that we should upload it to one of our shared hosting servers. He didn't want to listen to me and now he's yelling at me why the video streaming is so slow.
Great start into the week!
user924016
lol
Some superiors really aren't.
Bas
Bas
Morning.
@ThomasDavidPlat $60/y is a small price to pay for unlimited streaming.
08:23
Yeah I really wonder why they're so refusing.
good morning fellas
Bas
Bas
Sup?
I know it may sound strange, but who is behind zend studio? why is there so much focus on mobile apps and other things not directly related to web php?
@JoeWatkins yo
good meurning!
Bas
Bas
08:27
Still trying to find out the single responsibility principle, because i cant validate an object if it's not instantiated yet.
:(
what does that have to do with the SRP?
Bas
Bas
Trying to split bussiness logic from value object, in this case its a Validator :P
And i have no idea how to instantiate the "Validator"
$Car = new Bmw;
$CarValidator = new CarValidator;

if ($CarValidator->isValidCar($Car)) {
$Car->drive();
}
something like this ?
Bas
Bas
Yeah okay, but thats after the instantiation of the car right, so that might be an bad object then
what do you mean by bad object ?
Bas
Bas
08:39
$car = new Car("");

$car->drive();

something like that
That $car shouldn't be able to exist right?
you should never drive the car without validating it first I guess ;)
Bas
Bas
I could use an factory like in the question i've asked (i mean the answer) but does that have to do with SRP aswell?
Should factory's validate aswell? :P
Haha, +1.
@ErikBaan actually your car usually knows, when there is somethingi internally wrong with it
Bas
Bas
@tereško Should factory's be able to validate aswell? Because a factory should only "create" stuff right
FactoryValidator. lol.
Hello,
Bas
Bas
08:48
Hi
I just need to know that.. are there anyone who is familer with php mail() function...?
is it what you really need to know?
there is someone who definitely is familiar with it
Am I in the wrong place..? Pardon me.. This is my first time..
no you are not
@JediDula the general wisdom is: "dont use mail()"
08:50
it's just funny how you put your question :)
you should use some mailing lib instead
ah... but
no buts
Hello guys
@JediDula the recommended options are PHPMailer, SwiftMailer and Nette
08:52
but the problem is I'm going to implement some thing like automatically add it's event appointment to the MS Outlook calender.
but every tutorial and examples uses mail()..
those tutorials and examples are outdated
well .. fuck em
@JediDula there are a lot of crappy and outdated php tutorials out there
I've tried with PHPMailer yes.. it sends e-mails but how can I modified PHPMailer to send mail with such headers...
Just because you find a tutorial that is using PHP 4 doesn't mean that you should write PHP 4 code...
08:53
throw away phpmailer though
IS this enough to clean my GET data ?
phpmailer the oldest of the bunch: it lacks features, but you can have it a single not-too-long file
@Joseph what "this"?
function getGetVar($var, $default = null) {
	return (array_key_exists($var, $_GET)) ? filter_input(INPUT_GET,filter_input(INPUT_GET, $_GET[$var], FILTER_SANITIZE_SPECIAL_CHARS),FILTER_SANITIZE_SPECIAL_CHARS) : $default;
}
08:54
yeah.. so what is the most suitable lib or tool for sending MS Outlook appointment trough php..?
@Joseph it's not
swift is the overkill option: all the features you can imagine
can u please explain ?
nette is the mid-range option
@Joseph no no no
08:55
@Joseph there is no generic "clean up" solution. You must sanitize/encode data as destination requires
@Joseph what are you doing with that input ?
OK guys.. I'm going to try with swiftmailer thanks everybody...
Thanks @zer
@Joseph validate your input, escape your output.
@zerkms
@Patrick validate input, encode everything
08:56
@Joseph validate your input, escape your output, use prepared statements for SQL
how do i escape my output ?
@Joseph depending on what you need it for
@Joseph don't blindly use silverbullets
@Joseph depends on what is the output (html, url, json, xml)
@JediDula all you need is to send an email with ics file. So you can just google examples of how to send emails with SwiftMailer for example
08:57
Your approach makes little sense in the context of database / text files / whatever
@nikita2206 Yeah.. is there any method to install SwiftMailer without composer...?
@JediDula probably. but why are you not using composer?
@Patrick because you can smell "newbie" on him/her
@tereško at least they know "composer" term

« first day (1522 days earlier)      last day (3652 days later) »