Custom component cache definition

Custom component cache definition

by Michael Ko -
Number of replies: 2

Hi,

We have a series of custom files and we are trying to work out what the best direction is.

We have a folder called "custom" which contains about 5 custom php pages. However, we want this to be a "component", so we can make a cache definition and install database tables.

This folder is not an activity - it is simply a collection of staff pages using custom database tables. I have made activities before and this is not really the direction we want to go down.

Can anyone please suggest how I can get Moodle to recognise my "custom" component, or at the least, how can I make a new cache definition (without changing the lib/db/caches file)?

Thank you in advance for any assistance!

Average of ratings: -
In reply to Michael Ko

Re: Custom component cache definition

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

This is what the local folder is for. Put your scripts inside local/custom, and then you have a local_custom component.

Of course, you should try to use a more meaningful name. If you 5 different scripts do very different things, it might be clearer to make separate plugins like local_{scrips1}, local_{script2}, again with meaningful names in place of {script1} etc.

https://docs.moodle.org/dev/Local_plugins

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Custom component cache definition

by Michael Ko -

Exactly what I have been seeking for a long time! Thanks as always Tim for the fast reply/