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 311 and 402] [Versions 311 and 403]

Log store manager.

Copyright: 2013 Petr Skoda {@link http://skodak.org}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 227 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

manager:: (8 methods):
  init()
  process()
  get_readers()
  get_supported_reports()
  get_supported_logstores()
  get_store_plugins()
  dispose()
  legacy_add_to_log()


Class: manager  - X-Ref

init()   X-Ref
Delayed initialisation of singleton.


process(\core\event\base $event)   X-Ref
Called from the observer only.

param: \core\event\base $event

get_readers($interface = null)   X-Ref
Returns list of available log readers.

This way the reports find out available sources of data.

param: string $interface Returned stores must implement this interface.
return: \core\log\reader[] list of available log data readers

get_supported_reports($logstore)   X-Ref
Get a list of reports that support the given store instance.

param: string $logstore Name of the store.
return: array List of supported reports

get_supported_logstores($component)   X-Ref
For a given report, returns a list of log stores that are supported.

param: string $component component.
return: false|array list of logstores that support the given report. It returns false if the given $component doesn't

get_store_plugins()   X-Ref
Intended for store management, do not use from reports.

return: store[] Returns list of available store plugins.

dispose()   X-Ref
Usually called automatically from shutdown manager,
this allows us to implement buffering of write operations.


legacy_add_to_log($courseid, $module, $action, $url = '', $info = '',$cm = 0, $user = 0, $ip = null, $time = null)   X-Ref
Legacy add_to_log() redirection.

To be used only from deprecated add_to_log() function and event trigger() method.

NOTE: this is hardcoded to legacy log store plugin, hopefully we can get rid of it soon.

param: int $courseid The course id
param: string $module The module name  e.g. forum, journal, resource, course, user etc
param: string $action 'view', 'update', 'add' or 'delete', possibly followed by another word to clarify
param: string $url The file and parameters used to see the results of the action
param: string $info Additional description information
param: int $cm The course_module->id if there is one
param: int|\stdClass $user If log regards $user other than $USER
param: string $ip Override the IP, should only be used for restore.
param: int $time Override the log time, should only be used for restore.