Hi, can someone please explain as simply as possible to to create a php plugin system, i have read: http://stackoverflow.com/questions/217659/build-a-plugin-system-with-php http://www.sitepoint.com/forums/showthread.php?t=379440 and all the links on them, but they haven't really helped. All i have now gathered is that to do this, i probably have to write the classes that all the plugins will be able to use. I don't know how the plugins would be activated and how to do this all securely. Thanks
The best method will be creating a directory named "plugins" and inside that directory create the plugins with a specific format. For example the plugin file name should be some thing like PluginYourclass.php and each time when your application is loaded or plugins are called check inside the plugins directory and also check for the file name which starts with Plugin and load those classes. Inside the classes you will have to create options for creating the db or other objects if needed. Or you can create a common parent class which will do this job for you Thanks!!
If for example i created a script that connects to a database and retrieves the alphabet from a to z. Echoing them on screen, and someone wanted to create a plug-in that would say every 3 letters print there have been 3 letters and after the next 3 there have been 6 letters. If for instance the script before getting the alphabet, gets the sitename, homepath, and webpath from the database, after which it then gets the alphabet, how would a plugin that is meant to do something after it gets the sitename and so on but before the alphabet do this.
I have created a few plugin systems. Normally, I would use the database in conjunction with scripts and read the scripts. Any plugin with type "page" would become a loadable page if you went to plugin.php?page=PLUGIN_NAME (page=$name would retrieve the plugin file). If it was a sidemodule (provided this is CMS like) then you can add the information into a block. Finally, if it's a class or other, just have it load in the header of the site for each page. I also prefer to use ZipArchive to compress and decompress the mods when they're uploaded. Regards, Dennis M.
Thanks. I did look at wordpress before making this thread but, it didn't really help. I looked at the backup wordpress plugin.