PHP Класс Piwik\Tracker\Request

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$isAuthenticated
$params array
$rawParams
$tokenAuth

Открытые методы

Метод Описание
__construct ( $params, boolean | string $tokenAuth = false )
authenticateSuperUserOrAdmin ( $tokenAuth, $idSite )
getBrowserLanguage ( ) : string Returns the language the visitor is viewing.
getCurrentTimestamp ( )
getCustomVariables ( $scope )
getCustomVariablesInPageScope ( )
getCustomVariablesInVisitScope ( )
getDaysSinceFirstVisit ( ) : float | integer
getDaysSinceLastOrder ( ) : boolean | float | integer
getDaysSinceLastVisit ( ) : float | integer
getForcedUserId ( )
getForcedVisitorId ( )
getGoalRevenue ( $defaultGoalRevenue )
getIdSite ( )
getIp ( )
getIpString ( ) : mixed | string
getLocalTime ( ) : string
getMetadata ( string $pluginName, string $key ) : mixed Get a request metadata value. Returns null if none exists.
getPageGenerationTime ( ) 1 hour
getParam ( $name )
getParams ( )
getPlugins ( )
getRawParams ( ) : array Get the params that were originally passed to the instance. These params do not contain any params that were added within this object.
getTokenAuth ( )
getUserAgent ( )
getUserIdHashed ( $userId ) : string Matches implementation of PiwikTracker::getUserIdHashed
getVisitCount ( ) : integer | mixed
getVisitorId ( ) Returns the ID from the request in this order: return from a given User ID, or from a Tracking API forced Visitor ID, or from a Visitor ID from 3rd party (optional) cookies, or from a given Visitor Id from 1st party?
isAuthenticated ( ) : boolean
isEmptyRequest ( )
setCurrentTimestamp ( $timestamp )
setMetadata ( string $pluginName, string $key, mixed $value ) Set a request metadata value.
setParam ( $name, $value )
setThirdPartyCookie ( $idVisitor ) Update the cookie information.
truncateCustomVariable ( $input )

Защищенные методы

Метод Описание
authenticateTrackingApi ( $tokenAuth ) This method allows to set custom IP + server time + visitor ID, when using Tracking API.
getCookieExpire ( )
getCookieName ( )
getCookiePath ( )
getCurrentDate ( string $format = "Y-m-d" ) : string Returns the current date in the "Y-m-d" PHP format
getCustomTimestamp ( )
isTimestampValid ( $time, $now = null ) : boolean Returns true if the timestamp is valid ie. timestamp is sometime in the last 10 years and is not in the future.
makeThirdPartyCookieUID ( )
shouldUseThirdPartyCookie ( )

Приватные методы

Метод Описание
hasParam ( $name )
truncateIdAsVisitorId ( $idVisitor ) : string

Описание методов

__construct() публичный Метод

public __construct ( $params, boolean | string $tokenAuth = false )
$params
$tokenAuth boolean | string

authenticateSuperUserOrAdmin() публичный статический Метод

public static authenticateSuperUserOrAdmin ( $tokenAuth, $idSite )

authenticateTrackingApi() защищенный Метод

These two attributes can be only set by the Super User (passing token_auth).
protected authenticateTrackingApi ( $tokenAuth )

getBrowserLanguage() публичный Метод

Returns the language the visitor is viewing.
public getBrowserLanguage ( ) : string
Результат string browser language code, eg. "en-gb,en;q=0.5"

getCookieExpire() защищенный Метод

protected getCookieExpire ( )

getCookieName() защищенный Метод

protected getCookieName ( )

getCookiePath() защищенный Метод

protected getCookiePath ( )

getCurrentDate() защищенный Метод

Returns the current date in the "Y-m-d" PHP format
protected getCurrentDate ( string $format = "Y-m-d" ) : string
$format string
Результат string

getCurrentTimestamp() публичный Метод

public getCurrentTimestamp ( )

getCustomTimestamp() защищенный Метод

protected getCustomTimestamp ( )

getCustomVariables() публичный Метод

