« first day (637 days earlier)      last day (4314 days later) » 
00:00 - 20:0020:00 - 00:00

8:00 PM
@OnlyBolivianHere , have you read either PHP in Action or PHP Object Oriented Solutions
 
@LeviMorrison when i remove this sql , the page comes , when i put it its blank page
 
that would cover the "intermediate" level .. or are you looking for something more advanced ?
 
@tereško That's why I love github
 
OK, there we go. New avatar.
 
@gosto Well, it sounds like you are writing a new piece of code. You should NOT use the mysql_* functions. The mysqli (notice the i) class has a very similar API to migrate to.
As for the actual error
 
8:01 PM
The first one sounds like a good starting point.
Thanks
 
Need to find a much better version of the image though. Cos it's a horribly badly cleaned up jpeg.
 
You should check mysql_error
 
@GordonM No anti-{{cencorship-tool}} avatar?
 
@OnlyBolivianHere Language Reference should be useful to you. You can skim read much of it.
 
Not for now. Coffee takes priority.
 
8:05 PM
@OnlyBolivianHere , yo could also watch/listen few lectures. There was a list in this comment ( scroll down to "OOP beyond classes" )
 
Bob Martin is a good source of wisdom for good coding. He's a Rails developer though, but don't hold that against him.
 
i do hold it against him ..
his lectures have been getting worse and worse
 
I am working on a website and I decided to use VS 2010 as the IDE. It sucks. Is there a way to get HTML5 intelli-sense to work with a file with a php extension?
 
Wow. The Windows Git GUI actually works pretty good
Wow somebody is using VS for HTML
 
haha
html, java, javascript, php and css
 
8:11 PM
But sorry I cannot help you with that. I hate "smart" IDE's
 
Hey, I am starting to understand why
 
:)
 
@atomSmasher If you chose VS because you have experience with it, etc, that's fine. I've never heard of anyone doing PHP development with it before, though.
 
@atomSmasher Isn't there an option to setup filetypes and formatting / nitellisense?
@atomSmasher maybe this will help:
33
Q: How to turn on Visual Studio 2010 .css Intellisense on .less file

aBetterGamerDoes anyone know how to enable css intellisense in a non .css file extension? I have a .less file that is basically a .css file but visual studio will not use .css intellisense on the file.

 
@leviMorrison - I decided to try it out because I am a computer engineering student. I am learning a lot of C++ and C# so I thought it would be a good idea to spend as much time in VS as possible. I like to use eclipse for Java, I guess I could go back to it. Thought I would try something new!
@peeHaa Thanks for the link.. I will take a look!
 
8:15 PM
@atomSmasher I recommend trying out several IDEs. I personally don't use a Windows machine for anything, so I have ~0 VS experience.
I have used it a little bit on a machine I had remote access to.
 
Do you linux?
 
Yep.
Been Linux-only for about 5 years.
Very happy with it.
 
I was thinking about making a partition for it. We have it in our Java labs at school.
 
I was mainly curious back then. I started having more and more problems on Windows and fewer and fewer ones on Linux, so I made the switch.
It was a bit painful at first not running to Windows whenever I didn't know how to do things.
 
@atomSmasher Just set up an Ubuntu VM ;)
 
8:18 PM
I'm really glad I made the change, though.
 
@NikiC , i would actually recommend to use some non-desktop linux distro
then again , you seem to be using Xorg on your "server"
 
@tereško I know you would. That's why I don't listen to you
 
.. maybe you should have
 
@nikic Thanks for the tip. I will check it out
 
In my eyes "Linux" and "With GUI" are not two mutually exclusive terms
And I seriously don't know what you made you think they are
 
8:22 PM
@atomSmasher There's plenty of better free IDEs! Try one of those!
 
@NikiC , but "server" and "with gui" are mutually exclusive
 
@tereško Uh, yeah, sure. But who's talking about servers here?
 
@GordonM Anything you recommend?
 
I don't know. Netbeans? Eclipse? Freaking NOTEPAD!
 
@peeHaa That link actually helped a lot. +1 to you :)
 
8:25 PM
@atomSmasher , here is a list : NetBeans, Aptana (or Titanium), PHPStorm, Komodo IDE, PDT, Anjuta (linux only) .. from the list PHPStorm and Komodo will cost money
i think that covers the most popular ones
 
