本文整理汇总了PHP中Piwik\Period::getLabel方法的典型用法代码示例。如果您正苦于以下问题:PHP Period::getLabel方法的具体用法?PHP Period::getLabel怎么用?PHP Period::getLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Period
的用法示例。
在下文中一共展示了Period::getLabel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}