Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

(no description)

File Size: 191 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

resource_packager:: (5 methods):
  __construct()
  get_package()
  get_all_task_settings()
  override_task_setting()
  package()


Class: resource_packager  - X-Ref

Base packager to prepare appropriate backup of a resource to share to MoodleNet.

__construct(stdClass|cm_info $resource,int $userid,string $resourcefilename,)   X-Ref
Constructor for the base packager.

param: stdClass|cm_info $resource The resource object
param: int $userid The user id

get_package()   X-Ref
Prepare the backup file using appropriate setting overrides and return relevant information.

return: stored_file

get_all_task_settings(backup_controller $controller)   X-Ref
Get all backup settings available for override.

return: array the associative array of taskclass => settings instances.

override_task_setting(array $alltasksettings, string $settingname, int $settingvalue)   X-Ref
Override a backup task setting with a given value.

param: array $alltasksettings All task settings.
param: string $settingname The name of the setting to be overridden (task class name format).
param: int $settingvalue Value to be given to the setting.

package(backup_controller $controller)   X-Ref
Package the resource identified by resource id into a new stored_file.

param: backup_controller $controller The backup controller.
return: stored_file