A simple plugin manager class to handle all plugins by request or more

View: New views
5 Messages — Rating Filter:   Alert me  

A simple plugin manager class to handle all plugins by request or more

by David Toniolo () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi @ll,

inspired by some postings about plugins on zfforum.de, i decided to write a plugin manager class handles my plugins by request. This means, e.g. my Plugin_Auth class does not load, when there is a request on a site which does not need an authentication.

I could write much text now about how to implement the plugin manager in your bootstrap and about the many possibilities and options, but i don't. Feel free to copy the source and edit it if you want.

I would be happy, about some feedback and suggestions for improvement.

source code

API

Re: A simple plugin manager class to handle all plugins by request or more

by David Toniolo () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Links changed:

source code

API

Now it is a full useable version supports giving arguments to plugin classes, searching in many directories for class files, etc.

Hope you like it.

Bye,
David

Re: A simple plugin manager class to handle all plugins by request or more

by Ralph Schindler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi David,

This is interesting work.  While the scope of your Plugger is pretty
high-level, I think you might be able to leverage a component already in
Zend Framework to handle what you call "areas" and loading.

http://framework.zend.com/manual/en/zend.loader.pluginloader.html

While Zend_Loader_PluginLoader has a very finite scope, you might be
able to make use of it in the low-level area of loading, and your
component could concentrate on plugin management, plugin construction,
plugin dependency, and mvc intgegration that would be needed by a
full-fledged plugin system.

All in all, good stuff!

-ralph

David Toniolo wrote:

> Links changed:
>
> http://php.online-skripte.de/Mtwd_Zend_PluggerPlugin/api/ Doku + API
> http://sources.online-skripte.de/Mtwd_Zend_PluggerPlugin.phps Source
>
>
> Now it is a full useable version supports giving arguments to plugin
> classes, searching in many directories for class files, etc.
>
> Hope you like it.
>
> Bye,
> David
>


Re: A simple plugin manager class to handle all plugins by request or more

by David Toniolo () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

At first, i decided to change my library's name from Mtwd to Bolzz. So, the links and the classname changed again. Sorry for that!

source code

API

@Ralph Schindler
Thanks for your feedback. I implemented the PluginLoader you said, and the benefit was great. There are no more constants for file extension and a default path. Also the member array $paths could be canceld.

And further a new feature for my Manager is coming with this PluginLoader class - class names and filenames can be different now. So, i don't have to implement this by myself.

Thanks a lot.

David Toniolo wrote:
Hi @ll,

inspired by some postings about plugins on zfforum.de, i decided to write a plugin manager class handles my plugins by request. This means, e.g. my Plugin_Auth class does not load, when there is a request on a site which does not need an authentication.

I could write much text now about how to implement the plugin manager in your bootstrap and about the many possibilities and options, but i don't. Feel free to copy the source and edit it if you want.

I would be happy, about some feedback and suggestions for improvement.

highlighted source code

API and Documentation in one ;)

Re: A simple plugin manager class to handle all plugins by request or more

by David Toniolo () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello all,

i have written a quickstart tutorial for the Plugger. It is written in German, sorry for that, but i think the code is easy to understand.

Quickstart Tutorial

greetings,
David