$CFG->altcacheconfigpath

$CFG->altcacheconfigpath

by Luis de Vasconcelos -
Number of replies: 1

I came across the $CFG->altcacheconfigpath setting in the Moodle 3.5 config-dist.php file. The explanation is'nt very clear to me. And it seems like there isn't any documentation for it in MoodleDocs.

Can somebody explain:

  1. The meaning of the is $CFG->altcacheconfigpath setting, and 
  2. What the contents of the /var/www/shared/moodle.cache.config.php file must contain.
Must I create that /var/www/shared/moodle.cache.config.php file, and if so, what must it contain?
Or is that file generated by Moodle at runtime?

Perhaps, create a page with the explanation on MoodleDocs and share the link here.

Thanks.
Average of ratings: -
In reply to Luis de Vasconcelos

Re: $CFG->altcacheconfigpath

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Did you see...

    define('TEST_CACHE_USING_ALT_CACHE_CONFIG_PATH', true');
    $CFG->altcacheconfigpath = '/a/temp/directory/yoursite.php'
This tells Moodle to use the config at $CFG->altcacheconfigpath when running tests.
There are a couple of considerations to using this method:
* By setting $CFG->altcacheconfigpath your site will store the cache config in the specified path, not just the test cache config but your site config as well.
* If you have configured your cache before setting $CFG->altcacheconfigpath you will need to copy it from moodledata/muc/config.php to the destination you specified.
* This allows you to share a cache config between sites.
* It also allows you to use tests to test your sites cache config.


...and MDL-45513

I'm not entirely sure what problem it fixes either!


Average of ratings: Useful (1)