[PHP] Re: using mysql_close() = best practice?

2009-10-26 Thread Eric Bauman
On 24/10/2009 7:36 PM, Kim Madsen wrote: Hi PHP closes an open db connection when the script is done. I've read somewhere that in PHP6 this behaviour will dissapear, is this true? In that case using mysql_close() would definetly be best practice in all current scripts, to make it portable. A n

[PHP] What is the best practice for adding persistence to an MVC model?

2009-10-26 Thread Eric Bauman
I'm in the process of implementing an ultra-light MVC framework in PHP. It seems to be a common opinion that the loading of data from a database, file etc. should be independent of the Model, and I agree. What I'm unsure of is the best way to link this "data layer" into MVC. I've considered a

Re: [PHP] Re: Insult my code!

2009-10-12 Thread Eric Bauman
On 12/10/2009 9:21 PM, David Otton wrote: 2009/10/11 Eric Bauman: As before, please feel free to insult my code. ;-) Any and all feedback is of course most appreciated. I know you're more concerned with structure, but your checkInt() method is arguably buggy/has an un-noted assumptio

[PHP] Re: Insult my code!

2009-10-11 Thread Eric Bauman
On 7/10/2009 5:34 PM, Eric Bauman wrote: Hi there, I'm in the process of trying to wrap my head around MVC, and as part of that, I'm attempting to implement a super-tiny MVC framework. I've created some mockups of how the framework might be used based around a very simple

Re: [PHP] Insult my code!

2009-10-08 Thread Eric Bauman
On 8/10/2009 5:18 PM, Mert Oztekin wrote: Hi Paul, As I agree some of your thoughts, I want to add my opinion also. Yes the code should work. That is why we earn Money. If it doesnt work, then we are on fire. But things like OOP or MVC weren't invented for a better running code. They are inven

[PHP] Re: what is php4 popularity?

2009-10-08 Thread Eric Bauman
On 8/10/2009 4:28 PM, Paul M. wrote: Hey guys, does anyone have a good link for an article where php4 popularity trends are examined? The best way for me to know php4 % and php5 %. I appreciate any good suggestions. Here's a pretty graph comparing PHP version usage and time: http://www.nexen.n

Re: [PHP] Insult my code!

2009-10-08 Thread Eric Bauman
On 8/10/2009 1:20 AM, Andrea Giammarchi wrote: So far I stopped at the first line, the constructor, where I can spot with what I can read SQL injections "everywhere" I hope here is a proper validation there, 'cause as is, sounds truly dangerous, since you are not using bindParams or other PDO

Re: [PHP] Insult my code!

2009-10-07 Thread Eric Bauman
On 7/10/2009 7:25 PM, David Otton wrote: 2009/10/7 Eric Bauman: Any thoughts would be much appreciated! One observation. "Model" isn't a synonym for "Database Table" - models can be anything that encapsulates business logic. Requiring all your models to inherit fro

Re: [PHP] Insult my code!

2009-10-07 Thread Eric Bauman
: Eric Bauman [mailto:baum...@livejournal.dk] Sent: Wednesday, October 07, 2009 9:35 AM To: php-general@lists.php.net Subject: [PHP] Insult my code! Hi there, I'm in the process of trying to wrap my head around MVC, and as part of that, I'm attempting to implement a super-tiny MVC framew

[PHP] Insult my code!

2009-10-07 Thread Eric Bauman
Hi there, I'm in the process of trying to wrap my head around MVC, and as part of that, I'm attempting to implement a super-tiny MVC framework. I've created some mockups of how the framework might be used based around a very simple 'bank', but I'm trying to get some feedback before I go and