Commit 6288d096 authored by jhuhta's avatar jhuhta Committed by japerry
Browse files

Issue #3042707 by jcnventura, nikolas.tatianenko, jhuhta, Sergiu Stici: Drupal...

Issue #3042707 by jcnventura, nikolas.tatianenko, jhuhta, Sergiu Stici: Drupal 9 Deprecated Code Report (Messenger)
parent 3a623de2
......@@ -7,5 +7,9 @@
"issues": "https://www.drupal.org/project/issues/memcache"
},
"license": "GPL-2.0+",
"require": { }
"extra": {
"branch-alias": {
"dev-8.x-2.x": "2.x-dev"
}
}
}
......@@ -3,3 +3,4 @@ description: 'High performance integration with memcache.'
type: module
package: 'Performance and scalability'
core: 8.x
core_version_requirement: ^8 || ^9
......@@ -4,8 +4,9 @@ package: Performance and scalability
type: module
core: 8.x
core_version_requirement: ^8 || ^9
configure: memcache_admin.settings
dependancies:
- memcache
dependencies:
- memcache:memcache
......@@ -5,6 +5,7 @@ namespace Drupal\memcache_admin\Controller;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Datetime\DateFormatter;
use Drupal\Core\Link;
use Drupal\Core\Messenger\MessengerTrait;
use Drupal\Core\Url;
use Drupal\Component\Render\HtmlEscapedText;
......@@ -13,6 +14,8 @@ use Drupal\Component\Render\HtmlEscapedText;
*/
class MemcacheStatisticsController extends ControllerBase {
use MessengerTrait;
/**
* Callback for the Memcache Stats page.
*
......@@ -34,7 +37,7 @@ class MemcacheStatisticsController extends ControllerBase {
if (empty($stats[$bin])) {
// Break this out to make drupal_set_message easier to read.
// Break this out to make Drupal Messenger service easier to read.
$additional_message = $this->t(
'@enable the memcache module',
[
......@@ -52,15 +55,14 @@ class MemcacheStatisticsController extends ControllerBase {
// Failed to load statistics. Provide a useful error about where to get
// more information and help.
drupal_set_message(
$this->messenger()->addError(
t(
'There may be a problem with your Memcache configuration. Please review @readme and :more for more information.',
[
'@readme' => 'README.txt',
':more' => $additional_message,
]
),
'error'
)
);
}
else {
......@@ -76,12 +78,12 @@ class MemcacheStatisticsController extends ControllerBase {
}
else {
$version = t('Unknown');
drupal_set_message(t('Failed to detect the memcache PECL extension.'), 'error');
$this->messenger()->addError(t('Failed to detect the memcache PECL extension.'));
}
foreach ($stats as $server => $statistics) {
if (empty($statistics['uptime'])) {
drupal_set_message(t('Failed to connect to server at :address.', [':address' => $server]), 'error');
$this->messenger()->addError(t('Failed to connect to server at :address.', [':address' => $server]));
}
else {
$servers[] = $server;
......@@ -221,7 +223,7 @@ class MemcacheStatisticsController extends ControllerBase {
}
else {
$output = $this->statsTablesRawOutput($cluster, $server, [], $type);
drupal_set_message(t('No @type statistics for this bin.', ['@type' => $type]));
$this->messenger()->addMessage(t('No @type statistics for this bin.', ['@type' => $type]));
}
return $output;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment