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.

Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [Versions 400 and 403] [Versions 401 and 403]

(no description)

Copyright: 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 285 lines (9 kb)
Included or required:0 times
Referenced: 2 times
Includes or requires: 0 files

Defines 2 classes

base_task:: (23 methods):
  __construct()
  get_name()
  get_steps()
  get_settings()
  get_weight()
  get_setting()
  setting_exists()
  get_setting_value()
  get_courseid()
  get_basepath()
  get_taskbasepath()
  get_logger()
  get_progress()
  log()
  add_step()
  set_plan()
  execute()
  destroy()
  is_checksum_correct()
  calculate_checksum()
  add_result()
  get_results()
  add_setting()

base_task_exception:: (1 method):
  __construct()


Class: base_task  - X-Ref

Abstract class defining the basis for one execution (backup/restore) task

TODO: Finish phpdocs
__construct($name, $plan = null)   X-Ref
Constructor - instantiates one object of this class


get_name()   X-Ref
No description

get_steps()   X-Ref
No description

get_settings()   X-Ref
No description

get_weight()   X-Ref
Returns the weight of this task, an approximation of the amount of time
it will take. By default this value is 1. It can be increased for longer
tasks.

return: int Weight

get_setting($name)   X-Ref
No description

setting_exists($name)   X-Ref
No description

get_setting_value($name)   X-Ref
No description

get_courseid()   X-Ref
No description

get_basepath()   X-Ref
No description

get_taskbasepath()   X-Ref
No description

get_logger()   X-Ref
No description

get_progress()   X-Ref
Gets the progress reporter, which can be used to report progress within
the backup or restore process.

return: \core\progress\base Progress reporting object

log($message, $level, $a = null, $depth = null, $display = false)   X-Ref
No description

add_step($step)   X-Ref
No description

set_plan($plan)   X-Ref
No description

execute()   X-Ref
Function responsible for executing the steps of any task
(setting the $executed property to  true)


destroy()   X-Ref
Destroy all circular references. It helps PHP 5.2 a lot!


is_checksum_correct($checksum)   X-Ref
No description

calculate_checksum()   X-Ref
No description

add_result($result)   X-Ref
Add the given info to the current plan's results.

param: array $result associative array describing a result of a task/step

get_results()   X-Ref
Return the current plan's results

return: array|null

add_setting($setting)   X-Ref
This function is invoked on activity creation in order to add all the settings
that are associated with one task. The function will, directly, inject the settings
in the task.


Class: base_task_exception  - X-Ref

__construct($errorcode, $a=NULL, $debuginfo=null)   X-Ref
No description