Some claim PHPStorm is good, but I've never tried it. If you're okay with paying for an IDE (which I assume you are if you're a VS user) then maybe that one's worth a look.
 
@atomSmasher yw
 
i do rather like PHPStorm...they have a free demo too, if you wanna try before you buy
 
@GordonM I'd recommend PhpStorm after they've tried several others. 1. They'll appreciate it more and 2. they might not actually use the features that I do that make it worth it.
 
I recommend to avoid phpstorm , komodo and pdt
 
8:27 PM
@LeviMorrison Which features?
 
@tereško of course you do.
 
oh .. there is Zend IDE too ( but there is a good reason why everyone forgot to mention it )
 
haha.. I am torn between a smart ide and notepad. There are times when the intelli-sense saves lives. For example, just yesterday I was trying to discover a way to make my background image change with a fluid design. All of the google searches led to javascript or crazy WV fixes. But in reality CSS3 has it built in. The smart ide saved me tons of time (since I am still learning this stuff!) in this case.
 
@LeviMorrison I'd like to know these features. I'm using nearly no features I think ^^
 
@GordonM Their code refactoring tools are better than any other IDE for PHP I've tried.
And I do a lot of refactoring because I'm working on legacy code.
That's the biggest single help, I think.
There are other, not so important features.
UML diagrams.
 
8:29 PM
@teresko I have been wanting to use Komodo IDE, simply because it sounds awesome, and it make me aerodynamic.
 
@atomSmasher , you can always go with a smart editor instead of full blown IDE : Nodepad++, Notepad2, SublimeText, UltraEdit, PSPedit
 
Very good VCS (SVN, git, mercurial, you name it) support.
 
@LeviMorrison , since when that is a feature
 
Good integration with XDebug.
 
@teresko I think your are right, Notepad ++ it is.
 
8:31 PM
@tereško To be able to look at your code as a UML diagram? It really helps you see where your dependencies are.
They are also working on more refactorings that can be done from a UML view.
 
notepad++ isn't horrible, but really, there's quite a few benefits to a decent ide
 
I like PHPStorm's integration with PHPUnit too, if you run your unit tests from the IDE I suppose.
 
if you need a diagram to understand your code , there are some serious problems in your code
 
@tereško If you've ever had to work alongside a coder who just tears straight into coding without planning anything and realises half way through that (s)he has fucked the design up utterly but perseveres with it anyway due to the sunk cost fallacy, both UML and refactoring tools are invaluable.
UML is the thing you can rub their nose in after the fact :)
 
code completion, refactoring support, vcs integration, and that's just the stuff that comes to mind
 
8:33 PM
@atomSmasher , here is only unique feature that PHPStorm has: no save button, it autosaves code for you
the rest are common IDE features
 
that's another thing i like about it :)
 
@tereško Uh, I have never seen that . . .
@tereško Yes, there are serious issues with my code. That's also why I appreciate their superior code refactoring tools.
 
@teresko now we're talking!
 
ok .. here is a thought : lets stop the flamewar
 
8:35 PM
@LeviMorrison i have...it's kinda spiffy imo. i can't even count how many times an editor has crashed on me or i've just forgotten to save or whatever
 
@tereško You are the one who vehemently detests PhpStorm. Practically everyone else likes it. So guess what the problem is?
Express your opinion, that's fine.
But plenty of others have asked you to stop.
Two different messages were pinned over on the side about it.
 
@LeviMorrison , because you keep on listing insignificant and common features as the greatest thing since sliced bread
 
@tereško Say what you will, their code refactoring is better than any other PHP IDE out there.
And you don't get code refactoring in a smart text editor.
It is NOT insignificant. It saves me hours of time.
As I mentioned before, I recommend trying other solutions before PhpStorm. I didn't need the tools it provided until this project.
 
actually, i think netbeans has a pretty good refactoring
 
@tereško It regularly ***** my code.
Not to mention was highly unusable because it consumed all my memory and regularly went into scratch.
I'm sure I can dig up my own messages here in chat that tout Netbeans as a very good IDE.
 
8:42 PM
imho, storm's two significant features are the xdebug integration and autosave .. the rest are common
 
I guess I could just use jsFiddle
 
@tereško And you think xdebug integration is trivial?
 
for me, there are a bunch of errors that don't matter...it seems to think that every file is meant to stand on its own, so it was giving me crap about html that doesn't have doctype declarations and such
 
@cHao Which IDE are you talking about?
 
netbeans
 
8:43 PM
@LeviMorrison , "integration by default"
you actually can set up all IDEs to work with interated xdebug
 
That's probably true.
@tereško Have you looked at dart, Google's new web programming language?
 
It sounds like somebody still needs to Zuckerburg the modern IDE
 