Устаревший: since Piwik 2.10.0. Use Request::getCustomVariablesInPageScope() or Request::getCustomVariablesInVisitScope() instead. When we "remove" this method we will only set visibility to "private" and pass $parameter = _cvar|cvar as an argument instead of $scope
public getCustomVariables ( $scope )

getCustomVariablesInPageScope() публичный Метод

getCustomVariablesInVisitScope() публичный Метод

getDaysSinceFirstVisit() публичный Метод

public getDaysSinceFirstVisit ( ) : float | integer
Результат float | integer

getDaysSinceLastOrder() публичный Метод

public getDaysSinceLastOrder ( ) : boolean | float | integer
Результат boolean | float | integer

getDaysSinceLastVisit() публичный Метод

public getDaysSinceLastVisit ( ) : float | integer
Результат float | integer

getForcedUserId() публичный Метод

public getForcedUserId ( )

getForcedVisitorId() публичный Метод

public getForcedVisitorId ( )

getGoalRevenue() публичный Метод

public getGoalRevenue ( $defaultGoalRevenue )

getIdSite() публичный Метод

public getIdSite ( )

getIp() публичный Метод

public getIp ( )

getIpString() публичный Метод

public getIpString ( ) : mixed | string
Результат mixed | string

getLocalTime() публичный Метод

public getLocalTime ( ) : string
Результат string

getMetadata() публичный Метод

Get a request metadata value. Returns null if none exists.
public getMetadata ( string $pluginName, string $key ) : mixed
$pluginName string eg, `'Actions'`, `'Goals'`, `'YourPlugin'`
$key string
Результат mixed

getPageGenerationTime() публичный Метод

1 hour

getParam() публичный Метод

public getParam ( $name )

getParams() публичный Метод

public getParams ( )

getPlugins() публичный Метод

public getPlugins ( )

getRawParams() публичный Метод

Get the params that were originally passed to the instance. These params do not contain any params that were added within this object.
public getRawParams ( ) : array
Результат array

getTokenAuth() публичный Метод

public getTokenAuth ( )

getUserAgent() публичный Метод

public getUserAgent ( )

getUserIdHashed() публичный Метод

Matches implementation of PiwikTracker::getUserIdHashed
public getUserIdHashed ( $userId ) : string
$userId
Результат string

getVisitCount() публичный Метод

public getVisitCount ( ) : integer | mixed
Результат integer | mixed

getVisitorId() публичный Метод

Returns the ID from the request in this order: return from a given User ID, or from a Tracking API forced Visitor ID, or from a Visitor ID from 3rd party (optional) cookies, or from a given Visitor Id from 1st party?
public getVisitorId ( )

isAuthenticated() публичный Метод

public isAuthenticated ( ) : boolean
Результат boolean

isEmptyRequest() публичный Метод

public isEmptyRequest ( )

isTimestampValid() защищенный Метод

Returns true if the timestamp is valid ie. timestamp is sometime in the last 10 years and is not in the future.
protected isTimestampValid ( $time, $now = null ) : boolean
$time int Timestamp to test
$now int Current timestamp
Результат boolean

makeThirdPartyCookieUID() защищенный Метод

protected makeThirdPartyCookieUID ( )

setCurrentTimestamp() публичный Метод

public setCurrentTimestamp ( $timestamp )

setMetadata() публичный Метод

Set a request metadata value.
public setMetadata ( string $pluginName, string $key, mixed $value )
$pluginName string eg, `'Actions'`, `'Goals'`, `'YourPlugin'`
$key string
$value mixed

setParam() публичный Метод

public setParam ( $name, $value )

setThirdPartyCookie() публичный Метод

Update the cookie information.
public setThirdPartyCookie ( $idVisitor )

shouldUseThirdPartyCookie() защищенный Метод

truncateCustomVariable() публичный статический Метод

public static truncateCustomVariable ( $input )

Описание свойств

$isAuthenticated защищенное свойство

protected $isAuthenticated

$params защищенное свойство

protected array $params
Результат array

$rawParams защищенное свойство

protected $rawParams

$tokenAuth защищенное свойство

protected $tokenAuth