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


PHP Piwik_Archive::build方法代码示例

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


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

示例1: getDataTable

 /** Get data table from archive
  * @return Piwik_DataTable */
 public static function getDataTable($name, $idsite, $period, $date, $numeric = false)
 {
     Piwik::checkUserHasViewAccess($idsite);
     if (is_array($name)) {
         foreach ($name as &$col) {
             $col = 'SiteSearch_' . $col;
         }
     } else {
         $name = 'SiteSearch_' . $name;
     }
     if (!is_string($period) && get_class($period) != 'Piwik_Period_Range') {
         $periodMap = array('Piwik_Period_Day' => 'day', 'Piwik_Period_Week' => 'week', 'Piwik_Period_Month' => 'month', 'Piwik_Period_Year' => 'year');
         $period = $periodMap[get_class($period)];
     }
     $archive = Piwik_Archive::build($idsite, $period, $date);
     if ($numeric) {
         // numeric archives are only used for search evolution
         $dataTable = $archive->getDataTableFromNumeric($name);
         $dataTable->queueFilter('ReplaceColumnNames', array(array('SiteSearch_totalSearches' => self::HITS, 'SiteSearch_visitsWithSearches' => self::UNIQUE_HITS)));
         $dataTable->applyQueuedFilters();
     } else {
         $dataTable = $archive->getDataTable($name);
     }
     return $dataTable;
 }
开发者ID:BeezyT,项目名称:piwik-sitesearch,代码行数:27,代码来源:Archive.php

示例2: get

 /**
  * Returns the list of metrics (pages, downloads, outlinks)
  * 
  * @param int $idSite
  * @param string $period
  * @param string $date
  * @param string $segment
  */
 public function get($idSite, $period, $date, $segment = false, $columns = false)
 {
     Piwik::checkUserHasViewAccess($idSite);
     $archive = Piwik_Archive::build($idSite, $period, $date, $segment);
     $metrics = array('Actions_nb_pageviews' => 'nb_pageviews', 'Actions_nb_uniq_pageviews' => 'nb_uniq_pageviews', 'Actions_nb_downloads' => 'nb_downloads', 'Actions_nb_uniq_downloads' => 'nb_uniq_downloads', 'Actions_nb_outlinks' => 'nb_outlinks', 'Actions_nb_uniq_outlinks' => 'nb_uniq_outlinks');
     // get requested columns
     $columns = Piwik::getArrayFromApiParameter($columns);
     if (!empty($columns)) {
         // get the columns that are available and requested
         $columns = array_intersect($columns, array_values($metrics));
         $columns = array_values($columns);
         // make sure indexes are right
         $nameReplace = array();
         foreach ($columns as $i => $column) {
             $fullColumn = array_search($column, $metrics);
             $columns[$i] = $fullColumn;
             $nameReplace[$fullColumn] = $column;
         }
     } else {
         // get all columns
         $columns = array_keys($metrics);
         $nameReplace =& $metrics;
     }
     $table = $archive->getDataTableFromNumeric($columns);
     // replace labels (remove Actions_)
     $table->filter('ReplaceColumnNames', array($nameReplace));
     return $table;
 }
开发者ID:0h546f6f78696342756e4e59,项目名称:piwik,代码行数:36,代码来源:API.php

示例3: getNumeric

 protected function getNumeric($idSite, $period, $date, $segment, $toFetch)
 {
     Piwik::checkUserHasViewAccess($idSite);
     $archive = Piwik_Archive::build($idSite, $period, $date, $segment);
     $dataTable = $archive->getNumeric($toFetch);
     return $dataTable;
 }
开发者ID:Gninety,项目名称:Microweber,代码行数:7,代码来源:API.php

示例4: __construct

 /**
  * @param array          $sites      array of siteIds
  * @param string         $strPeriod  eg. 'day' 'week' etc.
  * @param string         $strDate    A date range, eg. 'last10', 'previous5' or 'YYYY-MM-DD,YYYY-MM-DD'
  * @param Piwik_Segment  $segment
  * @param string         $_restrictSitesToLogin
  */
 function __construct($sites, $strPeriod, $strDate, Piwik_Segment $segment, $_restrictSitesToLogin)
 {
     foreach ($sites as $idSite) {
         $archive = Piwik_Archive::build($idSite, $strPeriod, $strDate, $segment, $_restrictSitesToLogin);
         $this->archives[$idSite] = $archive;
     }
     ksort($this->archives);
 }
开发者ID:nnnnathann,项目名称:piwik,代码行数:15,代码来源:IndexedBySite.php

示例5: getDataTable

 protected function getDataTable($name, $idSite, $period, $date, $segment, $column = Piwik_Archive::INDEX_NB_VISITS)
 {
     Piwik::checkUserHasViewAccess($idSite);
     $archive = Piwik_Archive::build($idSite, $period, $date, $segment);
     $dataTable = $archive->getDataTable($name);
     $dataTable->queueFilter('ReplaceColumnNames');
     return $dataTable;
 }
开发者ID:neolf,项目名称:PIWIK4MOBILE,代码行数:8,代码来源:API.php

示例6: getDataTable

 /** Get data table from archive
  * @return Piwik_DataTable */
 public static function getDataTable($name, $idsite, $period, $date)
 {
     Piwik::checkUserHasViewAccess($idsite);
     $name = 'SiteUsers_' . $name;
     $archive = Piwik_Archive::build($idsite, $period, $date);
     $dataTable = $archive->getDataTable($name);
     return $dataTable;
 }