hasn't everyone forgotten about Dart already ?
 
i got tired of making meaningless (and sometimes even breaking) changes just to shut netbeans up...and the error reporting was too coarse-grained to turn off the warnings that didn't matter without turning it off entirely for certain types of files. not just certain files, certain extensions
 
@tereško On the contrary, it's becoming more exciting.
I don't care about it's supposed JavaScript replacement.
I looks like it will be a very good server-side solution as well.
It's still early to tell.
 
8:47 PM
does even chrome support dart natively?
 
well .. on JS side i see it as another GWT like cry from google : "we cannot find enough food javascript developers !!"
 
@cHao Not yet. Have to use Dartium (which is just chrome with the dart VM in it).
 
psh.
 
@cHao It's a smart move, actually.
Its a LOT of new software. I'm sure it has all sorts of stability and security concerns.
I sure wouldn't want that in my every day browser.
 
i actually would like an IDE with PHP-MD support by default ... ehh ..
or that new concept that was floating around on the web
 
8:48 PM
i don't have to use any particular browser. :) and if they're not going to make their own stuff support it by default, it's not worth messing with yet
 
"Light Table" it was called : vimeo.com/40281991
 
@cHao As far as browser-side stuff goes, I agree with you.
@tereško Interesting.
@tereško That could potentially be a very, very useful IDE.
 
yes , and that's what i would call "special IDE"
 
nope
 
9:05 PM
I haven't used Clojure at all.
 
In honesty, I don't understand the hype around Light Table
As I see it, it basically is a Clojure-specific IDE. I don't think it would work out for many other languages, including PHP, Python, ...
 
@NikiC I think it would work for PHP.
Any interpreted language.
 
I think that the concepts of the languages are too different
Clojure has a ultra-small function concept
So that's where stuff like showing the control flow works
But PHP doesn't have that philosophy
And I think it doesn't work well for object oriented code anyways
 
9:35 PM
left my diet here tonight
back to PHP
 
@CharlesSprayberry Although it has a surprisingly good accepted answer.
 
Anyone know of any technique where you can use media queries to check an if statement and run php accordingly? Llike if (media and max-width=480px) { run php }
 
well ... you could include a specific 1x1 image with media query , which never gets cached and actually executes php script
alternatively you could call XHR via javascript with detected width
 
khm AJAX :P
 
AJAX is what uninformed marketing people call XHR
 
9:46 PM
I dislike both terms.
They both are tied to the term XML.
 
Okay, is vfsstream no longer in PEAR?
The given pear install command no longer works.
Oh wait, forgot to discover the channel. :P
so much for autodiscover.
 
user895378
@GordonM I've never used PEAR ... just clone it from github and include the necessary files from wherever you clone vfs to
 
user895378
never used it for vfsstream, I mean.
 
I hate PEARs!
 
10:00 PM
Filing a bug on PHP The Right Way because it fails to redirect to http://www.python.org/ or http://www.ruby-lang.org as expected.
 
well .. we already know that Jeff is a stupid troll
 
Affirmative. Well, not stupid maybe. A professional troll. Attention whore style
 
Okay, figuring out how to test this is going to be fun.
I'm trying to test out a class that reads from 'php://input'. I've defined that as a class constant and use static::constant to get at it within the class. So I should be able to replace php://input with some other path for testing. But how do I use vfsstream to mock php://input?
 
I've seen people saying you shouldn't save files in a session because that makes the session large. Is the issue that sessions are stored in memory? I don't see the problem if they're not stored in memory.
 
No, they're not stored in memory, but the entire session is read into memory for every page load that accesses the session.
 
10:11 PM
If you're only expecting one user to be storing files in the session, is this still an issue? (the files are for a "template", so shouldn't be too large, but of course, the user can upload what they want)
and the files will be deleted after they've been used, which shouldn't been too long (in theory)
 
Golden rule of coding: What you expect to happen is never what actually happens. Always be prepared for what might happen.
If you've got 1 user stuffing a half gig MP4 file into the session you might be okay. You won't when it hits 500 users all doing that at the same time!
 
The only use of it will be the upload a theme, which will be for admins only, so multiple users shouldn't be uploading at the same time
But I do agree, never assume something will be how you hope it will be
 
@JosephDuffy , session is NOT a form of cache
and it should not be used as such
if you wan temporary store a file, you a location in filesystem
 
Is there a better method? I can't use temp files as I need them between pages, and otherwise, I would have to set up a cron job to delete any files created.
But even then, there could be a point where cron job runs as the user loads the next page, hence loosing the files
losing*
 
