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


PHP Piwik_Site::getId方法代码示例

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


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

示例1: foreach

 /**
  * Builds an array of Piwik_Archive of a given date range
  *
  * @param Piwik_Site $oSite 
  * @param string $strPeriod eg. 'day' 'week' etc.
  * @param string $strDate A date range, eg. 'last10', 'previous5' or 'YYYY-MM-DD,YYYY-MM-DD'
  */
 function __construct(Piwik_Site $oSite, $strPeriod, $strDate, Piwik_Segment $segment)
 {
     $rangePeriod = new Piwik_Period_Range($strPeriod, $strDate, $oSite->getTimezone());
     foreach ($rangePeriod->getSubperiods() as $subPeriod) {
         $startDate = $subPeriod->getDateStart();
         $archive = Piwik_Archive::build($oSite->getId(), $strPeriod, $startDate, $segment->getString());
         $archive->setSegment($segment);
         $this->archives[] = $archive;
     }
 }
开发者ID:Gninety,项目名称:Microweber,代码行数:17,代码来源:IndexedByDate.php

示例2: foreach

 /**
  * Builds an array of Piwik_Archive of a given date range
  *
  * @param Piwik_Site $oSite 
  * @param string $strPeriod eg. 'day' 'week' etc.
  * @param string $strDate A date range, eg. 'last10', 'previous5' or 'YYYY-MM-DD,YYYY-MM-DD'
  */
 function __construct(Piwik_Site $oSite, $strPeriod, $strDate)
 {
     $rangePeriod = new Piwik_Period_Range($strPeriod, $strDate);
     foreach ($rangePeriod->getSubperiods() as $subPeriod) {
         $startDate = $subPeriod->getDateStart();
         $archive = Piwik_Archive::build($oSite->getId(), $strPeriod, $startDate);
         $archive->prepareArchive();
         $timestamp = $archive->getTimestampStartDate();
         $this->archives[$timestamp] = $archive;
     }
     ksort($this->archives);
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:19,代码来源:IndexedByDate.php

示例3: loadArchiveProperties

 /**
  * Inits the object
  */
 protected function loadArchiveProperties()
 {
     $this->idsite = $this->site->getId();
     $this->periodId = $this->period->getId();
     $this->dateStart = $this->period->getDateStart();
     $this->dateEnd = $this->period->getDateEnd();
     $this->tableArchiveNumeric = new Piwik_TablePartitioning_Monthly('archive_numeric');
     $this->tableArchiveNumeric->setIdSite($this->idsite);
     $this->tableArchiveNumeric->setTimestamp($this->dateStart->get());
     $this->tableArchiveBlob = new Piwik_TablePartitioning_Monthly('archive_blob');
     $this->tableArchiveBlob->setIdSite($this->idsite);
     $this->tableArchiveBlob->setTimestamp($this->dateStart->get());
     $this->strDateStart = $this->dateStart->toString();
     $this->strDateEnd = $this->dateEnd->toString();
     // if the current archive is a DAY and if it's today,
     // we set this maxTimestampArchive that defines the lifetime value of today's archive
     $this->maxTimestampArchive = 0;
     if ($this->period->getNumberOfSubperiods() == 0 && $this->period->toString() == date("Y-m-d")) {
         $this->maxTimestampArchive = time() - Zend_Registry::get('config')->General->time_before_today_archive_considered_outdated;
         $browserArchivingEnabled = Zend_Registry::get('config')->General->enable_browser_archiving_triggering;
         // see #1150; if new archives are not triggered from the browser,
         // we still want to try and return the latest archive available for today (rather than return nothing)
         if (!$browserArchivingEnabled) {
             $this->maxTimestampArchive = 0;
         }
     } else {
         if ($this->period->isFinished()) {
             $this->maxTimestampArchive = $this->period->getDateEnd()->setTime('00:00:00')->addDay(1)->getTimestamp();
         } else {
             $this->maxTimestampArchive = Piwik_Date::today()->getTimestamp();
         }
     }
     $db = Zend_Registry::get('db');
     $this->compressBlob = $db->hasBlobDataType();
 }
开发者ID:Doluci,项目名称:tomatocart,代码行数:38,代码来源:ArchiveProcessing.php

示例4: getIdSite

 /**
  * Returns the Id site associated with this archive
  *
  * @return int
  */
 public function getIdSite()
 {
     return $this->site->getId();
 }
开发者ID:neolf,项目名称:PIWIK4MOBILE,代码行数:9,代码来源:Archive.php

示例5: loadArchiveProperties

 /**
  * Inits the object
  * 
  * @return void
  */
 protected function loadArchiveProperties()
 {
     $this->idsite = $this->site->getId();
     $this->periodId = $this->period->getId();
     $this->dateStart = $this->period->getDateStart();
     $this->dateEnd = $this->period->getDateEnd();
     $this->tableArchiveNumeric = new Piwik_TablePartitioning_Monthly('archive_numeric');
     $this->tableArchiveNumeric->setIdSite($this->idsite);
     $this->tableArchiveNumeric->setTimestamp($this->dateStart->get());
     $this->tableArchiveBlob = new Piwik_TablePartitioning_Monthly('archive_blob');
     $this->tableArchiveBlob->setIdSite($this->idsite);
     $this->tableArchiveBlob->setTimestamp($this->dateStart->get());
     $this->strDateStart = $this->dateStart->toString();
     $this->strDateEnd = $this->dateEnd->toString();
     // if the current archive is a DAY and if it's today,
     // we set this maxTimestampArchive that defines the lifetime value of today's archive
     $this->maxTimestampArchive = 0;
     if ($this->period->getNumberOfSubperiods() == 0 && $this->period->toString() == date("Y-m-d")) {
         $this->maxTimestampArchive = time() - Zend_Registry::get('config')->General->time_before_today_archive_considered_outdated;
     } else {
         if ($this->period->isFinished()) {
             $this->maxTimestampArchive = $this->period->getDateEnd()->setTime('00:00:00')->addDay(1)->getTimestamp();
         } else {
             $this->maxTimestampArchive = Piwik_Date::today()->getTimestamp();
         }
     }
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:32,代码来源:ArchiveProcessing.php

示例6: init

 /**
  * Sets object attributes that will be used throughout the process
  */
 public function init()
 {
     $this->idsite = $this->site->getId();
     $this->periodId = $this->period->getId();
     $dateStartLocalTimezone = $this->period->getDateStart();
     $dateEndLocalTimezone = $this->period->getDateEnd();
     $this->tableArchiveNumeric = self::makeNumericArchiveTable($this->period);
     $this->tableArchiveBlob = self::makeBlobArchiveTable($this->period);
     $dateStartUTC = $dateStartLocalTimezone->setTimezone($this->site->getTimezone());
     $dateEndUTC = $dateEndLocalTimezone->setTimezone($this->site->getTimezone());
     $this->startDatetimeUTC = $dateStartUTC->getDateStartUTC();
     $this->endDatetimeUTC = $dateEndUTC->getDateEndUTC();
     $this->startTimestampUTC = $dateStartUTC->getTimestamp();
     $this->endTimestampUTC = strtotime($this->endDatetimeUTC);
     $this->minDatetimeArchiveProcessedUTC = $this->getMinTimeArchivedProcessed();
     $db = Zend_Registry::get('db');
     $this->compressBlob = $db->hasBlobDataType();
 }
开发者ID:0h546f6f78696342756e4e59,项目名称:piwik,代码行数:21,代码来源:ArchiveProcessing.php

示例7: loadArchiveProperties

	/**
	 * Inits the object
	 */
	protected function loadArchiveProperties()
	{		
		$this->idsite = $this->site->getId();
		
		$this->periodId = $this->period->getId();
		
		$this->dateStart = $this->period->getDateStart();
		$this->dateEnd = $this->period->getDateEnd();
		
		$this->tableArchiveNumeric = new Piwik_TablePartitioning_Monthly('archive_numeric');
		$this->tableArchiveNumeric->setIdSite($this->idsite);
		$this->tableArchiveNumeric->setTimestamp($this->dateStart->get());
		$this->tableArchiveBlob = new Piwik_TablePartitioning_Monthly('archive_blob');
		$this->tableArchiveBlob->setIdSite($this->idsite);	
		$this->tableArchiveBlob->setTimestamp($this->dateStart->get());

		$this->strDateStart = $this->dateStart->toString();
		$this->strDateEnd = $this->dateEnd->toString();
		
		// if the current archive is a DAY and if it's today,
		// we set this maxTimestampArchive that defines the lifetime value of today's archive
		$this->maxTimestampArchive = 0;
		if( $this->period->getNumberOfSubperiods() == 0
			&& $this->period->toString() == date("Y-m-d")
			)
		{
			$this->maxTimestampArchive = time() - Zend_Registry::get('config')->General->time_before_today_archive_considered_outdated;
		}
		// either
		// - if the period we're looking for is finished, we look for a ts_archived that 
		//   is greater than the last day of the archive 
		// - if the period we're looking for is not finished, we look for a recent enough archive
		//   recent enough means maxTimestampArchive = 00:00:01 this morning
		else
		{
			if($this->period->isFinished())
			{
				$this->maxTimestampArchive = $this->period->getDateEnd()->setTime('00:00:00')->addDay(1)->getTimestamp();
			}
			else
			{
				$this->maxTimestampArchive = Piwik_Date::today()->getTimestamp();
			}
		}

		$db = Zend_Registry::get('db');
		$this->compressBlob = $db->hasBlobDataType();
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:51,代码来源:ArchiveProcessing.php

示例8: init

	/**
	 * Sets object attributes that will be used throughout the process
	 */
	public function init()
	{
		$this->idsite = $this->site->getId();
		$this->periodId = $this->period->getId();

		$dateStartLocalTimezone = $this->period->getDateStart();
		$dateEndLocalTimezone = $this->period->getDateEnd();
		
		$this->tableArchiveNumeric = new Piwik_TablePartitioning_Monthly('archive_numeric');
		$this->tableArchiveNumeric->setIdSite($this->idsite);
		$this->tableArchiveNumeric->setTimestamp($dateStartLocalTimezone->getTimestamp());
		$this->tableArchiveBlob = new Piwik_TablePartitioning_Monthly('archive_blob');
		$this->tableArchiveBlob->setIdSite($this->idsite);	
		$this->tableArchiveBlob->setTimestamp($dateStartLocalTimezone->getTimestamp());

		$dateStartUTC = $dateStartLocalTimezone->setTimezone($this->site->getTimezone());
		$dateEndUTC = $dateEndLocalTimezone->setTimezone($this->site->getTimezone());
		$this->startDatetimeUTC = $dateStartUTC->getDateStartUTC();
		$this->endDatetimeUTC = $dateEndUTC->getDateEndUTC();
		$this->startTimestampUTC = $dateStartUTC->getTimestamp();
		$this->endTimestampUTC = strtotime($this->endDatetimeUTC);
		
		$this->minDatetimeArchiveProcessedUTC = $this->getMinTimeArchivedProcessed();
		$db = Zend_Registry::get('db');
		$this->compressBlob = $db->hasBlobDataType();
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:29,代码来源:ArchiveProcessing.php

示例9: initForLiveUsage

 /**
  * The archive processing classes have features that might be useful for live querying;
  * In particular, Piwik_ArchiveProcessing_Day::query*. In order to reuse those methods
  * outside the actual archiving or to reuse archiving code for live querying, an instance
  * of archive processing has to be faked.
  * 
  * For example, this code can be used in an API method:
  * $archiveProcessing = new Piwik_ArchiveProcessing_Day();
  * $archiveProcessing->setSite(new Piwik_Site($idSite));
  * $archiveProcessing->setPeriod(Piwik_Period::advancedFactory($period, $date));
  * $archiveProcessing->setSegment(new Piwik_Segment($segment, $idSite));
  * $archiveProcessing->initForLiveUsage(); 
  * Then, either use $archiveProcessing->query* or pass the instance to the archiving
  * code of the plugin. Note that even though we use Piwik_ArchiveProcessing_Day, this
  * works for any $period and $date that has been passed to the API.
  */
 public function initForLiveUsage()
 {
     $this->idsite = $this->site->getId();
     $this->initDates();
 }
开发者ID:nnnnathann,项目名称:piwik,代码行数:21,代码来源:ArchiveProcessing.php


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