Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-37935 cache: improved ready testing of stores on admin screen and…

… testing script
  • Loading branch information...
commit c643628f23a05008101e826d5ea9e637871d879e 1 parent cce0d9a
Sam Hemelryk authored February 18, 2013
12  cache/renderer.php
@@ -93,15 +93,25 @@ public function store_instance_summariers(array $stores, array $plugins) {
93 93
                 $htmlactions[] = $this->output->action_link($action['url'], $action['text']);
94 94
             }
95 95
 
  96
+            $isready = $store['isready'] && $store['requirementsmet'];
  97
+            $readycell = new html_table_cell;
  98
+            if ($isready) {
  99
+                $readycell->text = $this->output->pix_icon('i/valid', '1');
  100
+            }
  101
+
96 102
             $storename = $store['name'];
97 103
             if (!empty($store['default'])) {
98 104
                 $storename = get_string('store_'.$store['name'], 'cache');
99 105
             }
  106
+            if (!$isready && (int)$store['mappings'] > 0) {
  107
+                $readycell->text = $this->output->help_icon('storerequiresattention', 'cache');
  108
+                $readycell->attributes['class'] = 'store-requires-attention';
  109
+            }
100 110
 
101 111
             $row = new html_table_row(array(
102 112
                 $storename,
103 113
                 get_string('pluginname', 'cachestore_'.$store['plugin']),
104  
-                ($store['isready'] && $store['requirementsmet']) ? $this->output->pix_icon('i/valid', '1') : '',
  114
+                $readycell,
105 115
                 $store['mappings'],
106 116
                 join(', ', $modes),
107 117
                 join(', ', $supports),
7  cache/testperformance.php
@@ -55,6 +55,7 @@
55 55
 $strunsupportedmode = new lang_string('unsupportedmode', 'cache');
56 56
 $struntestable = new lang_string('untestable', 'cache');
57 57
 $strtested = new lang_string('tested', 'cache');
  58
+$strnotready = new lang_string('storenotready', 'cache');
58 59
 
59 60
 foreach (get_plugin_list_with_file('cachestore', 'lib.php', true) as $plugin => $path) {
60 61
 
@@ -74,6 +75,8 @@
74 75
         $store = $class::initialise_test_instance($application);
75 76
         if ($store === false) {
76 77
             $applicationtable->data[] = array($plugin, $struntestable, '-', '-', '-', '-');
  78
+        } else if (!$store->is_ready()) {
  79
+            $applicationtable->data[] = array($plugin, $strnotready, '-', '-', '-', '-');
77 80
         } else {
78 81
             $result = array($plugin, $strtested, 0, 0, 0);
79 82
             $start = microtime(true);
@@ -110,6 +113,8 @@
110 113
         $store = $class::initialise_test_instance($session);
111 114
         if ($store === false) {
112 115
             $sessiontable->data[] = array($plugin, $struntestable, '-', '-', '-', '-');
  116
+        } else if (!$store->is_ready()) {
  117
+            $sessiontable->data[] = array($plugin, $strnotready, '-', '-', '-', '-');
113 118
         } else {
114 119
             $result = array($plugin, $strtested, 0, 0, 0);
115 120
             $start = microtime(true);
@@ -146,6 +151,8 @@
146 151
         $store = $class::initialise_test_instance($request);
147 152
         if ($store === false) {
148 153
             $requesttable->data[] = array($plugin, $struntestable, '-', '-', '-', '-');
  154
+        } else if (!$store->is_ready()) {
  155
+            $requesttable->data[] = array($plugin, $strnotready, '-', '-', '-', '-');
149 156
         } else {
150 157
             $result = array($plugin, $strtested, 0, 0, 0);
151 158
             $start = microtime(true);
3  lang/en/cache.php
@@ -105,6 +105,9 @@
105 105
 $string['storenameinvalid'] = 'Invalid store name. You can only use a-z A-Z 0-9 -_ and spaces.';
106 106
 $string['storeperformance'] = 'Cache store performance reporting - {$a} unique requests per operation.';
107 107
 $string['storeready'] = 'Ready';
  108
+$string['storenotready'] = 'Store not ready';
  109
+$string['storerequiresattention'] = 'Requries attention.';
  110
+$string['storerequiresattention_help'] = 'This store instance is not ready to be used but has mappings. Fixing this issue will improve performance on your system. Please check that the store backend is ready to be used and that any PHP requirements are met.';
108 111
 $string['storeresults_application'] = 'Store requests when used as an application cache.';
109 112
 $string['storeresults_request'] = 'Store requests when used as a request cache.';
110 113
 $string['storeresults_session'] = 'Store requests when used as a session cache.';
1  theme/base/style/admin.css
@@ -333,5 +333,6 @@
333 333
 #core-cache-store-summaries .default-store td {color:#333;font-style: italic;}
334 334
 #core-cache-rescan-definitions,
335 335
 #core-cache-mode-mappings .edit-link {margin-top:0.5em;text-align:center;}
  336
+#core-cache-store-summaries .store-requires-attention {background-color:#ffd3d9;}
336 337
 
337 338
 .tinymcesubplugins img.icon { padding-top: 0; padding-bottom: 0; }

0 notes on commit c643628

Please sign in to comment.
Something went wrong with that request. Please try again.