why ?
just because you suck at writing cron script , does not make it a bad method
why would you delete files for user which is online ?
 
10:22 PM
Sorry I'm in new, it does not mean I "suck"
I'm here for help, not insults
 
I am just explaining it how I interpret the issue to be solved
 
yes, and you are bad at it
if you want to ensure that user's files are not removed , you should structure the temporary files in such a manner that you know which user owns which temp files
like having a separate directory for each user's temps
 
@JosephDuffy It sounds awfully like you want users to upload a theme every time they want to use one for a session. Is that right? If so, why?
 
@GordonM , what's worse , he want to keep it in session
 
10:25 PM
When a user wants to upload a new theme it needs to be stored between a couple of steps before moved to a permanent directory when the process is finished
 
then i fail to see the problem
it's almost as if you dont know how to move files
 
Where do I store the uploaded files, and when/how do I delete them if the user leaves the page without completing the process?
 
cron job
 
hire a developer
 
All I am trying to do is learn
So I run a job (say, ever 6 hours) that will check for temp files created longer than ~1 hour and delete those?
 
10:31 PM
that is up to you, I keep session data in database so I have better control over it... (e.g. delete users session)...
 
I'll have a bit more of a think then, as this is the first "problem" like this I have encountered so far, making it tricky for me :)
 
@tereško And he's on a roll:
 
@JosephDuffy It's fairly common for server operating systems to have housekeeping tasks running, one of them is one that scans the system temp directory at regular intervals for files that aren't open and haven't been accessed recently and delete them. If you just move_uploaded_file to the temp dir at the start of the process and move the file from there to its final destination at the end, then the OS housekeeping ought to take care of the case where the process is left unfinished
 
How can you even be a PHP programmer without a sense of humor? You write PHP. That's hilarious.
 
@sehe That guy's kind of a dick.
 
10:38 PM
@sehe I lost all respect for Jeff long before I read his PHP rants
 
Many people are. Until you get to know them. Some even after that.
 
@GordonM I am currently using the OS temp directory, so I guess it's already how it should be :) I will just delete the folder when I know I don't need it anymore, but otherwise leave it to the OS
Thank you :)
 
@NikiC You'd have to work really really hard to lose all my respect. That being said, you could easily lose all my interest long before that, and by then it doesn't really matter much :)
 
@sehe Nice to hear :)
 
@NikiC I meant it in the general sense. You too, of course :)
 
10:42 PM
@sehe And, I already wanted to say this a few times, you are a really awesome person. I usually hang around in the C++ chatroom just to listen to what you have to say ^^
 
Wow. What can I say. Thanks. It's nice to have some connection going with people from other rooms. It is quite apparent that we like SO chat for the same kind of reasons :)
 
:)
 
@NikiC Also, if you hang out enough in the lounge, you'll find that I'm actually learning from the greatest. I have heaps of respect for many a room regular there.
 
@JosephDuffy , i would recommend to avoid reliance on OS behavior, unless you have extensive knowledge in this area
 
@sehe Yeah, I already noticed that there are lots of smart people in the C++ room. Sadly the whole PHP mockery makes it look otherwise :/
 
10:47 PM
instead store the themes in /some_temp/<timestamp>/<userID>
you can keep the timestamp in user's session , and ID is there already
then when you run a cleanup script from cron , you just remove all folders that are older then 24 hours
 
@NikiC Yeah. Also, sometimes the room is jinxed and everything is just derailed for the sake of it. (Those in the know could always call for some cool and things would be back to normal in a jiffy, I feel)
Makes me wonder whether stuff like that never happens in this room. I can't imagine you always being serious. And stuff.
 
@NikiC , i think they are insecure
 
ROFL
 
@tereško Sounds good, and means I get to learn cron, I'll try it out
 
@JosephDuffy , you need to only read the manual , cron can easily launch php scripts too
2
Q: how to create a cron job that runs on the first day of month

Ahmet vardarThere are fields on my server's control panel like this Minute - Hour - Day of month - Month - Day of the week - Command How can i create a cron job runs on first day of the month with this fields ? Thanks

 
10:51 PM
I have created some cron jobs in the past, but I've never created one via PHP (which is what I will aim to do)
 
@sehe It isn't always serious, but the content policy in here is a lot stricter than in the C++ room ^^ Mostly on-topic
 
you do not create the "via" php
you just add another item in crontab
only in this case it executes a php script
 
But I would like to create the cron initially using PHP (e.g. during the install process), and not have the user manually create the cron job
Hence the "via" part :)
 
