0.4 and PHP 5.2.10


(Edoardo) #1

Hi there,

are there any known issues with Piwik v0.4 and PHP v5.2.10?
Accessing Piwik I get:

Declaration of Piwik_Event_Notification::increaseNotificationCount() should be compatible with that of Event_Notification::increaseNotificationCount()
in ‘\piwik\core\PluginsManager.php’ at the line 509

It used to work with PHP v5.2.9.2.

Thank you.


(vipsoft) #2

ticket created; http://dev.piwik.org/trac/ticket/819


(vipsoft) #3

Apply the patch in http://dev.piwik.org/trac/changeset/1246 and let us know if you encounter any more 5.2.10-related issues.


(Ivand) #4

Thanks for a quick fix, works like a charm!

EDIT Actually I spoke too soon. Now I get these errors:

Declaration of Piwik_Log_Error::log() should be compatible with that of Piwik_Log::log()
in ‘/usr/home/myrkar/public_html/piwik/core/Log/Error.php’ at the line 56

Declaration of Piwik_Log_APICall::log() should be compatible with that of Piwik_Log::log()
in ‘/usr/home/myrkar/public_html/piwik/core/Log/APICall.php’ at the line 52


(Nekron) #5

(vipsoft) #6

Here’s a 2nd patch to apply:

http://dev.piwik.org/trac/changeset/1247


(Nekron) #7

[quote=vipsoft @ Jun 22 2009, 12:39 PM]Here’s a 2nd patch to apply:

http://dev.piwik.org/trac/changeset/1247[/quote]

I’ve got now PiWik from svn and trying a fresh installation on my server got me the following error:

Declaration of Piwik_Log::log() should be compatible with that of Zend_Log::log()
in ‘/var/www/piwik/core/Log.php’ at the line 23

#0 Piwik_ErrorHandler(2048, Declaration of Piwik_Log::log() should be compatible with that of Zend_Log::log(), /var/www/piwik/core/Log.php, 23, Array ([class] => Piwik,[classPath] => Piwik,[i] => 0,[path] => /var/www/piwik/core/Piwik.php)) called at [/var/www/piwik/core/Log.php:23]
#1 require_once(/var/www/piwik/core/Log.php) called at [/var/www/piwik/core/Piwik.php:15]
#2 require_once(/var/www/piwik/core/Piwik.php) called at [/var/www/piwik/core/Loader.php:45]
#3 Piwik_Loader::autoload(Piwik)
#4 spl_autoload_call(Piwik) called at [/var/www/piwik/core/FrontController.php:186]
#5 Piwik_FrontController->init() called at [/var/www/piwik/index.php:58]

Thanks for your great support!


(vipsoft) #8

Grrr. Me no like this change in PHP behaviour. Me need to build 5.2.10. Me be back after my morning coffee.


(Nekron) #9

Lol… yea… I downgrade to 5.2.9 and everything works like a charm. Anyway, if you get things fixed I upgrade again :slight_smile:


(ixiter) #10

I dont like the 2nd patch with the unused=null parameter in the log functions. IMHO this is suboptimal and looks kinda crappy. Code should be beautiful. style_emoticons/<#EMO_DIR#>/wink.gif
So I patched it like you guys did in the 1st patch, by commenting the log() parameter and use func_get_args() generally. Little mess was, I had to remove E_NOTICE from error_reporting, because I got hundreds of notices.
Anyway … it works for me pretty good now.
Hope the next piwik update will care for PHP 5.2.10’s nature.


(Ivand) #11

[quote=ixiter @ Jun 23 2009, 03:19 AM]I dont like the 2nd patch with the unused=null parameter in the log functions. IMHO this is suboptimal and looks kinda crappy. Code should be beautiful. style_emoticons/<#EMO_DIR#>/wink.gif
So I patched it like you guys did in the 1st patch, by commenting the log() parameter and use func_get_args() generally. Little mess was, I had to remove E_NOTICE from error_reporting, because I got hundreds of notices.
Anyway … it works for me pretty good now.
Hope the next piwik update will care for PHP 5.2.10’s nature.[/quote]

