Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
|
Public Member Functions | |
all_plugins_ok ($moodleversion, &$failedplugins=[], $branch=null) | |
Checks all dependencies for all installed plugins. | |
archive_plugin_version (\core\plugininfo\base $plugin) | |
Archive the current on-disk plugin code. | |
are_dependencies_satisfied ($dependencies) | |
Check a dependencies list against the list of installed plugins. | |
available_updates () | |
Returns a list of all available updates to be installed. | |
can_cancel_plugin_installation (\core\plugininfo\base $plugin) | |
Can the installation of the new plugin be cancelled? | |
can_cancel_plugin_upgrade (\core\plugininfo\base $plugin) | |
Can the upgrade of the existing plugin be cancelled? | |
can_uninstall_plugin ($component) | |
Is it possible to uninstall the given plugin? | |
cancel_plugin_installation ($component) | |
Removes the plugin code directory if it is not installed yet. | |
check_explicitly_supported ($plugin, $branch) | |
Helper method to determine whether a moodle version is explicitly supported. | |
filter_installable ($remoteinfos) | |
Given the list of remote plugin infos, return just those installable. | |
get_enabled_plugins ($type) | |
Get list of enabled plugins of given type, the result may contain missing plugins. | |
get_installed_plugins ($type) | |
Return list of installed plugins of given type. | |
get_parent_of_subplugin ($subplugintype) | |
Returns the name of the plugin that defines the given subplugin type. | |
get_plugin_info ($component) | |
Returns information about the known plugin, or null. | |
get_plugin_types () | |
Returns the result of core_component::get_plugin_types() ordered for humans. | |
get_plugin_zip_root_dir ($zipfilepath) | |
Detects the plugin's name from its ZIP file. | |
get_plugins () | |
Returns a tree of known plugins and information about them. | |
get_plugins_of_type ($type) | |
Returns list of known plugins of the given type. | |
get_plugintype_root ($plugintype) | |
Returns the full path of the root of the given plugin type. | |
get_present_plugins ($type) | |
Get list of present plugins of given type. | |
get_remote_plugin_info ($component, $version, $exactmatch) | |
Returns information about a plugin in the plugins directory. | |
get_remote_plugin_zip ($url, $md5) | |
Obtain the plugin ZIP file from the given URL. | |
get_subplugins () | |
Returns list of plugins that define their subplugins and the information about them from the db/subplugins.json file. | |
get_subplugins_of_plugin ($component) | |
Returns list of all known subplugins of the given plugin. | |
get_uninstall_url ($component, $return='overview') | |
Returns uninstall URL if exists. | |
install_plugins (array $plugins, $confirmed, $silent) | |
Perform the installation of plugins. | |
is_directory_removable ($fullpath) | |
Check if the given directory can be removed by the web server process. | |
is_plugin_folder_removable ($component) | |
Check to see if the given plugin folder can be removed by the web server process. | |
is_plugintype_writable ($plugintype) | |
Is it possible to create a new plugin directory for the given plugin type? | |
is_remote_plugin_available ($component, $version, $exactmatch) | |
Is the given plugin version available in the plugins directory? | |
is_remote_plugin_installable ($component, $version, &$reason=null, $checkremote=true) | |
Can the given plugin version be installed via the admin UI? | |
list_cancellable_installations () | |
Returns plugins, the installation of which can be cancelled. | |
list_restorable_archives () | |
Returns list of all archives that can be installed to cancel the plugin upgrade. | |
load_available_updates_for_plugin ($component) | |
Returns list of available updates for the given component. | |
missing_dependencies ($availableonly=false) | |
Return a list of missing dependencies. | |
other_plugins_that_require ($component) | |
Get a list of any other plugins that require this one. | |
plugin_external_source ($component) | |
Check to see if the current version of the plugin seems to be a checkout of an external repository. | |
plugin_name ($component) | |
Returns a localized name of a given plugin. | |
plugintype_name ($type) | |
Returns a localized name of a plugin typed in singular form. | |
plugintype_name_plural ($type) | |
Returns a localized name of a plugin type in plural form. | |
remove_plugin_folder (\core\plugininfo\base $plugin) | |
Remove the current plugin code from the dirroot. | |
resolve_requirements (\core\plugininfo\base $plugin, $moodleversion=null, $moodlebranch=null) | |
Resolve requirements and dependencies of a plugin. | |
some_plugins_updatable () | |
Checks if there are some plugins with a known available update. | |
uninstall_plugin ($component, progress_trace $progress) | |
Uninstall the given plugin. | |
unzip_plugin_file ($zipfilepath, $targetdir, $rootdir='') | |
Extracts the saved plugin ZIP file. | |
Static Public Member Functions | |
static | get_deleted_plugins () |
Get all deleted standard plugins by their component name. | |
static | get_standard_plugins () |
Get all standard plugins by their component name. | |
static | instance () |
Factory method for this class. | |
static | is_deleted_standard_plugin (string $type, string $name,) |
Defines a list of all plugins that were originally shipped in the standard Moodle distribution, but are not anymore and are deleted during upgrades. | |
static | reset_caches ($phpunitreset=false) |
Reset all caches. | |
static | resolve_plugininfo_class ($type) |
Find the plugin info class for given type. | |
static | standard_plugins_list (string $type) |
Fetches a list of all plugins shipped in the standard Moodle distribution. | |
Public Attributes | |
const | PLUGIN_SOURCE_EXTENSION = 'ext' |
the plugin is added extension | |
const | PLUGIN_SOURCE_STANDARD = 'std' |
the plugin is shipped with standard Moodle distribution | |
const | PLUGIN_STATUS_DELETE = 'delete' |
the standard plugin is about to be deleted | |
const | PLUGIN_STATUS_DOWNGRADE = 'downgrade' |
the version at the disk is lower than the one already installed | |
const | PLUGIN_STATUS_MISSING = 'missing' |
the plugin is installed but missing from disk | |
const | PLUGIN_STATUS_NEW = 'new' |
the plugin is about to be installed | |
const | PLUGIN_STATUS_NODB = 'nodb' |
the plugin uses neither database nor capabilities, no versions | |
const | PLUGIN_STATUS_UPGRADE = 'upgrade' |
the plugin is about to be upgraded | |
const | PLUGIN_STATUS_UPTODATE = 'uptodate' |
the plugin is up-to-date | |
const | REQUIREMENT_AVAILABLE = 'available' |
the required dependency is available in the plugins directory | |
const | REQUIREMENT_STATUS_MISSING = 'missing' |
the required dependency is not installed | |
const | REQUIREMENT_STATUS_NEWER = 'newer' |
the current Moodle version is too high for plugin. | |
const | REQUIREMENT_STATUS_OK = 'ok' |
the given requirement/dependency is fulfilled | |
const | REQUIREMENT_STATUS_OUTDATED = 'outdated' |
the plugin requires higher core/other plugin version than is currently installed | |
const | REQUIREMENT_UNAVAILABLE = 'unavailable' |
the required dependency is available in the plugins directory | |
const | VERSION_NO_SUPPORTS = 'nosupports' |
the plugin does not specify supports | |
const | VERSION_NOT_SUPPORTED = 'notsupported' |
the moodle version is not explicitly supported | |
const | VERSION_SUPPORTED = 'supported' |
the moodle version is explicitly supported | |
Protected Member Functions | |
__construct () | |
Direct initiation not allowed, use the factory method self::instance(). | |
__clone () | |
Sorry, this is singleton. | |
common_uninstall_check (\core\plugininfo\base $pluginfo) | |
Helper method that implements common uninstall prerequisites. | |
get_code_manager () | |
Returns a code_manager instance to be used for the plugins code operations. | |
get_update_api_client () | |
Returns a client for https://download.moodle.org/api/. | |
init_pluginsinfo_property () | |
Init placeholder array for plugin infos. | |
load_enabled_plugins () | |
Load list of all enabled plugins, call before using $this->enabledplugins. | |
load_installed_plugins () | |
Load list of installed plugins, always call before using $this->installedplugins. | |
load_present_plugins () | |
Load list of all present plugins - call before using $this->presentplugins. | |
mtrace ($msg, $eol=PHP_EOL, $debug=null) | |
Outputs the given message via mtrace(). | |
reorder_plugin_types (array $types) | |
Reorders plugin types into a sequence to be displayed. | |
resolve_core_requirements (\core\plugininfo\base $plugin, $moodleversion, $moodlebranch) | |
Helper method to resolve plugin's requirements on the moodle core. | |
resolve_dependency_requirements (core\plugininfo\base $plugin, $otherpluginname, $requiredversion, $moodlebranch) | |
Helper method to resolve plugin's dependecies on other plugins. | |
Static Protected Member Functions | |
static | load_standard_plugins () |
Load the standard plugin data from the plugins.json file. | |
Static Protected Attributes | |
static plugin_manager | $singletoninstance |
holds the singleton instance | |
static stdClass stdClass | $standardplugincache = null |
cache of standard plugins | |
core\plugin_manager::all_plugins_ok | ( | $moodleversion, | |
& | $failedplugins = [], | ||
$branch = null ) |
Checks all dependencies for all installed plugins.
This is used by install and upgrade. The array passed by reference as the second argument is populated with the list of plugins that have failed dependencies (note that a single plugin can appear multiple times in the $failedplugins).
int | $moodleversion | the version from version.php. |
array | $failedplugins | to return the list of plugins with non-satisfied dependencies |
int | $branch | the current moodle branch, null if not provided |
bool | true if all the dependencies are satisfied for all plugins. |
core\plugin_manager::archive_plugin_version | ( | \core\plugininfo\base | $plugin | ) |
core\plugin_manager::are_dependencies_satisfied | ( | $dependencies | ) |
Check a dependencies list against the list of installed plugins.
array | $dependencies | compenent name to required version or ANY_VERSION. |
bool | true if all the dependencies are satisfied. |
core\plugin_manager::available_updates | ( | ) |
Returns a list of all available updates to be installed.
This is used when "update all plugins" action is performed at the administration UI screen.
Returns array of remote info objects indexed by the plugin component. If there are multiple updates available (typically a mix of stable and non-stable ones), we pick the most mature most recent one.
Plugins without explicit maturity are considered more mature than release candidates but less mature than explicit stable (this should be pretty rare case).
array | (string)component => (core\update\remote_info)remoteinfo |
core\plugin_manager::can_cancel_plugin_installation | ( | \core\plugininfo\base | $plugin | ) |
Can the installation of the new plugin be cancelled?
Subplugins can be cancelled only via their parent plugin, not separately (they are considered as implicit requirements if distributed together with the main package).
core\plugininfo\base | $plugin |
bool |
core\plugin_manager::can_cancel_plugin_upgrade | ( | \core\plugininfo\base | $plugin | ) |
Can the upgrade of the existing plugin be cancelled?
Subplugins can be cancelled only via their parent plugin, not separately (they are considered as implicit requirements if distributed together with the main package).
core\plugininfo\base | $plugin |
bool |
core\plugin_manager::can_uninstall_plugin | ( | $component | ) |
Is it possible to uninstall the given plugin?
False is returned if the plugininfo subclass declares the uninstall should not be allowed via core::plugininfo::base::is_uninstall_allowed() or if the core vetoes it (e.g. becase the plugin or some of its subplugins is required by some other installed plugin).
string | $component | full frankenstyle name, e.g. mod_foobar |
bool |
core\plugin_manager::cancel_plugin_installation | ( | $component | ) |
Removes the plugin code directory if it is not installed yet.
This is intended for the plugins check screen to give the admin a chance to cancel the installation of just unzipped plugin before the database upgrade happens.
string | $component |
core\plugin_manager::check_explicitly_supported | ( | $plugin, | |
$branch ) |
Helper method to determine whether a moodle version is explicitly supported.
core\plugininfo\base | $plugin | the plugin we are checking |
int | $branch | the moodle branch to check support for |
string |
|
protected |
Helper method that implements common uninstall prerequisites.
core\plugininfo\base | $pluginfo |
bool |
core\plugin_manager::filter_installable | ( | $remoteinfos | ) |
Given the list of remote plugin infos, return just those installable.
This is typically used on lists returned by self::available_updates() or self::missing_dependencies() to perform bulk installation of remote plugins.
array | $remoteinfos | list of core::update::remote_info |
array |
|
protected |
Returns a code_manager instance to be used for the plugins code operations.
core\update\code_manager |
|
static |
Get all deleted standard plugins by their component name.
array |
core\plugin_manager::get_enabled_plugins | ( | $type | ) |
Get list of enabled plugins of given type, the result may contain missing plugins.
string | $type |
array|null | list of enabled plugins of this type, null if unknown |
core\plugin_manager::get_installed_plugins | ( | $type | ) |
Return list of installed plugins of given type.
string | $type |
array\$name,=>$version |
core\plugin_manager::get_parent_of_subplugin | ( | $subplugintype | ) |
Returns the name of the plugin that defines the given subplugin type.
If the given subplugin type is not actually a subplugin, returns false.
string | $subplugintype | the name of subplugin type, eg. workshopform or quiz |
false|string | the name of the parent plugin, eg. mod_workshop |
core\plugin_manager::get_plugin_info | ( | $component | ) |
Returns information about the known plugin, or null.
string | $component | frankenstyle component name. |
core\plugininfo\base|null | the corresponding plugin information. |
core\plugin_manager::get_plugin_types | ( | ) |
Returns the result of core_component::get_plugin_types() ordered for humans.
array | (string)name => (string)location |
core\plugin_manager::get_plugin_zip_root_dir | ( | $zipfilepath | ) |
Detects the plugin's name from its ZIP file.
Plugin ZIP packages are expected to contain a single directory and the directory name would become the plugin name once extracted to the Moodle dirroot.
string | $zipfilepath | full path to the ZIP files |
string|bool | false on error |
core\plugin_manager::get_plugins | ( | ) |
Returns a tree of known plugins and information about them.
array | 2D array. The first keys are plugin type names (e.g. qtype); the second keys are the plugin local name (e.g. multichoice); and the values are the corresponding objects extending core::plugininfo::base |
core\plugin_manager::get_plugins_of_type | ( | $type | ) |
Returns list of known plugins of the given type.
This method returns the subset of the tree returned by self::get_plugins(). If the given type is not known, empty array is returned.
string | $type | plugin type, e.g. 'mod' or 'workshopallocation' |
core\plugininfo\base[] | (string) plugin name => corresponding subclass of core\plugininfo\base |
core\plugin_manager::get_plugintype_root | ( | $plugintype | ) |
Returns the full path of the root of the given plugin type.
Null is returned if the plugin type is not known. False is returned if the plugin type root is expected but not found. Otherwise, string is returned.
string | $plugintype |
string|bool|null |
core\plugin_manager::get_present_plugins | ( | $type | ) |
Get list of present plugins of given type.
string | $type |
array|null | list of presnet plugins $name=>$diskversion, null if unknown |
core\plugin_manager::get_remote_plugin_info | ( | $component, | |
$version, | |||
$exactmatch ) |
Returns information about a plugin in the plugins directory.
This is typically used when checking for available dependencies (in which case the $version represents minimal version we need), or when installing an available update or a new plugin from the plugins directory (in which case the $version is exact version we are interested in). The interpretation of the $version is controlled by the $exactmatch argument.
If a plugin with the given component name is found, data about the plugin are returned as an object. The ->version property of the object contains the information about the particular plugin version that matches best the given critera. The ->version property is false if no suitable version of the plugin was found (yet the plugin itself is known).
See core::update::api::validate_pluginfo_format() for the returned data structure.
string | $component | plugin frankenstyle name |
string | int | $version | ANY_VERSION or the version number |
bool | $exactmatch | false if "given version or higher" is requested |
core\update\remote_info|bool |
core\plugin_manager::get_remote_plugin_zip | ( | $url, | |
$md5 ) |
Obtain the plugin ZIP file from the given URL.
The caller is supposed to know both downloads URL and the MD5 hash of the ZIP contents in advance, typically by using the API requests against the plugins directory.
string | $url | |
string | $md5 |
string|bool | full path to the file, false on error |
|
static |
Get all standard plugins by their component name.
array |
core\plugin_manager::get_subplugins | ( | ) |
Returns list of plugins that define their subplugins and the information about them from the db/subplugins.json file.
array | with keys like 'mod_quiz', and values the data from the corresponding db/subplugins.json file. |
core\plugin_manager::get_subplugins_of_plugin | ( | $component | ) |
Returns list of all known subplugins of the given plugin.
For plugins that do not provide subplugins (i.e. there is no support for it), empty array is returned.
string | $component | full component name, e.g. 'mod_workshop' |
array | (string) component name (e.g. 'workshopallocation_random') => subclass of core::plugininfo::base |
core\plugin_manager::get_uninstall_url | ( | $component, | |
$return = 'overview' ) |
Returns uninstall URL if exists.
string | $component | |
string | $return | either 'overview' or 'manage' |
null|moodle_url | uninstall URL, null if uninstall not supported |
|
protected |
Returns a client for https://download.moodle.org/api/.
core\update\api |
core\plugin_manager::install_plugins | ( | array | $plugins, |
$confirmed, | |||
$silent ) |
Perform the installation of plugins.
If used for installation of remote plugins from the Moodle Plugins directory, the $plugins must be list of core::update::remote_info object that represent installable remote plugins. The caller can use self::filter_installable() to prepare the list.
If used for installation of plugins from locally available ZIP files, the $plugins should be list of objects with properties ->component and ->zipfilepath.
The method uses mtrace() to produce direct output and can be used in both web and cli interfaces.
array | $plugins | list of plugins |
bool | $confirmed | should the files be really deployed into the dirroot? |
bool | $silent | perform without output |
bool | true on success |
|
static |
Factory method for this class.
static | the singleton instance |
|
static |
Defines a list of all plugins that were originally shipped in the standard Moodle distribution, but are not anymore and are deleted during upgrades.
The main purpose of this list is to hide missing plugins during upgrade.
string | $type | plugin type |
string | $name | plugin name |
bool |
core\plugin_manager::is_directory_removable | ( | $fullpath | ) |
Check if the given directory can be removed by the web server process.
This recursively checks that the given directory and all its contents it writable.
string | $fullpath |
boolean |
core\plugin_manager::is_plugin_folder_removable | ( | $component | ) |
Check to see if the given plugin folder can be removed by the web server process.
string | $component | full frankenstyle component |
bool |
core\plugin_manager::is_plugintype_writable | ( | $plugintype | ) |
Is it possible to create a new plugin directory for the given plugin type?
coding_exception | for invalid plugin types or non-existing plugin type locations |
string | $plugintype |
boolean |
core\plugin_manager::is_remote_plugin_available | ( | $component, | |
$version, | |||
$exactmatch ) |
Is the given plugin version available in the plugins directory?
See self::get_remote_plugin_info() for the full explanation of how the $version parameter is interpretted.
string | $component | plugin frankenstyle name |
string | int | $version | ANY_VERSION or the version number |
bool | $exactmatch | false if "given version or higher" is requested |
boolean |
core\plugin_manager::is_remote_plugin_installable | ( | $component, | |
$version, | |||
& | $reason = null, | ||
$checkremote = true ) |
Can the given plugin version be installed via the admin UI?
This check should be used whenever attempting to install a plugin from the plugins directory (new install, available update, missing dependency).
string | $component | |
int | $version | version number |
string | $reason | returned code of the reason why it is not |
bool | $checkremote | check this version availability on moodle server |
boolean |
core\plugin_manager::list_cancellable_installations | ( | ) |
Returns plugins, the installation of which can be cancelled.
array | [(string)component] => (core\plugininfo\base)plugin |
core\plugin_manager::list_restorable_archives | ( | ) |
Returns list of all archives that can be installed to cancel the plugin upgrade.
array | [(string)component] => {(string)->component, (string)->zipfilepath} |
core\plugin_manager::load_available_updates_for_plugin | ( | $component | ) |
Returns list of available updates for the given component.
This method should be considered as internal API and is supposed to be called by core::plugininfo::base::available_updates() only to lazy load the data once they are first requested.
string | $component | frankenstyle name of the plugin |
null|array | array of core\update\info objects or null |
|
protected |
Load list of all enabled plugins, call before using $this->enabledplugins.
This method is caching results from individual plugin info classes.
|
protected |
Load list of installed plugins, always call before using $this->installedplugins.
This method is caching results for all plugins.
|
staticprotected |
Load the standard plugin data from the plugins.json file.
stdClass |
core\plugin_manager::missing_dependencies | ( | $availableonly = false | ) |
Return a list of missing dependencies.
This should provide the full list of plugins that should be installed to fulfill the requirements of all plugins, if possible.
bool | $availableonly | return only available missing dependencies |
array | of core\update\remote_info|bool indexed by the component name |
|
protected |
Outputs the given message via mtrace().
If $debug is provided, then the message is displayed only at the given debugging level (e.g. DEBUG_DEVELOPER to display the message only if the site has developer debugging level selected).
string | $msg | message |
string | $eol | end of line |
null | int | $debug | null to display always, int only on given debug level |
core\plugin_manager::other_plugins_that_require | ( | $component | ) |
Get a list of any other plugins that require this one.
string | $component | frankenstyle component name. |
array | of frankensyle component names that require this one. |
core\plugin_manager::plugin_external_source | ( | $component | ) |
Check to see if the current version of the plugin seems to be a checkout of an external repository.
string | $component | frankenstyle component name |
false|string |
core\plugin_manager::plugin_name | ( | $component | ) |
Returns a localized name of a given plugin.
string | $component | name of the plugin, eg mod_workshop or auth_ldap |
string |
core\plugin_manager::plugintype_name | ( | $type | ) |
Returns a localized name of a plugin typed in singular form.
Most plugin types define their names in core_plugin lang file. In case of subplugins, we try to ask the parent plugin for the name. In the worst case, we will return the value of the passed $type parameter.
string | $type | the type of the plugin, e.g. mod or workshopform |
string |
core\plugin_manager::plugintype_name_plural | ( | $type | ) |
Returns a localized name of a plugin type in plural form.
Most plugin types define their names in core_plugin lang file. In case of subplugins, we try to ask the parent plugin for the name. In the worst case, we will return the value of the passed $type parameter.
string | $type | the type of the plugin, e.g. mod or workshopform |
string |
core\plugin_manager::remove_plugin_folder | ( | \core\plugininfo\base | $plugin | ) |
Remove the current plugin code from the dirroot.
If removing the currently installed version (which happens during updates), we archive the code so that the upgrade can be cancelled.
To prevent accidental data-loss, we also archive the existing plugin code if cancelling installation of it, so that the developer does not loose the only version of their work-in-progress.
core\plugininfo\base | $plugin |
|
protected |
Reorders plugin types into a sequence to be displayed.
For technical reasons, plugin types returned by core_component::get_plugin_types() are in a certain order that does not need to fit the expected order for the display. Particularly, activity modules should be displayed first as they represent the real heart of Moodle. They should be followed by other plugin types that are used to build the courses (as that is what one expects from LMS). After that, other supportive plugin types follow.
array | $types | associative array |
array | same array with altered order of items |
|
static |
Reset all caches.
bool | $phpunitreset |
|
protected |
Helper method to resolve plugin's requirements on the moodle core.
core\plugininfo\base | $plugin | the plugin we are checking |
string | int | double | $moodleversion | moodle core branch to check against |
stdClass |
|
protected |
Helper method to resolve plugin's dependecies on other plugins.
core\plugininfo\base | $plugin | the plugin we are checking |
string | $otherpluginname | |
string | int | $requiredversion | |
string | int | $moodlebranch | explicit moodle core branch to check against, defaults to $CFG->branch |
stdClass |
|
static |
Find the plugin info class for given type.
string | $type |
string | name of pluginfo class for give plugin type |
core\plugin_manager::resolve_requirements | ( | \core\plugininfo\base | $plugin, |
$moodleversion = null, | |||
$moodlebranch = null ) |
Resolve requirements and dependencies of a plugin.
Returns an array of objects describing the requirement/dependency, indexed by the frankenstyle name of the component. The returned array can be empty. The objects in the array have following properties:
->(numeric)hasver ->(numeric)reqver ->(string)status ->(string)availability
core\plugininfo\base | $plugin | the plugin we are checking |
null | string | int | double | $moodleversion | explicit moodle core version to check against, defaults to $CFG->version |
null | string | int | $moodlebranch | explicit moodle core branch to check against, defaults to $CFG->branch |
array | of objects |
core\plugin_manager::some_plugins_updatable | ( | ) |
Checks if there are some plugins with a known available update.
bool | true if there is at least one available update |
|
static |
Fetches a list of all plugins shipped in the standard Moodle distribution.
If a type is specified but does not exist, a false value is returned. Otherwise an array of the plugins of the specified type is returned.
null | string | $type |
false|array | array of standard plugins or false if the type is unknown |
core\plugin_manager::uninstall_plugin | ( | $component, | |
progress_trace | $progress ) |
Uninstall the given plugin.
Automatically cleans-up all remaining configuration data, log records, events, files from the file pool etc.
In the future, the functionality of uninstall_plugin() function may be moved into this method and all the code should be refactored to use it. At the moment, we mimic this future behaviour by wrapping that function call.
string | $component | |
progress_trace | $progress | traces the process |
bool | true on success, false on errors/problems |
core\plugin_manager::unzip_plugin_file | ( | $zipfilepath, | |
$targetdir, | |||
$rootdir = '' ) |
Extracts the saved plugin ZIP file.
Returns the list of files found in the ZIP. The format of that list is array of (string)filerelpath => (bool|string) where the array value is either true or a string describing the problematic file.
string | $zipfilepath | full path to the saved ZIP file |
string | $targetdir | full path to the directory to extract the ZIP file to |
string | $rootdir | explicitly rename the root directory of the ZIP into this non-empty value |
array | list of extracted files as returned by zip_packer::extract_to_pathname() |