Jump to content

Plugin System


spudz

Recommended Posts

Sorry, I have a blog system that I'm working on for my clients (why not use one of the myriad of other blog systems? my clients are not tech savvy in any way, the system needs to be usable by a monkey). In this blog system I will have all the basic features of a blog, (ie. articles, comments, search, rss, tags, archives etc). However some clients will want extra functionality, I want to be able to add this functionality quickly and easily.

What I'd like to know is the easiest way to do this, I don't want to get too complicated Ii just want a simple 'Plugin' find, recognize and use system. Is there any articles, books or people that can educate me on this?
Link to comment
https://forums.phpfreaks.com/topic/27393-plugin-system/#findComment-125485
Share on other sites

We have a system where we create a template called "fred.html", and a script called "fred.php" containing the function "fred()".  That function populates an array of variables which are then passed to Smarty for use in fred.html

When a request is made for page "fred", the main script looks for these templates and files, and calls the function fred().

Is that the kind of thing you are looking for?
Link to comment
https://forums.phpfreaks.com/topic/27393-plugin-system/#findComment-127782
Share on other sites

Smarty is a template engine, not a plugin engine. :)

Plugins, aka modules, are interface designed objects that 'slot' into place and work alongside the main application.

Your plugins will need to know when to act and when to stop, likewise your main application will need to know when, and how to tell your plugins to start, and when to stop.

This is a very ambiguous aspect, so I'm sparing details as it comes down to personal preference on how to implement, as much as it does technical limitations.

However, I do [b]strongly[/b] suggest you make good use of interface design.
Link to comment
https://forums.phpfreaks.com/topic/27393-plugin-system/#findComment-127959
Share on other sites

  • 4 weeks later...
i created a plugin system once that stored each individual plugin's code in a database, then i had plugin locations such as "page_start", "page_complete" and any other location i thought might have had the potential to need some code pluging into it.

i would then call a function that would load all the code from each specific location and add it to one long string, then i would eval it. worked well enough for my needs. :)
Link to comment
https://forums.phpfreaks.com/topic/27393-plugin-system/#findComment-142686
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.