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


PHP Site::getId方法代码示例

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


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

示例1: getArchiveIdAndVisits

 public static function getArchiveIdAndVisits(Site $site, Period $period, Segment $segment, $minDatetimeArchiveProcessedUTC, $requestedPlugin)
 {
     $dateStart = $period->getDateStart();
     $bindSQL = array($site->getId(), $dateStart->toString('Y-m-d'), $period->getDateEnd()->toString('Y-m-d'), $period->getId());
     $timeStampWhere = '';
     if ($minDatetimeArchiveProcessedUTC) {
         $timeStampWhere = " AND ts_archived >= ? ";
         $bindSQL[] = Date::factory($minDatetimeArchiveProcessedUTC)->getDatetime();
     }
     $pluginOrVisitsSummary = array("VisitsSummary", $requestedPlugin);
     $pluginOrVisitsSummary = array_unique($pluginOrVisitsSummary);
     $sqlWhereArchiveName = self::getNameCondition($pluginOrVisitsSummary, $segment);
     $sqlQuery = "\tSELECT idarchive, value, name, date1 as startDate\n\t\t\t\t\t\tFROM " . ArchiveTableCreator::getNumericTable($dateStart) . "``\n\t\t\t\t\t\tWHERE idsite = ?\n\t\t\t\t\t\t\tAND date1 = ?\n\t\t\t\t\t\t\tAND date2 = ?\n\t\t\t\t\t\t\tAND period = ?\n\t\t\t\t\t\t\tAND ( ({$sqlWhereArchiveName})\n\t\t\t\t\t\t\t\t  OR name = '" . self::NB_VISITS_RECORD_LOOKED_UP . "'\n\t\t\t\t\t\t\t\t  OR name = '" . self::NB_VISITS_CONVERTED_RECORD_LOOKED_UP . "')\n\t\t\t\t\t\t\t{$timeStampWhere}\n\t\t\t\t\t\tORDER BY idarchive DESC";
     $results = Db::fetchAll($sqlQuery, $bindSQL);
     if (empty($results)) {
         return false;
     }
     $idArchive = self::getMostRecentIdArchiveFromResults($segment, $requestedPlugin, $results);
     $idArchiveVisitsSummary = self::getMostRecentIdArchiveFromResults($segment, "VisitsSummary", $results);
     list($visits, $visitsConverted) = self::getVisitsMetricsFromResults($idArchive, $idArchiveVisitsSummary, $results);
     if ($visits === false && $idArchive === false) {
         return false;
     }
     return array($idArchive, $visits, $visitsConverted);
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:25,代码来源:ArchiveSelector.php

示例2: setUp

 public function setUp()
 {
     parent::setUp();
     $idSite = 1;
     if (!Fixture::siteCreated($idSite)) {
         Fixture::createWebsite('2014-01-01 00:00:00');
     }
     $site = new Site($idSite);
     $date = Date::factory('2012-01-01');
     $period = Period\Factory::build('month', $date);
     $segment = new Segment('', array($site->getId()));
     $params = new Parameters($site, $period, $segment);
     $this->logAggregator = new LogAggregator($params);
 }
开发者ID:dorelljames,项目名称:piwik,代码行数:14,代码来源:LogAggregatorTest.php

示例3: getMinTimeProcessedForTemporaryArchive

 public static function getMinTimeProcessedForTemporaryArchive(Date $dateStart, \Piwik\Period $period, Segment $segment, Site $site)
 {
     $now = time();
     $minimumArchiveTime = $now - Rules::getTodayArchiveTimeToLive();
     $idSites = array($site->getId());
     $isArchivingDisabled = Rules::isArchivingDisabledFor($idSites, $segment, $period->getLabel());
     if ($isArchivingDisabled) {
         if ($period->getNumberOfSubperiods() == 0 && $dateStart->getTimestamp() <= $now) {
             // Today: accept any recent enough archive
             $minimumArchiveTime = false;
         } else {
             // This week, this month, this year:
             // accept any archive that was processed today after 00:00:01 this morning
             $timezone = $site->getTimezone();
             $minimumArchiveTime = Date::factory(Date::factory('now', $timezone)->getDateStartUTC())->setTimezone($timezone)->getTimestamp();
         }
     }
     return $minimumArchiveTime;
 }
开发者ID:diosmosis,项目名称:piwik,代码行数:19,代码来源:Rules.php

示例4: prepareArchive

 /**
  * @param $archiveGroups
  * @param $site
  * @param $period
  */
 private function prepareArchive(array $archiveGroups, Site $site, Period $period)
 {
     $parameters = new ArchiveProcessor\Parameters($site, $period, $this->params->getSegment());
     $archiveLoader = new ArchiveProcessor\Loader($parameters);
     $periodString = $period->getRangeString();
     $idSites = array($site->getId());
     // process for each plugin as well
     foreach ($archiveGroups as $plugin) {
         $doneFlag = $this->getDoneStringForPlugin($plugin, $idSites);
         $this->initializeArchiveIdCache($doneFlag);
         $idArchive = $archiveLoader->prepareArchive($plugin);
         if ($idArchive) {
             $this->idarchives[$doneFlag][$periodString][] = $idArchive;
         }
     }
 }
开发者ID:sebastianpiskorski,项目名称:piwik,代码行数:21,代码来源:Archive.php

示例5: getBindDatetimeSite

 protected function getBindDatetimeSite()
 {
     return array($this->dateStart->getDateStartUTC(), $this->dateEnd->getDateEndUTC(), $this->site->getId());
 }
开发者ID:emersonmatsumoto,项目名称:piwik,代码行数:4,代码来源:LogAggregator.php

示例6: getArchiveIdAndVisits

 public function getArchiveIdAndVisits($table, \Piwik\Site $site, \Piwik\Period $period, $minDatetime, $sqlWhereArchiveName)
 {
     $bind = array($site->getId(), $period->getDateStart()->toString('Y-m-d'), $period->getDateEnd()->toString('Y-m-d'), $period->getId());
     if ($minDatetime) {
         $timestampWhere = ' AND ts_archived >= ?';
         $bind[] = Date::factory($minDatetime)->getDatetime();
     } else {
         $timestampWhere = '';
     }
     $startDate = $this->db->quoteIdentifier('startDate');
     $sql = "SELECT idarchive, value, name, date1 AS {$startDate}\n                FROM {$table}\n                WHERE idsite = ?\n                  AND date1 = ?\n                  AND date2 = ?\n                  AND period = ?\n                  AND ( ({$sqlWhereArchiveName})\n                        OR name = '" . ArchiveSelector::NB_VISITS_RECORD_LOOKED_UP . "'\n                        OR name = '" . ArchiveSelector::NB_VISITS_CONVERTED_RECORD_LOOKED_UP . "'\n                     )\n                  {$timestampWhere}\n                ORDER BY idarchive DESC";
     return $this->db->fetchAll($sql, $bind);
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:13,代码来源:Archive.php


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