Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 39 and 311]

Minimalistic library, usable even when no other moodle libs are loaded. The only library that gets loaded if you define ABORT_AFTER_CONFIG before including main config.php. You can resume normal script operation if you define ABORT_AFTER_CONFIG_CANCEL and require the setup.php

Copyright: 2009 Petr Skoda (skodak)
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 261 lines (8 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 8 functions


Functions that are not part of a class:

min_optional_param($name, $default, $type)   X-Ref
Minimalistic parameter validation function.
Can not use optional param because moodlelib.php is not loaded yet

param: string $name
param: mixed $default
param: string $type
return: mixed

min_clean_param($value, $type)   X-Ref
Minimalistic parameter cleaning function.

Note: Can not use optional param because moodlelib.php is not loaded yet.

param: string $value
param: string $type
return: mixed

min_fix_utf8($value)   X-Ref
Minimalistic UTF-8 sanitisation.

Note: This duplicates fix_utf8() intentionally for now.

param: string $value
return: string

min_enable_zlib_compression()   X-Ref
This method tries to enable output compression if possible.
This function must be called before any output or headers.

(IE6 is not supported at all.)

return: boolean, true if compression enabled

min_get_slash_argument($clean = true)   X-Ref
Returns the slashargument part of the URL.

Note: ".php" is NOT allowed in slasharguments,
it is intended for ASCII characters only.

param: boolean $clean - Should we do cleaning on this path argument. If you set this
return: string

min_get_minimum_revision()   X-Ref
Get the lowest possible currently valid revision number.

This is based on the current Moodle version.

return: int Unix timestamp

min_get_maximum_revision()   X-Ref
Get the highest possible currently valid revision number.

This is based on the current time, allowing for a small amount of clock skew between servers.

Future values beyond the clock skew are not allowed to avoid the possibility of cache poisoning.

return: int

min_is_revision_valid_and_current(int $revision)   X-Ref
Helper function to determine if the given revision number is valid.

param: int $revision A numeric revision to check for validity
return: bool Whether the revision is valid