How can i programmatically purge all caches

How can i programmatically purge all caches

by Pablo Escobar -
Number of replies: 2

Hello,

The question is how can i programmatically purge all caches? it is posible?, i am adding programmatically groups, groupings, access restrictions to sections and always need to purge cache when execute the code.

Thanks in advance

Average of ratings: -
In reply to Pablo Escobar

Re: How can i programmatically purge all caches

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

purge_all_caches();

So easy when you know how wink

In reply to Tim Hunt

Re: How can i programmatically purge all caches

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Although, in this case, it sounds like you really want is:

rebuild_course_cache($courseid)