google-code-export / zfdebug

Automatically exported from code.google.com/p/zfdebug
Other
1 stars 1 forks source link

Notices and Warnings in the Cache.php #41

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Enable the ZFDebug
2. It is shown several warnings and notices regarding the plugin Cache.php

What is the expected output? What do you see instead?
That show me the error of my application/Error of the ZFDebug

What version of the product are you using? On what operating system?
the latest version available for download / Ubuntu 9.10

Please provide any additional information below.
I suggest to add a simple verification in the plugin Cache.php in
getPanel() method if is empty or not:

    public function getPanel()
    {
        $panel = '';

        # Support for APC
        if (function_exists('apc_sma_info') && ini_get('apc.enabled')) {
            $mem = apc_sma_info();
            // Verify if $mem is not empty
            if (!empty($mem)) {
            $mem_size = $mem['num_seg']*$mem['seg_size'];
                $mem_avail = $mem['avail_mem'];
            $mem_used = $mem_size-$mem_avail;

            $cache = apc_cache_info();

            $panel .= '<h4>APC '.phpversion('apc').' Enabled</h4>';
            $panel .= round($mem_avail/1024/1024, 1).'M
available,'.round($mem_used/1024/1024, 1).'M used<br />'
                        . $cache['num_entries'].' Files cached
('.round($cache['mem_size']/1024/1024, 1).'M)<br />'
                        . $cache['num_hits'].' Hits
('.round($cache['num_hits'] * 100 /
($cache['num_hits']+$cache['num_misses']), 1).'%)<br />'
                        . $cache['expunges'].' Expunges (cache full count)';
            }
        }
    ...

Original issue reported on code.google.com by nar...@gmail.com on 22 Feb 2010 at 6:46