Re: How to implement a plugin system?
| From: | Hamza Saglam | Date: | Mon, 06 Aug 2007 21:22:10 +0000 |
| Subject: | Re: How to implement a plugin system? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-260250@lists.php.net to get a copy of this message | ||
I think I have a rough understanding of the whole process so I should start
coding :)
Many thanks to everyone for your suggestions.
Regards,
Hamza.
""Hamza Saglam"" <hamzasaglam@googlemail.com> wrote in message
news:FD.3A.37767.22577B64@pb1.pair.com...
> Hello all,
>
> I am working on a project which needs to have some sort of plugins
> architecture and I am kinda stuck. Basically I want to give a list of
> items to the user, and according to his/her selection, I want to load
> relevant functionality into my application.
>
>
> I was thinking of having an abstract plugin class, and have the
> plugins implement that but then how would I actually load the plugins?
> Say for instance I want to load plugins X,Y,Z (and lets say i
> implemented them as [X|Y|Z].class.php) , should I just 'include' (or
> require) them? Or should I initialize all possible plugins and just
> pick the ones user has chosen (which sounds a bit pointless as it
> would load unnecessary stuff)?
>
>
> How would you go about doing something like this?
>
>
> Thanks.