Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 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.

Class for converting files between different file formats.

Copyright: 2017 Andrew Nicols <andrew@nicols.co.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 81 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

converter_interface:: (5 methods):
  are_requirements_met()
  start_document_conversion()
  poll_conversion_status()
  supports()
  get_supported_conversions()


Interface: converter_interface  - X-Ref

Class for converting files between different file formats.

are_requirements_met()   X-Ref
Whether the plugin is configured and requirements are met.

Note: This function may be called frequently and caching is advisable.

return: bool

start_document_conversion(conversion $conversion)   X-Ref
Convert a document to a new format and return a conversion object relating to the conversion in progress.

param: conversion $conversion The file to be converted
return: $this

poll_conversion_status(conversion $conversion)   X-Ref
Poll an existing conversion for status update.

param: conversion $conversion The file to be converted
return: $this

supports($from, $to)   X-Ref
Determine whether a conversion between the two supplied formats is achievable.

Note: This function may be called frequently and caching is advisable.

param: string $from The source type
param: string $to The destination type
return: bool

get_supported_conversions()   X-Ref
A list of the supported conversions.

Note: This information is only displayed to administrators.

return: string