当前位置: 首页>>代码示例>>PHP>>正文


PHP Rules::getDoneFlagArchiveContainsAllPlugins方法代码示例

本文整理汇总了PHP中Piwik\ArchiveProcessor\Rules::getDoneFlagArchiveContainsAllPlugins方法的典型用法代码示例。如果您正苦于以下问题:PHP Rules::getDoneFlagArchiveContainsAllPlugins方法的具体用法?PHP Rules::getDoneFlagArchiveContainsAllPlugins怎么用?PHP Rules::getDoneFlagArchiveContainsAllPlugins使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Piwik\ArchiveProcessor\Rules的用法示例。


在下文中一共展示了Rules::getDoneFlagArchiveContainsAllPlugins方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: insertArchiveRow

 private function insertArchiveRow($idSite, $date, $periodLabel)
 {
     $periodObject = \Piwik\Period\Factory::build($periodLabel, $date);
     $dateStart = $periodObject->getDateStart();
     $dateEnd = $periodObject->getDateEnd();
     $table = ArchiveTableCreator::getNumericTable($dateStart);
     $idArchive = (int) Db::fetchOne("SELECT MAX(idarchive) FROM {$table} WHERE name LIKE 'done%'");
     $idArchive = $idArchive + 1;
     $periodId = Piwik::$idPeriods[$periodLabel];
     $doneFlag = 'done';
     if ($idArchive % 5 == 1) {
         $doneFlag = Rules::getDoneFlagArchiveContainsAllPlugins(self::$segment1);
     } else {
         if ($idArchive % 5 == 2) {
             $doneFlag .= '.VisitsSummary';
         } else {
             if ($idArchive % 5 == 3) {
                 $doneFlag = Rules::getDoneFlagArchiveContainsOnePlugin(self::$segment1, 'UserCountry');
             } else {
                 if ($idArchive % 5 == 4) {
                     $doneFlag = Rules::getDoneFlagArchiveContainsAllPlugins(self::$segment2);
                 }
             }
         }
     }
     $sql = "INSERT INTO {$table} (idarchive, name, idsite, date1, date2, period, ts_archived)\n                     VALUES ({$idArchive}, 'nb_visits', {$idSite}, '{$dateStart}', '{$dateEnd}', {$periodId}, NOW()),\n                            ({$idArchive}, '{$doneFlag}', {$idSite}, '{$dateStart}', '{$dateEnd}', {$periodId}, NOW())";
     Db::query($sql);
 }
开发者ID:diosmosis,项目名称:piwik,代码行数:28,代码来源:ArchiveInvalidatorTest.php

示例2: updateArchiveAsInvalidated

 /**
  * @param string $archiveTable Prefixed table name
  * @param int[] $idSites
  * @param string[][] $datesByPeriodType
  * @param Segment $segment
  * @return \Zend_Db_Statement
  * @throws Exception
  */
 public function updateArchiveAsInvalidated($archiveTable, $idSites, $datesByPeriodType, Segment $segment = null)
 {
     $idSites = array_map('intval', $idSites);
     $bind = array();
     $periodConditions = array();
     foreach ($datesByPeriodType as $periodType => $dates) {
         $dateConditions = array();
         foreach ($dates as $date) {
             $dateConditions[] = "(date1 <= ? AND ? <= date2)";
             $bind[] = $date;
             $bind[] = $date;
         }
         $dateConditionsSql = implode(" OR ", $dateConditions);
         if (empty($periodType) || $periodType == Period\Day::PERIOD_ID) {
             // invalidate all periods if no period supplied or period is day
             $periodConditions[] = "({$dateConditionsSql})";
         } else {
             if ($periodType == Period\Range::PERIOD_ID) {
                 $periodConditions[] = "(period = " . Period\Range::PERIOD_ID . " AND ({$dateConditionsSql}))";
             } else {
                 // for non-day periods, invalidate greater periods, but not range periods
                 $periodConditions[] = "(period >= " . (int) $periodType . " AND period < " . Period\Range::PERIOD_ID . " AND ({$dateConditionsSql}))";
             }
         }
     }
     if ($segment) {
         $nameCondition = "name LIKE '" . Rules::getDoneFlagArchiveContainsAllPlugins($segment) . "%'";
     } else {
         $nameCondition = "name LIKE 'done%'";
     }
     $sql = "UPDATE {$archiveTable} SET value = " . ArchiveWriter::DONE_INVALIDATED . " WHERE {$nameCondition}\n                   AND idsite IN (" . implode(", ", $idSites) . ")\n                   AND (" . implode(" OR ", $periodConditions) . ")";
     return Db::query($sql, $bind);
 }
开发者ID:JoeHorn,项目名称:piwik,代码行数:41,代码来源:Model.php

示例3: cacheArchiveIdsWithoutLaunching

 /**
  * Gets the IDs of the archives we're querying for and stores them in $this->archives.
  * This function will not launch the archiving process (and is thus much, much faster
  * than cacheArchiveIdsAfterLaunching).
  *
  * @param array $plugins List of plugin names from which data is being requested.
  */
 private function cacheArchiveIdsWithoutLaunching($plugins)
 {
     $idarchivesByReport = ArchiveSelector::getArchiveIds($this->params->getIdSites(), $this->params->getPeriods(), $this->params->getSegment(), $plugins);
     // initialize archive ID cache for each report
     foreach ($plugins as $plugin) {
         $doneFlag = $this->getDoneStringForPlugin($plugin, $this->params->getIdSites());
         $this->initializeArchiveIdCache($doneFlag);
         $globalDoneFlag = Rules::getDoneFlagArchiveContainsAllPlugins($this->params->getSegment());
         $this->initializeArchiveIdCache($globalDoneFlag);
     }
     foreach ($idarchivesByReport as $doneFlag => $idarchivesByDate) {
         foreach ($idarchivesByDate as $dateRange => $idarchives) {
             foreach ($idarchives as $idarchive) {
                 $this->idarchives[$doneFlag][$dateRange][] = $idarchive;
             }
         }
     }
 }
开发者ID:diosmosis,项目名称:piwik,代码行数:25,代码来源:Archive.php


注:本文中的Piwik\ArchiveProcessor\Rules::getDoneFlagArchiveContainsAllPlugins方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。