PHP 클래스 Piwik\Plugins\API\API

Some of the information that is returned by the Metadata API:
  • the dynamically generated list of all API methods via "getReportMetadata"
  • the list of metrics that will be returned by each method, along with their human readable name, via "getDefaultMetrics" and "getDefaultProcessedMetrics"
  • the list of segments metadata supported by all functions that have a 'segment' parameter
  • the (truly magic) method "getProcessedReport" will return a human readable version of any other report, and include the processed metrics such as conversion rate, time on site, etc. which are not directly available in other methods.
  • the method "getSuggestedValuesForSegment" returns top suggested values for a particular segment. It uses the Live.getLastVisitsDetails API to fetch the most recently used values, and will return the most often used values first.
The Metadata API is for example used by the Piwik Mobile App to automatically display all Piwik reports, with translated report & columns names and nicely formatted values. More information on the Metadata API documentation page
상속: extends Piwik\Plugin\API
파일 보기 프로젝트 열기: piwik/piwik 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( SettingsProvider $settingsProvider, ProcessedReport $processedReport )
get ( $idSite, $period, $date, $segment = false, $columns = false ) Get a combined report of the *.get API methods.
getAvailableMeasurableTypes ( ) : array Returns all available measurable types.
getBulkRequest ( array $urls ) : array Performs multiple API requests at once and returns every result.
getDefaultMetricTranslations ( ) : array Default translations for many core metrics.
getGlossaryMetrics ( $idSite ) : array A glossary of all metrics and their definition
getGlossaryReports ( $idSite ) : array A glossary of all reports and their definition
getHeaderLogoUrl ( boolean $pathOnly = false ) : string Returns the url to header logo (~127x50px)
getIpFromHeader ( ) : string Returns the most accurate IP address available for the current user, in IPv4 format. This could be the proxy client's IP address.
getLogoUrl ( boolean $pathOnly = false ) : string Returns the url to application logo (~280x110px)
getMetadata ( $idSite, $apiModule, $apiAction, $apiParameters = [], $language = false, $period = false, $date = false, $hideMetricsDoc = false, $showSubtableReports = false ) Loads reports metadata, then return the requested one, matching optional API parameters.
getPiwikVersion ( ) : string Get Piwik version
getProcessedReport ( $idSite, $period, $date, $apiModule, $apiAction, $segment = false, $apiParameters = false, $idGoal = false, $language = false, $showTimer = true, $hideMetricsDoc = false, $idSubtable = false, $showRawMetrics = false, $format_metrics = null, $idDimension = false )
getReportMetadata ( string $idSites = '', boolean | string $period = false, boolean | Date $date = false, boolean $hideMetricsDoc = false, boolean $showSubtableReports = false, integer $idSite = false ) : array Triggers a hook to ask plugins for available Reports.
getReportPagesMetadata ( integer $idSite ) : array Get a list of all pages that shall be shown in a Piwik UI including a list of all widgets that shall be shown within each page.
getRowEvolution ( integer $idSite, string $period, Date $date, string $apiModule, string $apiAction, boolean | string $label = false, boolean | string $segment = false, boolean | string $column = false, boolean | string $language = false, boolean | integer $idGoal = false, boolean | string $legendAppendMetric = true, boolean | string $labelUseAbsoluteUrl = true, boolean | integer $idDimension = false ) : array Given an API report to query (eg. "Referrers.getKeywords", and a Label (eg. "free%20software"), this function will query the API for the previous days/weeks/etc. and will return a ready to use data structure containing the metrics for the requested Label, along with enriched information (min/max values, etc.)
getSVGLogoUrl ( boolean $pathOnly = false ) : string Returns the URL to application SVG Logo
getSegmentsMetadata ( $idSites = [], $_hideImplementationData = true )
getSettings ( ) : array Returns the section [APISettings] if defined in config.ini.php
getSuggestedValuesForSegment ( $segmentName, $idSite ) : array Given a segment, will return a list of the most used values for this particular segment.
getWidgetMetadata ( integer $idSite ) : array Get a list of all widgetizable widgets.
hasSVGLogo ( ) : boolean Returns whether there is an SVG Logo available.
isPluginActivated ( string $pluginName ) : boolean Return true if plugin is activated, false otherwise

보호된 메소드들

메소드 설명
doesSegmentNeedActionsData ( $segmentName ) : boolean
getSegmentValuesFromVisitorLog ( $segmentName, $table ) : array

비공개 메소드들

메소드 설명
doesSuggestedValuesCallbackNeedData ( $suggestedValuesCallback )
findSegment ( $segmentName, $idSite )
getMostFrequentValues ( $values ) : array
getSuggestedValuesForSegmentName ( $idSite, $segment, $maxSuggestionsToReturn )

메소드 상세

__construct() 공개 메소드

public __construct ( SettingsProvider $settingsProvider, ProcessedReport $processedReport )
$settingsProvider Piwik\Plugin\SettingsProvider
$processedReport ProcessedReport

doesSegmentNeedActionsData() 보호된 메소드

protected doesSegmentNeedActionsData ( $segmentName ) : boolean
$segmentName
리턴 boolean

get() 공개 메소드

Get a combined report of the *.get API methods.
public get ( $idSite, $period, $date, $segment = false, $columns = false )

getAvailableMeasurableTypes() 공개 메소드

Marked as deprecated so it won't appear in API page. It won't be a public API for now.
사용 중단:

getBulkRequest() 공개 메소드

Performs multiple API requests at once and returns every result.
public getBulkRequest ( array $urls ) : array
$urls array The array of API requests.
리턴 array

getDefaultMetricTranslations() 공개 메소드

This is used for exports with translated labels. The exports contain columns that are not visible in the UI and not present in the API meta data. These columns are translated here.
사용 중단: since Piwik 2.15.1

getGlossaryMetrics() 공개 메소드

A glossary of all metrics and their definition
public getGlossaryMetrics ( $idSite ) : array
$idSite
리턴 array

getGlossaryReports() 공개 메소드

A glossary of all reports and their definition
public getGlossaryReports ( $idSite ) : array
$idSite
리턴 array

getHeaderLogoUrl() 공개 메소드

Returns the url to header logo (~127x50px)
사용 중단: since Piwik 2.15.1
public getHeaderLogoUrl ( boolean $pathOnly = false ) : string
$pathOnly boolean If true, returns path relative to doc root. Otherwise, returns a URL.
리턴 string

getIpFromHeader() 공개 메소드

Returns the most accurate IP address available for the current user, in IPv4 format. This could be the proxy client's IP address.
public getIpFromHeader ( ) : string
리턴 string IP address in presentation format.

getLogoUrl() 공개 메소드

Returns the url to application logo (~280x110px)
사용 중단: since Piwik 2.15.1
public getLogoUrl ( boolean $pathOnly = false ) : string
$pathOnly boolean If true, returns path relative to doc root. Otherwise, returns a URL.
리턴 string

getMetadata() 공개 메소드

Loads reports metadata, then return the requested one, matching optional API parameters.
public getMetadata ( $idSite, $apiModule, $apiAction, $apiParameters = [], $language = false, $period = false, $date = false, $hideMetricsDoc = false, $showSubtableReports = false )

getPiwikVersion() 공개 메소드

Get Piwik version
public getPiwikVersion ( ) : string
리턴 string

getProcessedReport() 공개 메소드

public getProcessedReport ( $idSite, $period, $date, $apiModule, $apiAction, $segment = false, $apiParameters = false, $idGoal = false, $language = false, $showTimer = true, $hideMetricsDoc = false, $idSubtable = false, $showRawMetrics = false, $format_metrics = null, $idDimension = false )

getReportMetadata() 공개 메소드

Returns metadata information about each report (category, name, dimension, metrics, etc.)
public getReportMetadata ( string $idSites = '', boolean | string $period = false, boolean | Date $date = false, boolean $hideMetricsDoc = false, boolean $showSubtableReports = false, integer $idSite = false ) : array
$idSites string THIS PARAMETER IS DEPRECATED AND WILL BE REMOVED IN PIWIK 4
$period boolean | string
$date boolean | Piwik\Date
$hideMetricsDoc boolean
$showSubtableReports boolean
$idSite integer
리턴 array

getReportPagesMetadata() 공개 메소드

Get a list of all pages that shall be shown in a Piwik UI including a list of all widgets that shall be shown within each page.
public getReportPagesMetadata ( integer $idSite ) : array
$idSite integer
리턴 array

getRowEvolution() 공개 메소드

Given an API report to query (eg. "Referrers.getKeywords", and a Label (eg. "free%20software"), this function will query the API for the previous days/weeks/etc. and will return a ready to use data structure containing the metrics for the requested Label, along with enriched information (min/max values, etc.)
public getRowEvolution ( integer $idSite, string $period, Date $date, string $apiModule, string $apiAction, boolean | string $label = false, boolean | string $segment = false, boolean | string $column = false, boolean | string $language = false, boolean | integer $idGoal = false, boolean | string $legendAppendMetric = true, boolean | string $labelUseAbsoluteUrl = true, boolean | integer $idDimension = false ) : array
$idSite integer
$period string
$date Piwik\Date
$apiModule string
$apiAction string
$label boolean | string
$segment boolean | string
$column boolean | string
$language boolean | string
$idGoal boolean | integer
$legendAppendMetric boolean | string
$labelUseAbsoluteUrl boolean | string
$idDimension boolean | integer
리턴 array

getSVGLogoUrl() 공개 메소드

Returns the URL to application SVG Logo
public getSVGLogoUrl ( boolean $pathOnly = false ) : string
$pathOnly boolean If true, returns path relative to doc root. Otherwise, returns a URL.
리턴 string

getSegmentValuesFromVisitorLog() 보호된 메소드

protected getSegmentValuesFromVisitorLog ( $segmentName, $table ) : array
$segmentName
$table
리턴 array

getSegmentsMetadata() 공개 메소드

public getSegmentsMetadata ( $idSites = [], $_hideImplementationData = true )

getSettings() 공개 메소드

Returns the section [APISettings] if defined in config.ini.php
public getSettings ( ) : array
리턴 array

getSuggestedValuesForSegment() 공개 메소드

Given a segment, will return a list of the most used values for this particular segment.
public getSuggestedValuesForSegment ( $segmentName, $idSite ) : array
$segmentName
$idSite
리턴 array

getWidgetMetadata() 공개 메소드

Get a list of all widgetizable widgets.
public getWidgetMetadata ( integer $idSite ) : array
$idSite integer
리턴 array

isPluginActivated() 공개 메소드

Return true if plugin is activated, false otherwise
public isPluginActivated ( string $pluginName ) : boolean
$pluginName string
리턴 boolean