/** * Caches one or more blob records in the archive for this processor's site, period * and segment. * * @param string $name The name of the record, eg, 'Referrers_type'. * @param string|array $values A blob string or an array of blob strings. If an array * is used, the first element in the array will be inserted * with the `$name` name. The others will be inserted with * `$name . '_' . $index` as the record name (where $index is * the index of the blob record in `$values`). * @api */ public function insertBlobRecord($name, $values) { $this->archiveWriter->insertBlobRecord($name, $values); }
private function createArchiveBlobEntry($date, $blobs) { $oPeriod = PeriodFactory::makePeriodFromQueryParams('UTC', 'day', $date); $segment = new Segment(false, array(1)); $params = new Parameters(new Site(1), $oPeriod, $segment); $writer = new ArchiveWriter($params, false); $writer->initNewArchive(); foreach ($blobs as $name => $blob) { $writer->insertBlobRecord($name, $blob); } $writer->finalizeArchive(); }