Could you share your fix code? I tried to do something similar but didn’t succeed style_emoticons/<#EMO_DIR#>/sad.gif


(vipsoft) #12

Argh. Shiver me timbers, this be an old change (circa 2006) made more “noticeable”.

http://bugs.php.net/bug.php?id=38148

Anyone know of an easy way to scour the codebase for more occurrences?


(ixiter) #13

@Ivand: Sure I do that.
[attachment=57:ixiters_…hp5.2.10.zip]
ATTENTION: This is NOT an official piwik patch or update. It is not supported by piwik! It is just my own patch for my own purpose and those who want to try it out. No warranties for anything!

Copy the files from the archive to your piwik installation.
After you will see lots of E_NOTICE messages. To avoid, change line 12 in index.php.

FIND: (line 12)
error_reporting(E_ALL|E_NOTICE);

REPLACE WITH:
error_reporting(E_ALL - E_NOTICE);

@vipsoft: I guess this is obsolete. Its also marked as “not a bug” in that post. I guess its more a call_by_reference or call_by_value issue with piwik.
The following code doesnt throw any exception and echos as expected with PHP5.2.10.

<?php
error_reporting(E_ALL);
ini_set('display_errors', 1)

class A 
{ 
    public function test($a) { 
        $bla = $a;
        echo 'I am A'; 
    } 
} 
 
class B extends A 
{ 
    public function test($a, $b) { 
        echo 'I am B'; 
        parent::test($a.$b);
    } 
} 
 
$a = new A; 
$a->test('Test'); 
$b = new B; 
$b->test('Test', 'Test');

(toastjelly) #14

i am sorry - by no means am i a programmer but i got that error as well

Declaration of Piwik_Event_Notification::increaseNotificationCount() should be compatible with that of Event_Notification::increaseNotificationCount()
in ‘/homepages/16/d272953503/htdocs/austinseo/piwik/core/PluginsManager.php’ at the line 509

…followed by a massive amount of text.

this just happened, i checked my stats this morning, can anyone confirm that either one of these patches work?

thanks


(vipsoft) #15

Sorry, I took a few stabs at the problem until I got something I was happy with. It is fixed in SVN.

A cumulative patch is attached.


(ixiter) #16

The patches in #3 and #6 of this thread work. Instead of the patch linked in #6 you can try my own patch, attached in #13

Or use the SVN version, just updated by vipsoft above.


(Guido) #17

Hi,

With this patch I get no longer the error message “Declaration of …”. But on every page i see only “loading data” and no data? On the error console of Firefox 3 I can see a javascript error:

Error: broadcast is not defined
Source file: http://stat.domain.tld/plugins/CoreHome/templates/menu.js?piwik=0.4
Line: 65

Edit: Same problem and same javascript error with Internet Explorer 8. So it’s no Firefox specific javascript problem.

Guido


(vipsoft) #18

Once you’ve patched your files, you need to manually clear your browser cache and files in tmp/templates_c/* as this won’t be detected as an update.


(toastjelly) #19

thank you all, i will apply the proper patch this afternoon…also if i can ask - what caused this sudden change? i apologize for my newbiness…


(fert) #20

Hi,

after applying all these patches, I get this:

Declaration of Piwik_Log_APICall::log() should be compatible with that of Piwik_Log::log() 
in '/homepages/1/d275144252/htdocs/piwik/core/Log/APICall.php' at the line 52

#0  Piwik_ErrorHandler(2048, Declaration of Piwik_Log_APICall::log() should be compatible with that of Piwik_Log::log(), /homepages/1/d275144252/htdocs/piwik/core/Log/APICall.php, 52, Array ()) called at [/homepages/1/d275144252/htdocs/piwik/core/Piwik.php:1232]
#1  Piwik::createLogObject() called at [/homepages/1/d275144252/htdocs/piwik/core/Piwik.php:1232]
#2  Piwik::createLogObject() called at [/homepages/1/d275144252/htdocs/piwik/core/FrontController.php:232]
#3  Piwik_FrontController->init() called at [/homepages/1/d275144252/htdocs/piwik/index.php:53]

Any idea how to fix this?