From 6deb0813d0cac785e296930bf1993c9d0105d305 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Tue, 6 May 2014 09:30:27 +1200 Subject: [PATCH] MDL-45412 cachestore_mongodb: added notification of old Mongo version use --- cache/stores/mongodb/addinstanceform.php | 5 +++++ cache/stores/mongodb/lang/en/cachestore_mongodb.php | 1 + 2 files changed, 6 insertions(+) diff --git a/cache/stores/mongodb/addinstanceform.php b/cache/stores/mongodb/addinstanceform.php index ada3220c0aa..c7d31048704 100644 --- a/cache/stores/mongodb/addinstanceform.php +++ b/cache/stores/mongodb/addinstanceform.php @@ -48,8 +48,13 @@ class cachestore_mongodb_addinstance_form extends cachestore_addinstance_form { * The forms custom definitions. */ protected function configuration_definition() { + global $OUTPUT; $form = $this->_form; + if (!class_exists('MongoClient')) { + $form->addElement('html', $OUTPUT->notification(get_string('pleaseupgrademongo', 'cachestore_mongodb'))); + } + $form->addElement('text', 'server', get_string('server', 'cachestore_mongodb'), array('size' => 72)); $form->addHelpButton('server', 'server', 'cachestore_mongodb'); $form->addRule('server', get_string('required'), 'required'); diff --git a/cache/stores/mongodb/lang/en/cachestore_mongodb.php b/cache/stores/mongodb/lang/en/cachestore_mongodb.php index d787d97fba4..5af0c73cc6c 100644 --- a/cache/stores/mongodb/lang/en/cachestore_mongodb.php +++ b/cache/stores/mongodb/lang/en/cachestore_mongodb.php @@ -28,6 +28,7 @@ $string['extendedmode'] = 'Use extended keys'; $string['extendedmode_help'] = 'If enabled full key sets will be used when working with the plugin. This isn\'t used internally yet but would allow you to easily search and investigate the MongoDB plugin manually if you so choose. Turning this on will add an small overhead so should only be done if you require it.'; $string['password'] = 'Password'; $string['password_help'] = 'The password of the user being used for the connection.'; +$string['pleaseupgrademongo'] = 'You are using an old version of the PHP Mongo extension (> 1.3). Support for old versions of the Mongo extension will be dropped in the future. Please consider upgrading.'; $string['pluginname'] = 'MongoDB'; $string['replicaset'] = 'Replica set'; $string['replicaset_help'] = 'The name of the replica set to connect to. If this is given the master will be determined by using the ismaster database command on the seeds, so the driver may end up connecting to a server that was not even listed.'; -- 2.43.0