开发者ID:BeezyT,项目名称:piwik-siteusers,代码行数:10,代码来源:Archive.php

示例7: getSearchPercentageEvolution

 /** Get evolution of search percentage
  * @return Piwik_DataTable */
 public function getSearchPercentageEvolution($idSite, $period, $date)
 {
     Piwik::checkUserHasViewAccess($idSite);
     $archive = Piwik_Archive::build($idSite, $period, $date);
     $dataTable = $archive->getDataTableFromNumeric(array('SiteSearch_visitsWithSearches', 'nb_visits'));
     $dataTable->filter('ColumnCallbackAddColumnQuotient', array('search_percentage', 'SiteSearch_visitsWithSearches', 'nb_visits', 4));
     $dataTable->filter('ColumnCallbackReplace', array('search_percentage', array($this, 'quotientToPercentageSafe')));
     return $dataTable;
 }
开发者ID:BeezyT,项目名称:piwik-sitesearch,代码行数:11,代码来源:API.php

示例8: __construct

 /**
  * @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($sites, $strPeriod, $strDate)
 {
     foreach ($sites as $idSite) {
         $archive = Piwik_Archive::build($idSite, $strPeriod, $strDate);
         $archive->setSite(new Piwik_Site($idSite));
         $archive->prepareArchive();
         $this->archives[$idSite] = $archive;
     }
     ksort($this->archives);
 }
开发者ID:Doluci,项目名称:tomatocart,代码行数:15,代码来源:IndexedBySite.php

示例9: __construct

 /**
  * @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($sites, $strPeriod, $strDate, Piwik_Segment $segment)
 {
     foreach ($sites as $idSite) {
         $archive = Piwik_Archive::build($idSite, $strPeriod, $strDate, $segment->getString());
         $archive->setSite(new Piwik_Site($idSite));
         $archive->setSegment($segment);
         $this->archives[$idSite] = $archive;
     }
     ksort($this->archives);
 }
开发者ID:Gninety,项目名称:Microweber,代码行数:15,代码来源:IndexedBySite.php

示例10: getDataTable

	protected function getDataTable($name, $idSite, $period, $date, $segment )
	{
		Piwik::checkUserHasViewAccess( $idSite );
		$archive = Piwik_Archive::build($idSite, $period, $date, $segment );
		$dataTable = $archive->getDataTable($name);
		$dataTable->filter('Sort', array('label', 'asc', true));
		$dataTable->queueFilter('ColumnCallbackReplace', array('label', 'Piwik_getTimeLabel'));
		$dataTable->queueFilter('ReplaceColumnNames');
		return $dataTable;
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:10,代码来源:API.php

示例11: getDataTable

 protected function getDataTable($name, $idSite, $period, $date)
 {
     Piwik::checkUserHasViewAccess($idSite);
     $archive = Piwik_Archive::build($idSite, $period, $date);
     $dataTable = $archive->getDataTable($name);
     $dataTable->filter('Sort', array(Piwik_Archive::INDEX_NB_VISITS));
     $dataTable->queueFilter('ReplaceColumnNames');
     $dataTable->queueFilter('Sort', array('label', 'asc', true));
     return $dataTable;
 }
开发者ID:klando,项目名称:pgpiwik,代码行数:10,代码来源:API.php

示例12: __construct

 /**
  * 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

示例13: getProvider

 public function getProvider($idSite, $period, $date)
 {
     Piwik::checkUserHasViewAccess($idSite);
     $archive = Piwik_Archive::build($idSite, $period, $date);
     $dataTable = $archive->getDataTable('Provider_hostnameExt');
     $dataTable->filter('Sort', array(Piwik_Archive::INDEX_NB_VISITS));
     $dataTable->queueFilter('ColumnCallbackAddMetadata', array('label', 'url', 'Piwik_getHostnameUrl'));
     $dataTable->queueFilter('ColumnCallbackReplace', array('label', 'Piwik_getHostnameName'));
     $dataTable->queueFilter('ReplaceColumnNames');
     return $dataTable;
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:11,代码来源:API.php

示例14: __construct

 /**
  * 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

示例15: testArchiveSinglePreFetchBlob

 /**
  * Test that Archive_Single::preFetchBlob won't fetch extra unnecessary blobs.
  * 
  * @group        Integration
  * @group        OneVisitorTwoVisits
  */
 public function testArchiveSinglePreFetchBlob()
 {
     $archive = Piwik_Archive::build(self::$idSite, 'day', self::$dateTime);
     $archive->preFetchBlob('Actions_actions');
     $cache = $archive->getBlobCache();
     $foundSubtable = false;
     $this->assertTrue(count($cache) > 0, "empty blob cache");
     foreach ($cache as $name => $value) {
         $this->assertTrue(strpos($name, "Actions_actions_url") === false, "found blob w/ name '{$name}'");
         if (strpos($name, "Actions_actions_") !== false) {
             $foundSubtable = true;
         }
     }
     $this->assertTrue($foundSubtable, "Actions_actions subtable was not loaded");
 }
开发者ID:nomoto-ubicast,项目名称:piwik,代码行数:21,代码来源:OneVisitorTwoVisitsTest.php


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