Custom plugin out of date after update to 2.03


Hallo everyone,
I just updated to piwik 2.03. I have a little plugin (written myself) that I have been using since piwik 1.5. After the update I went to Settings->plugins to activate my plugin just as usual. There it says, my plugin is not compatible with piwik 2.03 and I should go and find a recent version of the plugin. Since I don’t think that somebody else will update my plugin for me, can you please tell me what I can do to make piwik 2.03 accept my plugin? I have noticed that all other plugins have a new Archiver.php. Is this file essential? How does Piwik know that my plugin is incompatible at all?

(Matthieu Aubry) #2

Compare your plugin with Example* plugins which show the new file structure. The main difference is that we are now using PHP5 and namespaces, it’s quite easy to convert, hope you manage!


OK. I adapted to the namespaces. But now the “small” changes make me struggle. For one thing there is thist lines of code:

$db = Zend_Registry::get(‘db’);
$value = $db->fetchOne(…);

That worked like a charme bevore 2.0x. But now I only get "No entry is registered for key ‘db’ ". Then there is


that just seemed to have disapeared. Is this function somewhere maybe with a new name? Or is there another way to figure out wheter BrowserTriggerArchiving is enabled?

And by the way, why did you rename nearly all your classes? That makes adapting a little nightmare and all for changes like Piwik_Anyclass to Anyclass. Makes me a little frustrated!

Still hoping not all is lost with 2.0x

(Matthieu Aubry) #4


Now in Rules::isBrowserTriggerArchivingEnabled

And by the way, why did you rename nearly all your classes?
It’s called Refactoring: Code refactoring - Wikipedia

it’s needed to make Piwik more modern, easier to maintain, improve, and to attract talented developers to work on Piwik :slight_smile:


and what about the zend -issue? or is there a better way to query the database? my aim is to query some custom variables from piwik_log_visits. Is there a good way to do this?