Lots of undefined indexes when running start page
Opened this issue · 6 comments
GoogleCodeExporter commented
What steps will reproduce the problem?
1. Just load it
What is the expected output? What do you see instead?
No PHP Warnings
What version of the product are you using? On what operating system?
phpmemcacheadmin 1.2.2 - Windows 7 x64, PHP 5.3.14, newest memcached for windows
Original issue reported on code.google.com by cberga...@gmail.com
on 15 Feb 2013 at 9:12
GoogleCodeExporter commented
Error occurs here:
$slabs[$id]['request_rate'] = @sprintf('%.1f', ($slab['get_hits'] +
$slab['cmd_set'] + $slab['delete_hits'] + $slab['cas_hits'] +
$slab['cas_badval'] + $slab['incr_hits'] + $slab['decr_hits']) /
$slabs['uptime'], 1);
$slabs[$id]['mem_wasted'] = (($slab['total_chunks'] * $slab['chunk_size']) < $slab['mem_requested']) ?(($slab['total_chunks'] - $slab['used_chunks']) * $slab['chunk_size']):(($slab['total_chunks'] * $slab['chunk_size']) - $slab['mem_requested']);
Original comment by cberga...@gmail.com
on 15 Feb 2013 at 9:32
GoogleCodeExporter commented
Hello,
Does this bug produce only when your cache is empty or every time ?
Original comment by c.mahi...@of2m.fr
on 18 Feb 2013 at 8:48
GoogleCodeExporter commented
Everytime
Original comment by cberga...@gmail.com
on 18 Feb 2013 at 9:11
GoogleCodeExporter commented
I have the same. Massive entrys in the log. Line 246 and 247
Original comment by oliver.t...@gmail.com
on 7 Mar 2013 at 6:04
GoogleCodeExporter commented
Adding this above those lines will fix it:
if (!isset($slab['get_hits'])) $slab['get_hits'] = 0;
if (!isset($slab['cmd_set'])) $slab['cmd_set'] = 0;
if (!isset($slab['delete_hits'])) $slab['delete_hits'] = 0;
if (!isset($slab['cas_hits'])) $slab['cas_hits'] = 0;
if (!isset($slab['cas_badval'])) $slab['cas_badval'] = 0;
if (!isset($slab['incr_hits'])) $slab['incr_hits'] = 0;
if (!isset($slab['decr_hits'])) $slab['decr_hits'] = 0;
if (!isset($slab['mem_requested'])) $slab['mem_requested'] = 0;
Or you can just turn notices off.
Original comment by rvel...@freepromarketing.com
on 8 Mar 2013 at 3:43
GoogleCodeExporter commented
Two fixes here:
Either add error_reporting(E_ALL ^ E_NOTICE); at the top of the index.php file.
(Bad way but it will hide the notices).
Or add the following code (solution posted above) line 246 in the
Library/Data/Analysis.php file:
if (!isset($slab['get_hits'])) $slab['get_hits'] = 0;
if (!isset($slab['cmd_set'])) $slab['cmd_set'] = 0;
if (!isset($slab['delete_hits'])) $slab['delete_hits'] = 0;
if (!isset($slab['cas_hits'])) $slab['cas_hits'] = 0;
if (!isset($slab['cas_badval'])) $slab['cas_badval'] = 0;
if (!isset($slab['incr_hits'])) $slab['incr_hits'] = 0;
if (!isset($slab['decr_hits'])) $slab['decr_hits'] = 0;
if (!isset($slab['mem_requested'])) $slab['mem_requested'] = 0;
Original comment by raphael....@gmail.com
on 14 Nov 2014 at 10:33