Skip to content

Commit

Permalink
MDL-48506 cachestore_memcached: added upgrade notice
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk authored and ryanwyllie committed Apr 18, 2016
1 parent 957e0c7 commit 7797d7e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cache/stores/memcached/addinstanceform.php
Expand Up @@ -86,6 +86,13 @@ protected function configuration_definition() {
$form->addHelpButton('setservers', 'setservers', 'cachestore_memcached');
$form->disabledIf('setservers', 'clustered');
$form->setType('setservers', PARAM_RAW);

$version = phpversion('memcached');
if (!$version || !version_compare($version, cachestore_memcached::REQUIRED_VERSION, '>=')) {
$form->addElement('header', 'upgradenotice', get_string('notice', 'cachestore_memcached'));
$form->setExpanded('upgradenotice');
$form->addElement('html', nl2br(get_string('upgrade200recommended', 'cachestore_memcached')));
}
}

/**
Expand Down
3 changes: 3 additions & 0 deletions cache/stores/memcached/lang/en/cachestore_memcached.php
Expand Up @@ -46,6 +46,7 @@
$string['hash_fnv1a_32'] = 'FNV1A_32';
$string['hash_hsieh'] = 'Hsieh';
$string['hash_murmur'] = 'Murmur';
$string['notice'] = 'Notice';
$string['pluginname'] = 'Memcached';
$string['prefix'] = 'Prefix key';
$string['prefix_help'] = 'This can be used to create a "domain" for your item keys allowing you to create multiple memcached stores on a single memcached installation. It cannot be longer than 16 characters in order to ensure key length issues are not encountered.';
Expand Down Expand Up @@ -88,3 +89,5 @@
$string['useserialiser_help'] = 'Specifies the serializer to use for serializing non-scalar values.
The valid serializers are Memcached::SERIALIZER_PHP or Memcached::SERIALIZER_IGBINARY.
The latter is supported only when memcached is configured with --enable-memcached-igbinary option and the igbinary extension is loaded.';
$string['upgrade200recommended'] = 'We recommend you upgrade your Memcached PHP extension to version 2.0.0 or greater.
The version of the Memcached PHP extension you are currently using does not provide the functionality Moodle uses to ensure a sandboxed cache. Until you upgrade we recommend you do not configure any other applications to use the same Memcached servers as Moodle is configured to use.';
2 changes: 2 additions & 0 deletions cache/upgrade.txt
Expand Up @@ -6,6 +6,8 @@ Information provided here is intended especially for developers.
This allows the cache loader to decide if it needs to handle dereferencing or whether the data
coming directly to it has already had references resolved.
- see supports_dereferencing_objects in store.php.
* The Memcached cache store no longer flushes the memcache servers it is connected to providing your memcached php extension is version 2.0.0 or greater.
There is a notice to this effect when adding or editing a memcached cache store instance.

=== 2.9 ===
* Cache data source aggregation functionality has been removed. This functionality was found to be broken and unused.
Expand Down

0 comments on commit 7797d7e

Please sign in to comment.