access to crontab require root permissions
 
Well that would be an issue then
 
10:54 PM
take it easy, one step at a time
 
@sehe I guess the problem is his expectations
 
@sehe can you download porn with C++ ? (seriously)
 
I can't see how that question could be serious. But, well, yes of course
Not that you would, because it would be like digging a tunnel with a surgical knife
 
@webarto Just so you know, I don't think that PHP is particularly appropriate for downloading porn either ;)
 
@webarto you can with any language? actually, PHP makes it easier ;)
 
10:58 PM
Or rather, it wouldn't be as easy as it sounds
 
what?.. .been there, done that, easy
 
Because you'd have to deal with either pcntl or curl_multi
 
it just happens that it is often mentioned in LoungeC++ and yesterday I gave an example, and said, beat that...
 
I've had much success with simple bash/perl combo's. Oh wait...
 
(Or you want only download one at a time?!)
 
10:59 PM
$html = file_get_contents('http://www.redtube.com/98250');
preg_match('#mp4_url=([^&]+)#is', $html, $matches);
$url = urldecode($matches[1]);
preg_match('#([0-9]+)\.mp4#is', $url, $matches);
file_put_contents($matches[0], file_get_contents($url));
 
oh yeah, okay, that case is trivial ofc
 
@NikiC most people only masturbate to one at a time
 
Giving new meaning to 'embarassingly parallel'
 
niki has 3 monitors, and by god he uses them :D
 
I don't always download porn, but when I do I use curl_multi
 
11:00 PM
@Leigh :D
Actually, I have only one monitor :(
 
@NikiC get a job you hobo
my monitors were £400 each, they're fucking sexy, but a complete waste of money
 
@Leigh I could just buy a few new monitors. That's easier ^^
Oh god no
Stas merged his tolower patch
I think this will be a terrible, terrible mess
 
is this the anti-unicode patch,,,
 
yes
I don't know whether or not it is right, but I definitely think it needs serious testing
 
github.com/php/php-src/commit/… @NikiC care to decypher? what has changed?
 
11:04 PM
Also, I don't like Turkey
 
did anyone tell him yet, that the community hates his parameter skipping implementation
 
So I don't care whether or not they can use their stupid locale :P
 
(named params > "default")
 
@webarto It implements locale-unaware lowercasing for class names etc
@Leigh I agree on that. But named parameters aren't that easy to implement (without overhead)
 
@NikiC that really catches it... locale unaware.
@NikiC of course, which is why I hope it's not implemented at all
maybe it's something for the php 6 discussion, if all function calls were parsed as if they had multiple / variable parameters
multiple was a bad choice of word there...
as if they had named parameters
 
11:09 PM
@NikiC You mean, you don't lıke Turkey
 
@Leigh I think PHP 6 should be based on a new engine. The PyPy thingy looks really nice for that. I think the existing Zend Engine has gone too messy over time :)
 
@NikiC I'd like it too, the "release procedure" rfc itself basically says .. "major version - break everything"
 
it would be a nice idea .. but it has that "never gonna happen" feel to it
 
@sehe People who say that PHP is a badly designed language just never saw Turkish before ... I mean ı, seriously?
 
@NikiC hey, i once fell in love with this girl, she was a turkish english teacher
she might just have been using me to help with her homeworks though :(
 
11:13 PM
@Leigh :D
 
@NikiC Lot's of them, to: bılıdırsınız and stuff like that all the time. They have this 'tail assonance' thing that 'turns' all subsequent vowels (like with Umläute) for the rest of the 'word'. And words get pretty big because they chain to gether words, verbs and a lot more (I forget the specifics)
 
@NikiC still can't believe you're so young, if I ever make it to berlin, you are going to be drunk
shy or not
 
@sehe Which makes me wonder where you know all that language stuff from ^^
@Leigh We'll see :P
 
@NikiC books. I had too few friends, I'm afraid. Too many interests. Also, I was young and didn't know about focus. Didn't have to, I like to think
 
if I don't get you out, my girlfriend will, but she's a python coder, you have been warned
 
11:17 PM
we have 5 turkish tv shows on air... simultaneously...
 
@Leigh Oh, a Cross-Language-Relationship :P
 
That's a cross-religion relationship
 
snake or elephant
 
@NikiC Agreed. When major versions are released, it's always the defence for backwards compatibility problems; why not leverage that inevitability to really change something.
 
00:00 - 20:0020:00 - 00:00

« first day (637 days earlier)      last day (4314 days later) »