spudz Posted November 15, 2006 Share Posted November 15, 2006 Hi, I was just wondering if anyone could point me in the direction of some articles or books about creating a plugin system with php or if anyone has completed a system and would be willing to share how they did it and give me an idea of the code, design etc involved.Thanks Quote Link to comment https://forums.phpfreaks.com/topic/27393-plugin-system/ Share on other sites More sharing options...
Jenk Posted November 16, 2006 Share Posted November 16, 2006 Could you be a little less ambiguous?a "plugin" system means nothing.. a blank page meets the definition of a "plugin" system. Quote Link to comment https://forums.phpfreaks.com/topic/27393-plugin-system/#findComment-125457 Share on other sites More sharing options...
spudz Posted November 16, 2006 Author Share Posted November 16, 2006 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? Quote Link to comment https://forums.phpfreaks.com/topic/27393-plugin-system/#findComment-125485 Share on other sites More sharing options...
btherl Posted November 21, 2006 Share Posted November 21, 2006 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.htmlWhen 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? Quote Link to comment https://forums.phpfreaks.com/topic/27393-plugin-system/#findComment-127782 Share on other sites More sharing options...
spudz Posted November 21, 2006 Author Share Posted November 21, 2006 Ya that sort of what I'm looking for although that method seems a little messy, I'm not sure I want to use smarty either. Something like Mint's Pepper System is more along the lines of what I'm looking for. Quote Link to comment https://forums.phpfreaks.com/topic/27393-plugin-system/#findComment-127884 Share on other sites More sharing options...
Jenk Posted November 21, 2006 Share Posted November 21, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/27393-plugin-system/#findComment-127959 Share on other sites More sharing options...
Nooty Posted December 17, 2006 Share Posted December 17, 2006 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. :) Quote Link to comment https://forums.phpfreaks.com/topic/27393-plugin-system/#findComment-142686 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.