Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-41492

Allow alternate muc cache config class (eg allow setup in pure $CFG / config.php)

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      1) Setup memcache
      2) Add this example forced cache config:

      $CFG->forced_cache_settings = array(
        'stores' => array(
          'memcached-11211' => array(
            'name' => 'memcached-11211',
            'plugin' => 'memcached',
            'configuration' => array(
              'servers' => array(
                0 => array(
                  0 => 'localhost',
                ),
              ),
              'compression' => '1',
              'serialiser' => '1',
              'prefix' => 'test1_',
              'hash' => '0',
              'bufferwrites' => '0',
              'clustered' => false,
              'setservers' => array(),
            ),
            'features' => 20,
            'modes' => 1,
            'mappingsonly' => false,
            'class' => 'cachestore_memcached',
            'default' => false,
            'lock' => 'cachelock_file_default',
          ),
        ),
        'modemappings' => array (
          0 => array (
            'store' => 'memcached-11211',
            'mode' => 1,
            'sort' => 0,
          ),
        ),
      );
      

      3) Confirm the cache is working by turning on cache debugging
      4) Go to Home / ► Site administration / ► Plugins / ► Caching / ► Configuration
      5) Confirm the memcache store instance exists, and is marked as forced, and cannot be edited
      6) Confirm the mode mapping is forced, visibly marked as forced, and cannot be edited
      7) Confirm that other unforced cache config settings can still be edited

      Show
      1) Setup memcache 2) Add this example forced cache config: $CFG->forced_cache_settings = array( 'stores' => array( 'memcached-11211' => array( 'name' => 'memcached-11211', 'plugin' => 'memcached', 'configuration' => array( 'servers' => array( 0 => array( 0 => 'localhost', ), ), 'compression' => '1', 'serialiser' => '1', 'prefix' => 'test1_', 'hash' => '0', 'bufferwrites' => '0', 'clustered' => false, 'setservers' => array(), ), 'features' => 20, 'modes' => 1, 'mappingsonly' => false, 'class' => 'cachestore_memcached', 'default' => false, 'lock' => 'cachelock_file_default', ), ), 'modemappings' => array ( 0 => array ( 'store' => 'memcached-11211', 'mode' => 1, 'sort' => 0, ), ), ); 3) Confirm the cache is working by turning on cache debugging 4) Go to Home / ► Site administration / ► Plugins / ► Caching / ► Configuration 5) Confirm the memcache store instance exists, and is marked as forced, and cannot be edited 6) Confirm the mode mapping is forced, visibly marked as forced, and cannot be edited 7) Confirm that other unforced cache config settings can still be edited
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_31_STABLE
    • Pull Master Branch:
      MDL-41492-cache-in-config

      Description

      We have plenty of Moodle sites and configuring MUC to each one via Moodle UI is not possible. It should be possible to configure MUC via CLI and/or with CFG variables.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                8 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated: