PHP 클래스 Piwik\Plugin\Archiver

Descendants should implement the {@link aggregateDayReport()} and {@link aggregateMultipleReports()} methods. Both of these methods should persist analytics data using the {@link \Piwik\ArchiveProcessor} instance returned by {@link getProcessor()}. The {@link aggregateDayReport()} method should compute analytics data using the {@link \Piwik\DataAccess\LogAggregator} instance returned by {@link getLogAggregator()}. ### Examples **Extending Archiver** class MyArchiver extends Archiver { public function aggregateDayReport() { $logAggregator = $this->getLogAggregator(); $data = $logAggregator->queryVisitsByDimension(...); $dataTable = new DataTable(); $dataTable->addRowsFromSimpleArray($data); $archiveProcessor = $this->getProcessor(); $archiveProcessor->insertBlobRecords('MyPlugin_myReport', $dataTable->getSerialized(500)); } public function aggregateMultipleReports() { $archiveProcessor = $this->getProcessor(); $archiveProcessor->aggregateDataTableRecords('MyPlugin_myReport', 500); } }
파일 보기 프로젝트 열기: piwik/piwik 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( Piwik\ArchiveProcessor $processor ) Constructor.
aggregateDayReport ( ) Archives data for a day period.
aggregateMultipleReports ( ) Archives data for a non-day period.
disable ( )
isEnabled ( ) : boolean Whether this Archiver should be used or not.

보호된 메소드들

메소드 설명
getLogAggregator ( ) : LogAggregator Returns a {@link Piwik\DataAccess\LogAggregator} instance that can be used to aggregate log table rows for this period, segment and site.
getProcessor ( ) : Piwik\ArchiveProcessor Returns a {@link Piwik\ArchiveProcessor} instance that can be used to insert archive data for the period, segment and site we are archiving data for.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( Piwik\ArchiveProcessor $processor )
$processor Piwik\ArchiveProcessor The ArchiveProcessor instance to use when persisting archive data.

aggregateDayReport() 추상적인 공개 메소드

Implementations of this method should do more computation intensive activities such as aggregating data across log tables. Since this method only deals w/ data logged for a day, aggregating individual log table rows isn't a problem. Doing this for any larger period, however, would cause performance degradation. Aggregate log table rows using a {@link Piwik\DataAccess\LogAggregator} instance. Get a {@link Piwik\DataAccess\LogAggregator} instance using the {@link getLogAggregator()} method.
abstract public aggregateDayReport ( )

aggregateMultipleReports() 추상적인 공개 메소드

Implementations of this method should only aggregate existing reports of subperiods of the current period. For example, it is more efficient to aggregate reports for each day of a week than to aggregate each log entry of the week. Use {@link Piwik\ArchiveProcessor::aggregateNumericMetrics()} and {@link Piwik\ArchiveProcessor::aggregateDataTableRecords()} to aggregate archived reports. Get the {@link Piwik\ArchiveProcessor} instance using the {@link getProcessor()} method.
abstract public aggregateMultipleReports ( )

disable() 공개 메소드

public disable ( )

getLogAggregator() 보호된 메소드

Returns a {@link Piwik\DataAccess\LogAggregator} instance that can be used to aggregate log table rows for this period, segment and site.
protected getLogAggregator ( ) : LogAggregator
리턴 Piwik\DataAccess\LogAggregator

getProcessor() 보호된 메소드

Returns a {@link Piwik\ArchiveProcessor} instance that can be used to insert archive data for the period, segment and site we are archiving data for.
protected getProcessor ( ) : Piwik\ArchiveProcessor
리턴 Piwik\ArchiveProcessor

isEnabled() 공개 메소드

Whether this Archiver should be used or not.
public isEnabled ( ) : boolean
리턴 boolean