Problem with using data from archives


#1

Hallo,
I’m trying to built a piwik-plugin that uses data from an archive in its code. It worked fine using the plugin’s api to get the data from the archive. But when I tryed to use auto archiving I ended up in an endles loop. I know why this happens but I cant figure out a way to solve this.

Here is what happens:
-I ask my api for data.
-my api executes getDataTableFromArchive() to get a datatable from the archive
-some steps later we are in Single.php/prepareArchive() and Piwik wants to know whether it should launch archiving (in normal cases this happens when the archive is not available, but I dont want this to happen)
-for this reason piwik calls
$this->archiveProcessing->isArchivingDisabled()
-now my aim is to “persuade” this function to return true and everything will be fine
-while auto archiving is disabled I archived this by this line:
Piwik_ArchiveProcessing::setBrowserTriggerArchiving(false);
-but when I call Piwik from command line (necassary for auto archiving) isArchivingDisabled() always returns false because it checks wheter Piwik was called from command line (cli-mode) and returns false if that is the case
(then archiving is launched and this brings me back to top => endless loop)

So, thats my understanding of the issue. Please correct me, if I’m wrong and please help me, if you know how I could solve this or circumvent it. Any other approach about how to get the data out of the archive to use it in my code would be welcome to.
Thanks in advance and greetings
Davud


#2

by the way piwik version is 1.6


(Matthieu Aubry) #3

Why do you want to disable archiving ? what is the issue you are trying to solve exactly?