[PHP] static Logging class?

2013-03-03 Thread Lars Nielsen
Hi, I work on a little hobby-project, and i want to make a oo logging facility. (php5.3 oop) Is it best to make a class with static functions that i can call from my other classes? Or is it more appropriate to make a real logging-class i should instantiate every time i need to log something? (I

Re: [PHP] static Logging class?

2013-03-03 Thread Ravi Gehlot
Hello Lars, I would apply the Singleton Pattern where you would have 1 instance for you entire application. As far as whether or not to use a static method, I would weigh the options. If you just want to call a method that you know will not have to be changed in the future and that method will not

Re: [PHP] static Logging class?

2013-03-03 Thread Larry Garfield
Make a real classed object that you pass to various objects that need it. Otherwise you make your life way harder for unit testing. Don't have a class that self-enforces that it's a singleton. That way lies pain. In particular, I recommend using or writing a class based on the PSR-3 recomme

Re: [PHP] static Logging class?

2013-03-03 Thread Lars Nielsen
Thanks a lot Larry! This PSR-3 looks just the way to do such things! :-) I hope i chat with you at DrupalCon Praha! http://www.linkedin.com/profile/view?id=18644639 Best regards Lars Nielsen > Make a real classed object that you pass to various objects that need > it. Otherwise you make your lif

[PHP] Re: Holding "datetimes" in a DB.

2013-03-03 Thread Richard Quadling
On 1 March 2013 10:49, Richard Quadling wrote: > Hi. > > My heads trying to remember something I may or may not have known to start > with. > > If I hold datetimes in a DB in UTC and can represent a date to a user > based upon a user preference Timezone (not an offset, but a real > timezone : Eur

Re: [PHP] static Logging class?

2013-03-03 Thread Ravi Gehlot
Hello Larry, Thanks for sharing! - [image: logo] *Ravi Gehlot * Mobile: 407-283-5282 Orlando, FL 32765-8085 http://www.RaviGehlot.Net/ https://github.com/ravigehlot *"First, solve the problem. Then, write the code."* [image: Twitter]

Re: [PHP] Introduction ... !

2013-03-03 Thread Ravi Gehlot
Hello Nick, Welcome to the list. I joined the list awhile back then unsubscribed for no apparent reason. This list was very active years ago. I came back about a few months ago just as a watcher. I didn't really post or participate at all. I guess, there are a lot of watchers "only" people here. T

[PHP] Open form in new window

2013-03-03 Thread John Taylor-Johnston
I have many different submit button. When php processes value="Enter Data", I would like to open a new window, but only if I click this one. Possible? I knw ther is an HTML target="" thingy. Can PHP do anything magic? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] Re: Open form in new window

2013-03-03 Thread Maciek Sokolewicz
On 4-3-2013 6:44, John Taylor-Johnston wrote: I have many different submit button. When php processes value="Enter Data", I would like to open a new window, but only if I click this one. Possible? I knw ther is an HTML target="" thingy. Can PHP do anything magic? No, it can't. PHP is a *serv