1 | <?php |
||||||
2 | /** |
||||||
3 | * Memcache info |
||||||
4 | */ |
||||||
5 | $servers = elgg_get_config('memcache_servers'); |
||||||
6 | $has_class = class_exists('Memcached') || class_exists('Memcache'); |
||||||
7 | if (!elgg_get_config('memcache') || empty($servers) || !$has_class) { |
||||||
8 | echo '<p>' . elgg_echo('admin:server:memcache:inactive') . '</p>'; |
||||||
9 | return; |
||||||
10 | } |
||||||
11 | |||||||
12 | if (class_exists('Memcached')) { |
||||||
13 | $memcache = new Memcached(); |
||||||
14 | } else { |
||||||
15 | $memcache = new Memcache(); |
||||||
16 | } |
||||||
17 | foreach ($servers as $server) { |
||||||
18 | $title = "{$server[0]}:{$server[1]}"; |
||||||
19 | |||||||
20 | $memcache->connect($server[0], $server[1]); |
||||||
0 ignored issues
–
show
|
|||||||
21 | $stats = $memcache->getStats(); |
||||||
0 ignored issues
–
show
The call to
MemcachePool::getStats() has too few arguments starting with slabid .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.
Loading history...
|
|||||||
22 | $memcache->close(); |
||||||
0 ignored issues
–
show
The method
close() does not exist on Memcached .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed.
Loading history...
|
|||||||
23 | |||||||
24 | ob_start(); |
||||||
25 | ?> |
||||||
26 | <table class="elgg-table-alt"> |
||||||
27 | <?php |
||||||
28 | foreach ($stats as $key => $value) { |
||||||
29 | ?> |
||||||
30 | <tr> |
||||||
31 | <td><b><?= $key ?></b></td> |
||||||
32 | <td><?= $value ?></td> |
||||||
33 | </tr> |
||||||
34 | <?php |
||||||
35 | } |
||||||
36 | ?> |
||||||
37 | </table> |
||||||
38 | |||||||
39 | <?php |
||||||
40 | $table = ob_get_clean(); |
||||||
41 | |||||||
42 | echo elgg_view_module('info', $title, $table); |
||||||
43 | } |
||||||
44 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.