-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Modules and Extensions #434
Comments
Looks good to me... I will add that with my time with Drupal 7 the modules (including core modules) use categories and they are probably more of your "free for all" concept and is something I mentioned in the past. but it works quite well. With an add on for Drupal you can collapse the categories so you just have a list of the ones you are looking for. Yes if you have some modules installed it becomes a long list but personally I think it works very well. Here is a screen shot from a site I take care of: Note that at the top there is an area that shows a status message for available updates (Will say everything is up to date or will point out there are modules that need to be up dated) There are tabs which will allow you to update modules that have updates and an uninstall tab that allows you to uninstall modules that have been disabled. This just shows part of the "core" category and a few modules that are installed. This then shows the name of the module, the version, a short description of the module. The description portion also includes a dependency portion that shows any dependencies required or recommended for the module and if they are installed and/or enabled. With drupal as shown in this screen shot you also can also show any HELP, Permission settings or Configure options to select on. As I said it is very nice and works well. The ONLY issue I have seen with it is that the lists tend to get long but you can collapse the category. There is an enhancement for drupal that allow you to remove much of the information included as well. The enhancement has a switch instead of the check box and looses much of the rest of the information. I find myself using the information so I leave the original version enabled. If you play with Drupal at all you will note that a module may actually install many modules under more than one category. This is useful for installing plugins that use the modules that are part of the module package and allows easy enhancements. With Drupal they actually separate most modules into more than one module for easy of turning off portions you don't need as well. One concept I have seen over and over is that a lot of modules will have a UI portion and a standard portion. A more complex module may have MANY modules as part of the system and have modules that help enhance other categories as well. The UI modules generally are ADMIN menus for the module and if you want to further secure your site you can disable or even remove the UI modules in many cases which would make it very difficult for someone with admin access to modify settings for the module. And yes that simple site I showed has probably 10 pages of modules if you list them all. But it works well and is very informative. I do hope Xoops in the future has something similar. I do find it hard to come back to Xoops admin system after Using Drupals. They still have a configuration menu as you can see from the screen shot but for the modules this design is the best I have used and as I already mentioned I hope Xoops can use something similar. |
Richard, 1) Namespacesthis makes perfect sense.
but we have singulars in:
and now in the DB we have: system_module. Since we're listing several modules, a plural "system_modules" seem to me more natural and consistent. I would also change /class and /language to plurals 2) Modules vs. ExtensionsThis also makes perfect sense, now that we have Service Providers. 3) Add a modinfo column to system_moduleThat makes sense. |
It really comes down to which way you look at it. From the collection of objects view it is tool box. From the other end, the SQL select perspective, it is a more natural construct to select from tools. In the end, it is divisive issue, but I went with singular. Not worth a holy war - that work is done, and internally consistent. There is a certain amount of historical baggage we will end up carrying in folders, so the best we can do is to be consistent in movement as we progress. The pattern for folders is, as you point out, overwhelmingly plural. The language folder is well on the way to being dead, and for BC only. We can move to classes for base in the new namespaced standard.
Configurations would get a similar solution. There are several areas for improvement there, so I will keep your observations in mind. Thanks for the feedback! |
I would just use
And XoopsLoad would look for the class in private folder and in public folder. |
I've given a lot of consideration to modules, and have a few ideas I want to present. If you have comments, alternatives, objections or other feedback, please respond. Baring objections, I would like to move on this quickly.
Namespaces
Add a namespace column to system_module table. This would be the PHP namespace for the module's code. It would map to the module's class directory in PSR-4 fashion. This would be implemented automatically for all active modules with a namespace specified.
Note, this will be separate from the composer maintained loader, since composer has no way of knowing if a module is "active" in XOOPS. Autoloading components from modules which are not installed or inactive could create lots of issues.
With the namespace enabled, most of the old directory positional naming constructs can be replaced with objects. For example, instead of using the $modversion['onInstall'] entry to locate a file to include, then building function names based on the module name, the code would look more like this:
Our current
preloads
directory, with possibly multiple files, would disappear, and everything would reside in the$moduleNamespace . 'System\Events'
class instead.In this scheme, the
class/System
directory would be reserved for the system specified classes. Each would have a specific interface defined.There are more details, but this should illustrate the concept.
Modules vs. Extensions
Based on some thoughts from @bitcero and some more consideration, I propose eliminating the extension concept as is, and moving to a module category system to make management cleaner.
Categories would be something like this:
This is not carved in stone, but the idea is to create a limited, high level taxonomy to categorize modules. The defined categories would be enforced, as we don't need a free for all. The module listing functions would be adapted to deliver lists of individual categories.
A category column on the system_module table would hold this item. To support subtle differences, each category would be backed by a sub class of the system module class, but all would offer the same functionalities.
Add a modinfo column to system_module
Caching of the
$modversion
array has been suggested many times. Adding a single column set on install and update can accomplish this, and the existinggetInfo()
and related methods will be able to use the column data as the source, eliminating the need to hit the filesystem.With this information in the database, all the module object access can be fully cached, which should speed thing up a bit.
The text was updated successfully, but these errors were encountered: