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.

Differences Between: [Versions 310 and 402] [Versions 310 and 403]

Backend generic code.

Copyright: 2013 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 199 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

tool_generator_backend:: (5 methods):
  __construct()
  size_for_name()
  log()
  dot()
  end_log()


Class: tool_generator_backend  - X-Ref

Backend generic code for all tool_generator commands.

__construct($size, $fixeddataset = false, $filesizelimit = false, $progress = true)   X-Ref
Generic generator class

param: int $size Size as numeric index
param: bool $fixeddataset To use fixed or random data
param: int|bool $filesizelimit The max number of bytes for a generated file
param: bool $progress True if progress information should be displayed

size_for_name($sizename)   X-Ref
Converts a size name into the numeric constant.

param: string $sizename Size name e.g. 'L'
return: int Numeric version

log($langstring, $a = null, $leaveopen = false)   X-Ref
Displays information as part of progress.

param: string $langstring Part of langstring (after progress_)
param: mixed $a Optional lang string parameters
param: bool $leaveopen If true, doesn't close LI tag (ready for dots)

dot($number, $total)   X-Ref
Outputs dots. There is up to one dot per second. Once a minute, it
displays a percentage.

param: int $number Number of completed items
param: int $total Total number of items to complete

end_log()   X-Ref
Ends a log string that was started using log function with $leaveopen.