daniloalvessouza / webgrind

Automatically exported from code.google.com/p/webgrind
Other
0 stars 0 forks source link

PHP warnings issued in Reader.php #5

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. I select a cachegrind file with internal PHP functions in it.
2. I click Update.
3. Then I watch the error log.

What is the expected output? What do you see instead?

Expected log output is nothing.

Current warning: [Thu May 22 18:50:29 2008] [error] [client 127.0.0.1] PHP
Notice:  Undefined index:  summary in
/Users/olle/web/webgrind/library/Reader.php on line 200, referer:
http://mylocalweb/webgrind/

What version of the product are you using? On what operating system?

The 0.6 zip. Mac OS X. Apache2. 

Please provide any additional information below.

Something like

    function getHeader($header){
        $headers = $this->getHeaders();
        if (array_key_exists($header, $headers)) {
            return $headers[$header];
        }
        return '';
    }

Might be able to handle it. I added a check for empty-stringness to
formatCost():

        if ($cost==='') {
          $cost = 0;
        }

(Sorry about the non-patchy nature of this, but... where is the SVN repo? :-) )

Original issue reported on code.google.com by olle.jonsson on 22 May 2008 at 4:59

GoogleCodeExporter commented 8 years ago
Thanks for the report. 

I am unable to reproduce the problem on my machine. Could you provide further 
details into the situation where 
you see this behaviour?

Original comment by gugakf...@gmail.com on 29 May 2008 at 6:54

GoogleCodeExporter commented 8 years ago
It would be great if you could attach cachegrind output file that you parsed 
when the notice occurred

Thanks 

Original comment by oett...@gmail.com on 4 Jun 2008 at 5:12

GoogleCodeExporter commented 8 years ago
I can confirm this bug.

You have to edit your php.ini to turn ON E_NOTICE (which you should do as a 
matter of
code QA anyway):
In php.ini:
error_reporting E_ALL

Or, in main/global/first include file:
error_reporting(E_ALL);

Here is a patch I mistakenly put into XDebug-helper system, while on the wrong 
tab:

http://code.google.com/p/syslogr-utils/issues/detail?id=3

PS
I'll be happy to help provide more patches in the future, or you can make me a
developer if that's easier.

Original comment by richardl...@gmail.com on 23 Jul 2008 at 2:40

GoogleCodeExporter commented 8 years ago
We have been testing with E_ALL with negative result so it must be that the 
error only occurs with some files. In 
any case, thanks for the patch, included in r129

Original comment by gugakf...@gmail.com on 28 Jul 2008 at 10:40