I looked into registries (singleton registries), and while I can see the
advantage they provide, most every article I read advised AGAINST using
singleton registries because it creates extra dependencies (ie. a file needs
the database class AND the registry class instead of just the database
class)
Allen,
Before you go with my static-approach, please do consider Shawn's registry
pattern suggestion. That's pretty sweet too ;-).
A little response to your long text, before I help you fix the bug. A static
property is basically the same as a regular property on an object. Only
difference is tha
Sorry, and then I didn't keep it on list :-(
Shawn McKenzie wrote:
> Please reply to the list. Just google for "php registry pattern". Here is a
> very basic example. There are better OOP people here than I.
>
> class Registry {
> protected $_objects = array();
>
> function set($name,
Wouter,
Implementing your static idea was pretty easy, I was already referencing
Notifier with the :: operator in my other methods, however I am running into
trouble assigning new values to the static array.
I am getting a "syntax error, unexpected '[' " on this line of my Notifier
class:
Notifi
Allen,
The short answer (but don't follow this):
addToQ( .. );
}
}
?>
The long(er) answer:
I assume your Notifier object functions as singleton? Ie; accross your
entire application, there is only one instance of that class?
Why not go-static? That is, to my experience, the sweetest way to make
Allen McCabe wrote:
> Hey all (and Nirmalya, thanks for the help!),
>
>
> I have a question that I just can't seem to find via Google.
>
> I want to be able to add messages to a qeue whenever my classes complete (or
> fail to complete) specific functions. I think have a call within my html to
>
Hey all (and Nirmalya, thanks for the help!),
I have a question that I just can't seem to find via Google.
I want to be able to add messages to a qeue whenever my classes complete (or
fail to complete) specific functions. I think have a call within my html to
my Notifier class to print all qeued
--- On Tue, 12/15/09, Allen McCabe wrote:
> From: Allen McCabe
> Subject: [PHP] Class not functioning
> To: "phpList"
> Date: Tuesday, December 15, 2009, 6:17 AM
> Hey everyone, I just delved into
> classes recently and have been having
> moderate success so far.
>
> I have a puzzler though.
>
8 matches
Mail list logo