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


PHP PageUrl::excludeQueryParametersFromUrl方法代码示例

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


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

示例1: renderSidebar

 /** Render the area left of the iframe */
 public function renderSidebar()
 {
     $idSite = Common::getRequestVar('idSite');
     $period = Common::getRequestVar('period');
     $date = Common::getRequestVar('date');
     $currentUrl = Common::getRequestVar('currentUrl');
     $currentUrl = Common::unsanitizeInputValue($currentUrl);
     $normalizedCurrentUrl = PageUrl::excludeQueryParametersFromUrl($currentUrl, $idSite);
     $normalizedCurrentUrl = Common::unsanitizeInputValue($normalizedCurrentUrl);
     // load the appropriate row of the page urls report using the label filter
     ArchivingHelper::reloadConfig();
     $path = ArchivingHelper::getActionExplodedNames($normalizedCurrentUrl, Action::TYPE_PAGE_URL);
     $path = array_map('urlencode', $path);
     $label = implode('>', $path);
     $request = new Request('method=Actions.getPageUrls' . '&idSite=' . urlencode($idSite) . '&date=' . urlencode($date) . '&period=' . urlencode($period) . '&label=' . urlencode($label) . '&format=original' . '&format_metrics=0');
     $dataTable = $request->process();
     $formatter = new Metrics\Formatter\Html();
     $data = array();
     if ($dataTable->getRowsCount() > 0) {
         $row = $dataTable->getFirstRow();
         $translations = Metrics::getDefaultMetricTranslations();
         $showMetrics = array('nb_hits', 'nb_visits', 'nb_users', 'nb_uniq_visitors', 'bounce_rate', 'exit_rate', 'avg_time_on_page');
         foreach ($showMetrics as $metric) {
             $value = $row->getColumn($metric);
             if ($value === false) {
                 // skip unique visitors for period != day
                 continue;
             }
             if ($metric == 'bounce_rate' || $metric == 'exit_rate') {
                 $value = $formatter->getPrettyPercentFromQuotient($value);
             } else {
                 if ($metric == 'avg_time_on_page') {
                     $value = $formatter->getPrettyTimeFromSeconds($value, $displayAsSentence = true);
                 }
             }
             $data[] = array('name' => $translations[$metric], 'value' => $value);
         }
     }
     // generate page url string
     foreach ($path as &$part) {
         $part = preg_replace(';^/;', '', urldecode($part));
     }
     $page = '/' . implode('/', $path);
     $page = preg_replace(';/index$;', '/', $page);
     if ($page == '/') {
         $page = '/index';
     }
     // render template
     $view = new View('@Overlay/renderSidebar');
     $view->data = $data;
     $view->location = $page;
     $view->normalizedUrl = $normalizedCurrentUrl;
     $view->label = $label;
     $view->idSite = $idSite;
     $view->period = $period;
     $view->date = $date;
     $this->outputCORSHeaders();
     return $view->render();
 }
开发者ID:bossrabbit,项目名称:piwik,代码行数:60,代码来源:Controller.php

