Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

(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: 165 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

restore_step:: (4 methods):
  __construct()
  get_restoreid()
  apply_date_offset()
  decrypt()

restore_step_exception:: (1 method):
  __construct()


Class: restore_step  - X-Ref

Abstract class defining the needed stuf for one restore step

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


get_restoreid()   X-Ref
No description

apply_date_offset($value)   X-Ref
Apply course startdate offset based in original course startdate and course_offset_startdate setting
Note we are using one static cache here, but *by restoreid*, so it's ok for concurrence/multiple
executions in the same request

Note: The policy is to roll date only for configurations and not for user data. see MDL-9367.

param: int $value Time value (seconds since epoch), or empty for nothing
return: int Time value after applying the date offset, or empty for nothing

decrypt($value)   X-Ref
Returns symmetric-key AES-256 decryption of base64 encoded contents.

This method is used in restore operations to decrypt contents encrypted with
{@link encrypted_final_element} automatically decoding (base64) and decrypting
contents using the key stored in backup_encryptkey config.

Requires openssl, cipher availability, and key existence (backup
automatically sets it if missing). Integrity is provided via HMAC.

param: string $value {@link encrypted_final_element} value to decode and decrypt.
return: string|null decoded and decrypted value or null if the operation can not be performed.

Class: restore_step_exception  - X-Ref

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