MDL-45412 cachestore_mongodb: added notification of old Mongo version use
[moodle.git] / cache / stores / mongodb / addinstanceform.php
index ada3220..c7d3104 100644 (file)
@@ -48,8 +48,13 @@ class cachestore_mongodb_addinstance_form extends cachestore_addinstance_form {
      * The forms custom definitions.
      */
     protected function configuration_definition() {
      * The forms custom definitions.
      */
     protected function configuration_definition() {
+        global $OUTPUT;
         $form = $this->_form;
 
         $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');
         $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');