Plugin System Beginnings
Posted: Wed 24. Mar 2004, 17:29
With regard to plugins...
I am working on it and the it looks like there will be a few main things that a plugin will need.
1) A main backend file. Consider this the main() of your plugin. It will be responsible for handling any variables and doing things like initiating access to a database, file, or forms for entering data.
2) A main frontend file. Since most plugins will need some sort of way to be displayed in the front end this will be how it is displayed. The frontend functions will look through installed plugins and then when if finds one will look for whatever the plugin says to look for and output the results. This means your main frontend file must be the mechanism for doing this.
3) An installer file. This will be a script which will create any files, add tables, make directories, etc. This needs to be very well tested so you don't have some crazy recursive function creating some ridiculus file hierarchy forever.
I hope that helps anyone makeing addons and such to phpwcms so you can start making plugins more compatible with potential future plugin systems. There may be other requirements but for the most part this is what is required. If you have questions about how to add a plugins menu item so you can really keep things separate please let me know and I can give you a little code.
At the moment I am working on registering plugins so a new user would just upload a plugin (a directory with files) to a plugin directory and then register it in the admin similar to the ftp file takeover. Everything is looking good and if people who start making mods start making them more like I described above, things will move much easier when the real plugin system is developed.
As always comments, questions, etc. are welcomed.
I am working on it and the it looks like there will be a few main things that a plugin will need.
1) A main backend file. Consider this the main() of your plugin. It will be responsible for handling any variables and doing things like initiating access to a database, file, or forms for entering data.
2) A main frontend file. Since most plugins will need some sort of way to be displayed in the front end this will be how it is displayed. The frontend functions will look through installed plugins and then when if finds one will look for whatever the plugin says to look for and output the results. This means your main frontend file must be the mechanism for doing this.
3) An installer file. This will be a script which will create any files, add tables, make directories, etc. This needs to be very well tested so you don't have some crazy recursive function creating some ridiculus file hierarchy forever.
I hope that helps anyone makeing addons and such to phpwcms so you can start making plugins more compatible with potential future plugin systems. There may be other requirements but for the most part this is what is required. If you have questions about how to add a plugins menu item so you can really keep things separate please let me know and I can give you a little code.
At the moment I am working on registering plugins so a new user would just upload a plugin (a directory with files) to a plugin directory and then register it in the admin similar to the ftp file takeover. Everything is looking good and if people who start making mods start making them more like I described above, things will move much easier when the real plugin system is developed.
As always comments, questions, etc. are welcomed.