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: 195 lines (9 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 2 classes

restore_decode_rule:: (8 methods):
  __construct()
  set_restoreid()
  set_wwwroots()
  decode()
  get_mapping()
  apply_modifications()
  validate_params()
  get_calculated_regexp()

restore_decode_rule_exception:: (1 method):
  __construct()


Class: restore_decode_rule  - X-Ref

Helper class used to decode links back to their original form

This class allows each restore task to specify the changes that
will be applied to any encoded (by backup) link to revert it back
to its original form, recoding any parameter as needed.

TODO: Complete phpdocs
__construct($linkname, $urltemplate, $mappings)   X-Ref
No description

set_restoreid($restoreid)   X-Ref
No description

set_wwwroots($sourcewwwroot, $targetwwwroot)   X-Ref
No description

decode($content)   X-Ref
No description

get_mapping($itemname, $itemid)   X-Ref
Looks for mapping values in backup_ids table, simple wrapper over get_backup_ids_record


apply_modifications($toreplace, $mappingsok)   X-Ref
Apply other modifications, based in the result of $mappingsok before placeholder replacements

Right now, simply prefix with the proper wwwroot (source/target)

validate_params($linkname, $urltemplate, $mappings)   X-Ref
Perform all the validations and checks on the rule attributes


get_calculated_regexp()   X-Ref
based on rule definition, build the regular expression to execute on decode


Class: restore_decode_rule_exception  - X-Ref

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