12 Commits

Author SHA1 Message Date
David Mudrák
30c264211e MDL-49329 admin: Fix reported coding style warnings 2015-10-10 09:15:27 +02:00
David Mudrák
4f18a4e60c MDL-49329 admin: Introduce new \core\update\remote_info class
This is just a thin wrapper for normal objects, allowing us to have
explicit type hinting / declarations in method signatures.
2015-10-08 23:32:05 +02:00
David Mudrák
cc5bc55ead MDL-49329 admin: Add core_plugin_manager::available_updates() method
The new method is going to be used to support the "Update all plugins"
feature.
2015-10-08 23:32:04 +02:00
David Mudrák
4441d5e5fb MDL-49329 admin: Fix report on required core version in missing plugins
If the plugin was missing from disk, the required core version was
displayed as "Moodle {$a}" because the core dependency resolver always
returns an object.
2015-10-08 23:32:04 +02:00
David Mudrák
35f2b67442 MDL-49329 admin: Fix the API for getting remote plugin info
The previous version of the plugin manager's method
get_remote_plugin_info() was suitable for installing missing
dependencies only. To make use of for installing new plugins and/or
available updates, it must be clear that we are requesting information
for the particular plugin version only, not "given or higher" version.
2015-10-08 23:32:04 +02:00
David Mudrák
5a92cd0b8d MDL-49329 admin: Display missing dependencies on plugins check screen
The patch improves the dependencies resolution in the plugin manager so
that the information about availability of the missing dependency is
included and can be displayed at the Plugins check screen during the
upgrade.
2015-10-08 23:32:03 +02:00
David Mudrák
c44bbe35bf MDL-49329 admin: Improve loading of available updates info
The actual loading of available updates info objects is moved back to
the plugin manager class. As we can now mockup the manager in unit
tests, this allows us to bypass the real \core\update\checker and have
unit tests for \core\plugininfo\base::available_updates().
2015-10-08 23:32:02 +02:00
David Mudrák
2d488c8f01 MDL-49329 admin: Keep reference to plugin manager in plugininfo objects
Plugin info objects are owned by the plugin manager (composition
pattern). Even if the plugin manager is a singleton, we need to keep
explicit reference to the plugin manager that owns the plugin info so
that we can mock up things in unit tests.

Therefore this patch introduces a new property of plugin info objects
that holds the reference to the instance of the plugin manager that made
(and hence owns) the given info instance.

The only trouble here is with static methods of plugin info classes such
as \core\plugininfo\base::get_enabled_plugins(). In these cases, the
code keeps using the core_plugin_manager singleton. The solution would
be to pass the plugin manager instance as a parameter but that is not
worth of change for now, IMHO.
2015-10-08 23:32:02 +02:00
David Mudrák
361feecdcf MDL-49329 admin: Make core_plugin_manager better suited for unit testing
We can now override the plugin manager's methods in the testable
subclass while still keeping the singleton behaviour of it. The change
makes use of late static binding.
2015-10-08 23:32:02 +02:00
Frederic Massart
6b61c2c45f MDL-46124 libraries: Final deprecation of text libs and plugin libs
- textlib_get_instance
- textlib
- collatorlib
- plugin_manager
- plugininfo_base
2014-12-15 17:02:31 +08:00
Petr Škoda
e87214bda7 MDL-42078 multiple uninstall improvements and cleanup
Includes:
* update checker refactored to \core\update\ namespace
* plugininfo classes refactored to \core\plugininfo\ namespace
* plugin_manager renamed to core_plugin_manager
* redirect back to original page after plugin uninstall
* fixed assign subplugin uninstall
* move assign subplugins under the assignment in admin tree
* fixed plugininfo for all question related plugin types
* auth uninstall support
* added missing block dependencies
* added theme uninstall
* subplugin types are following the plugin on plugin overview page
* several performance improvements in plugin manager
* new warnigns when plugininfo are outdated or missing
* multiple fixes and other improvements
2013-10-07 13:10:36 +02:00
Petr Škoda
bde002b81a MDL-41437 rework plugin_manager caching and version info in blocks and modules
This patch includes:

* version column removed from modules table, now using standard config, this allows decimal version for modules
* version column removed from block table, now using standard config, this allows decimal version for blocks
* module version.php can safely use $plugins instead of module
* new plugin_manager bulk caching, this should help with MUC performance when logged in as admin
* all missing plugins are now in plugin overview (previously only blocks and modules)
* simplified code and improved coding style
* reworked plugin_manager unit tests - now using real plugins instead of mocks
* unit tests now fail if any plugin does not contain proper version.php file
* allow uninstall of deleted filters
2013-09-22 21:25:26 +02:00