ezrpg-legacy / ezRPG-1.2.x

ezrpgproject.net
8 stars 7 forks source link

Re-examine the module manager #4

Closed uaktags closed 11 years ago

uaktags commented 11 years ago

I'm thinking of recoding a few things in the logic of the module manager. Such changes would include the list_plugins page would perform 3 functions: 1) Load all db info pertaining to Modules 2) Scan Modules/* Admin/* and Hooks/*, load all file names into array 3) Check if there's a new addition that's not on the db, or vice versa.

If 3) fails then remove it from the DB or Show Install link on the Plugin Manager.

Another thing was to create standard _install _uninstall _activate _deactivate methods that must be checked during Upload / Install.

Upload method will check the zip for a defined structure of there must be folders Modules/ Admin/ or Hooks/ as these are the only plugin-able features (lib/ as well?). If these succeed, then next part of the scan is grab the name of the folder inside Module/Admin (save for later) and/or grab name of the next file in the folder (index.php for Module/module_name/* & Admin/module_name... *.php for hook)

Now we have Module_Name folder saved, we know if it's a Module, and we know the file that's inside Module_Name. 1 quick check of Include_Once, then if method_exists ('_install', _uninstall) move on, if not InvalidPlugin, delete uploaded file. If we succeed, then now we know it's a plugin, load it into the Plugin Manager for listing, and move files into needed places.

{Work_In_Progress}