當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Site::getCreationDateFor方法代碼示例

本文整理匯總了PHP中Piwik\Site::getCreationDateFor方法的典型用法代碼示例。如果您正苦於以下問題:PHP Site::getCreationDateFor方法的具體用法?PHP Site::getCreationDateFor怎麽用?PHP Site::getCreationDateFor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Piwik\Site的用法示例。


在下文中一共展示了Site::getCreationDateFor方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getMinMaxDateAcrossWebsites

 /**
  * The Multisites reports displays the first calendar date as the earliest day available for all websites.
  * Also, today is the later "today" available across all timezones.
  * @param array $siteIds Array of IDs for each site being displayed.
  * @return Date[] of two Date instances. First is the min-date & the second
  *               is the max date.
  * @ignore
  */
 public static function getMinMaxDateAcrossWebsites($siteIds)
 {
     $siteIds = self::getIdSitesFromIdSitesString($siteIds);
     $now = Date::now();
     $minDate = null;
     $maxDate = $now->subDay(1)->getTimestamp();
     foreach ($siteIds as $idsite) {
         // look for 'now' in the website's timezone
         $timezone = Site::getTimezoneFor($idsite);
         $date = Date::adjustForTimezone($now->getTimestamp(), $timezone);
         if ($date > $maxDate) {
             $maxDate = $date;
         }
         // look for the absolute minimum date
         $creationDate = Site::getCreationDateFor($idsite);
         $date = Date::adjustForTimezone(strtotime($creationDate), $timezone);
         if (is_null($minDate) || $date < $minDate) {
             $minDate = $date;
         }
     }
     return array(Date::factory($minDate), Date::factory($maxDate));
 }
開發者ID:carriercomm,項目名稱:piwik,代碼行數:30,代碼來源:Site.php

示例2: getVisitsRequestUrl

 /**
  * Returns base URL to process reports for the $idsite on a given $period
  */
 private function getVisitsRequestUrl($idsite, $period, $lastTimestampWebsiteProcessed = false)
 {
     $dateLastMax = self::DEFAULT_DATE_LAST;
     if ($period == 'year') {
         $dateLastMax = self::DEFAULT_DATE_LAST_YEARS;
     } elseif ($period == 'week') {
         $dateLastMax = self::DEFAULT_DATE_LAST_WEEKS;
     }
     if (empty($lastTimestampWebsiteProcessed)) {
         $lastTimestampWebsiteProcessed = strtotime(\Piwik\Site::getCreationDateFor($idsite));
     }
     // Enforcing last2 at minimum to work around timing issues and ensure we make most archives available
     $dateLast = floor((time() - $lastTimestampWebsiteProcessed) / 86400) + 2;
     if ($dateLast > $dateLastMax) {
         $dateLast = $dateLastMax;
     }
     $dateLastForced = $this->isParameterSet('--force-date-last-n', true);
     if (!empty($dateLastForced)) {
         $dateLast = $dateLastForced;
     }
     return "?module=API&method=VisitsSummary.getVisits&idSite={$idsite}&period={$period}&date=last" . $dateLast . "&format=php&token_auth=" . $this->token_auth;
 }
開發者ID:KiwiJuicer,項目名稱:handball-dachau,代碼行數:25,代碼來源:CronArchive.php

示例3: getDateLastN

 /**
  * @param $idSite
  * @param $period
  * @param $lastTimestampWebsiteProcessed
  * @return string
  */
 private function getDateLastN($idSite, $period, $lastTimestampWebsiteProcessed)
 {
     $dateLastMax = self::DEFAULT_DATE_LAST;
     if ($period == 'year') {
         $dateLastMax = self::DEFAULT_DATE_LAST_YEARS;
     } elseif ($period == 'week') {
         $dateLastMax = self::DEFAULT_DATE_LAST_WEEKS;
     }
     if (empty($lastTimestampWebsiteProcessed)) {
         $creationDateFor = \Piwik\Site::getCreationDateFor($idSite);
         $lastTimestampWebsiteProcessed = strtotime($creationDateFor);
     }
     // Enforcing last2 at minimum to work around timing issues and ensure we make most archives available
     $dateLast = floor((time() - $lastTimestampWebsiteProcessed) / 86400) + 2;
     if ($dateLast > $dateLastMax) {
         $dateLast = $dateLastMax;
     }
     if (!empty($this->dateLastForced)) {
         $dateLast = $this->dateLastForced;
     }
     return "last" . $dateLast;
 }
開發者ID:nuxwin,項目名稱:piwik,代碼行數:28,代碼來源:CronArchive.php

示例4: getApiDateLastParameter

 /**
  * @param $idSite
  * @param $period
  * @param $lastTimestampWebsiteProcessed
  * @return float|int|true
  */
 private function getApiDateLastParameter($idSite, $period, $lastTimestampWebsiteProcessed = false)
 {
     $dateLastMax = self::DEFAULT_DATE_LAST;
     if ($period == 'year') {
         $dateLastMax = self::DEFAULT_DATE_LAST_YEARS;
     } elseif ($period == 'week') {
         $dateLastMax = self::DEFAULT_DATE_LAST_WEEKS;
     }
     if (empty($lastTimestampWebsiteProcessed)) {
         $lastTimestampWebsiteProcessed = strtotime(\Piwik\Site::getCreationDateFor($idSite));
     }
     // Enforcing last2 at minimum to work around timing issues and ensure we make most archives available
     $dateLast = floor((time() - $lastTimestampWebsiteProcessed) / 86400) + 2;
     if ($dateLast > $dateLastMax) {
         $dateLast = $dateLastMax;
     }
     $dateLastForced = $this->getParameterFromCli('--force-date-last-n', true);
     if (!empty($dateLastForced)) {
         $dateLast = $dateLastForced;
         return $dateLast;
     }
     return $dateLast;
 }
開發者ID:carriercomm,項目名稱:piwik,代碼行數:29,代碼來源:CronArchive.php


注:本文中的Piwik\Site::getCreationDateFor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。