Here's some note I have for NP_PluginManager (NP_PM) design.
-
a centralize server for the NP_PM to query for updated plugins
-
allow install and upgrade of plugins
package crc/signature is needed for file integrity check against trojan and alike
-
basic idea is to add a pversion column in nucleus_plugin, new version overwrite existing one, plugin admin menu detect it and list it for user to click for upgrade, upgrade is done by calling upgrade($oldversion) from the new code, also update event subscription list
I think it's not a good idea to just overwrite the fileas it might failed and user will be in hell to roll it back, maybe better to store it on a temp location until user click to upgrade. The drawback is the plugin need to do more to move the file and backup the old files (so we can rollback if failed)
needsUninstallToUpgrade($oldversion) can be used to checked whether to uninstall for upgrade
updateRequirement($currentInstalledVersion) can be used
can we just uninstall/re-install plugin??
user still have to follow the rest of the install instruction to get a plugin to work…
This mechanism is need for seamless plugin upgrade. ie mysql table structure changed. Yes, we can simply uninstall/re-install, but all current user data for this plugin likely lost when unInstall() drops all the tables. If we hacks the code to skip unInstall, the plugin will not work properly in this case as table structure changed….
Pre-alpha code to test out some basic with new plugin add and update check function, to try out server-client protocol, zip file operation, zip download
For 1st version, we can first implement just the upgrade function, and introduce install function later
For upgrade function, we can do with uninstall/re-install and no signature/integrity check. However, initial design should take these into account
Plugin install function will be added later
We should implement plugin upgrade
API in core and make this plugin use it in a later stage. For cases that a plugin db table structure changed, I think we might be able to put in logic in install() to detect if plugin table is create and called upgrade() for now.
This plugin actually a set of 2 plugins; one acts as query/download/admin server and the other as install/upgrade client
provide a plugin admin menu to list all current plugins
function to add new plugin, which track all version of the plugin
function to add new version, each new version add becomes the latest version, admin has to fill in info like version/description/note, signature for each version is generate, how to uplod file to server? file upload manager?
FTP??
function to delete plugin and all version of the code
function to delete a version of a plugin
function to update a plugin info
function to update a version of plugin ie. replace code
install action event is used as client query/download entry point? or do like NP_pluginplugin that with an external php
a plugin writer can run their own server to serve the plugin before it is added to the central server.
some kind of auto plugin submission between servers?
a plugin browse/list page for user
provide a plugin admin menu to display list of updated plugins ready for upgrade
client is configure to point to one central repository server
update query can be trigger manual or automatically
function to browse available plugins (in future release) one idea is to put this function on the wiki, with an install url to point to NP_PM server.
a skinvar can be added to warn admin when a updated plugin is available
Should we use
XML-
RPC or Nucleus action as web service
API?
get all available request: send from client to server, no parameter
get all available response: send from server to client, contain list of all available plugins
get plugin info request: send from client to server, contain plugin name(s)
get plugin info response: send from server to client, contain plugin names, version, url/alt url, note, md5, upgrade method