示例2: getFollowingPages

 /**
  * Get following pages of a url.
  * This is done on the logs - not the archives!
  *
  * Note: if you use this method via the regular API, the number of results will be limited.
  * Make sure, you set filter_limit=-1 in the request.
  */
 public function getFollowingPages($url, $idSite, $period, $date, $segment = false)
 {
     $this->authenticate($idSite);
     $url = PageUrl::excludeQueryParametersFromUrl($url, $idSite);
     // we don't unsanitize $url here. it will be done in the Transitions plugin.
     $resultDataTable = new DataTable();
     try {
         $limitBeforeGrouping = Config::getInstance()->General['overlay_following_pages_limit'];
         $transitionsReport = APITransitions::getInstance()->getTransitionsForAction($url, $type = 'url', $idSite, $period, $date, $segment, $limitBeforeGrouping, $part = 'followingActions', $returnNormalizedUrls = true);
     } catch (Exception $e) {
         return $resultDataTable;
     }
     $reports = array('followingPages', 'outlinks', 'downloads');
     foreach ($reports as $reportName) {
         if (!isset($transitionsReport[$reportName])) {
             continue;
         }
         foreach ($transitionsReport[$reportName]->getRows() as $row) {
             // don't touch the row at all for performance reasons
             $resultDataTable->addRow($row);
         }
     }
     return $resultDataTable;
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:31,代码来源:API.php

示例3: getFilterPageDatatableSearch

 /**
  * Will search in the DataTable for a Label matching the searched string
  * and return only the matching row, or an empty datatable
  */
 protected function getFilterPageDatatableSearch($callBackParameters, $search, $actionType, $table = false, $searchTree = false)
 {
     if ($searchTree === false) {
         // build the query parts that are searched inside the tree
         if ($actionType == Action::TYPE_PAGE_TITLE) {
             $searchedString = Common::unsanitizeInputValue($search);
         } else {
             $idSite = $callBackParameters[1];
             try {
                 $searchedString = PageUrl::excludeQueryParametersFromUrl($search, $idSite);
             } catch (Exception $e) {
                 $searchedString = $search;
             }
         }
         ArchivingHelper::reloadConfig();
         $searchTree = ArchivingHelper::getActionExplodedNames($searchedString, $actionType);
     }
     if ($table === false) {
         // fetch the data table
         $table = call_user_func_array(array($this, 'getDataTableFromArchive'), $callBackParameters);
         if ($table instanceof DataTable\Map) {
             // search an array of tables, e.g. when using date=last30
             // note that if the root is an array, we filter all children
             // if an array occurs inside the nested table, we only look for the first match (see below)
             $dataTableMap = $table->getEmptyClone();
             foreach ($table->getDataTables() as $label => $subTable) {
                 $newSubTable = $this->doFilterPageDatatableSearch($callBackParameters, $subTable, $searchTree);
                 $dataTableMap->addTable($newSubTable, $label);
             }
             return $dataTableMap;
         }
     }
     return $this->doFilterPageDatatableSearch($callBackParameters, $table, $searchTree);
 }
开发者ID:a4tunado,项目名称:piwik,代码行数:38,代码来源:API.php

示例4: detectGoalId

 public function detectGoalId($idSite)
 {
     if (!Common::isGoalPluginEnabled()) {
         return false;
     }
     $goals = $this->getGoalDefinitions($idSite);
     if (!isset($goals[$this->idGoal])) {
         return false;
     }
     $goal = $goals[$this->idGoal];
     $url = $this->request->getParam('url');
     $goal['url'] = PageUrl::excludeQueryParametersFromUrl($url, $idSite);
     $this->convertedGoals[] = $goal;
     return true;
 }
开发者ID:huycao,项目名称:yodelivery,代码行数:15,代码来源:GoalManager.php

示例5: setActionUrl

 protected function setActionUrl($url)
 {
     $this->rawActionUrl = PageUrl::getUrlIfLookValid($url);
     $url = PageUrl::excludeQueryParametersFromUrl($url, $this->request->getIdSite());
     $this->actionUrl = PageUrl::getUrlIfLookValid($url);
     if ($url != $this->rawActionUrl) {
         Common::printDebug(' Before was "' . $this->rawActionUrl . '"');
         Common::printDebug(' After is "' . $url . '"');
     }
 }
开发者ID:diosmosis,项目名称:piwik,代码行数:10,代码来源:Action.php

示例6: detectGoalId

 public function detectGoalId($idSite, Request $request)
 {
     if (!Common::isGoalPluginEnabled()) {
         return null;
     }
     $idGoal = $request->getParam('idgoal');
     $goals = $this->getGoalDefinitions($idSite);
     if (!isset($goals[$idGoal])) {
         return null;
     }
     $goal = $goals[$idGoal];
     $url = $request->getParam('url');
     $goal['url'] = PageUrl::excludeQueryParametersFromUrl($url, $idSite);
     return $goal;
 }
开发者ID:annaduraig,项目名称:piwik,代码行数:15,代码来源:GoalManager.php

示例7: testExcludeQueryParametersSiteAndGlobalExcluded

 /**
  * Testing with some website specific and some global excluded query parameters
  * @group Core
  * @dataProvider getTestUrls
  */
 public function testExcludeQueryParametersSiteAndGlobalExcluded($url, $filteredUrl)
 {
     // testing also that query parameters are case insensitive
     $excludedQueryParameters = 'P2,var[value][date]';
     $excludedGlobalParameters = 'blabla, P4';
     $this->setUpRootAccess();
     $idSite = API::getInstance()->addSite("site1", array('http://example.org'), $ecommerce = 0, $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null, $excludedIps = '', $excludedQueryParameters, $timezone = null, $currency = null, $group = null, $startDate = null, $excludedUserAgents = null, $keepURLFragments = 1);
     API::getInstance()->setGlobalExcludedQueryParameters($excludedGlobalParameters);
     $this->assertEquals($filteredUrl[1], PageUrl::excludeQueryParametersFromUrl($url, $idSite));
 }
开发者ID:TensorWrenchOSS,项目名称:piwik,代码行数:15,代码来源:ActionTest.php


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