Свойство | Тип | Описание | |
---|---|---|---|
$isCliMode |
Метод | Описание | |
---|---|---|
convertUserIdToVisitorIdBin ( $userId ) : string | Converts a User ID string to the Visitor ID Binary representation. | |
convertVisitorIdToBin ( string $id ) : string | This function will convert the input string to the binary representation of the ID but it will throw an Exception if the specified input ID is not correct | |
destroy ( mixed &$var ) | Marks an orphaned object for garbage collection. | |
extractCountryCodeFromBrowserLanguage ( string $browserLanguage, array $validCountries, boolean $enableLanguageToCountryGuess ) : array | Returns list of valid country codes | |
extractLanguageAndRegionCodeFromBrowserLanguage ( string $browserLanguage, array $validLanguages = [] ) : string | Returns the language and region string, based only on the Browser 'accepted language' information. | |
extractLanguageCodeFromBrowserLanguage ( string $browserLanguage, array $validLanguages = [] ) : string | Returns the language and region string, based only on the Browser 'accepted language' information. | |
forceDotAsSeparatorForDecimalPoint ( float | string $value ) : string | Force the separator for decimal point to be a dot. See https://github.com/piwik/piwik/issues/6435 If for instance a German locale is used it would be a comma otherwise. | |
generateUniqId ( ) : string | Returns a 32 characters long uniq ID | |
getBrowserLanguage ( string | null $browserLang = null ) : string | Returns the browser language code, eg. "en-gb,en;q=0.5" | |
getCampaignParameters ( ) : array | Returns the list of Campaign parameter names that will be read to classify a visit as coming from a Campaign | |
getClassLineage ( string $class ) : string[] | Returns the list of parent classes for the given class. | |
getContinent ( string $country ) : string | Returns the continent of a given country | |
getContinentsList ( ) : array | Returns list of continent codes | |
getCountriesList ( boolean $includeInternalCodes = false ) : array | Returns list of valid country codes | |
getCountry ( string $lang, boolean $enableLanguageToCountryGuess, string $ip ) : string | Returns the visitor country based on the Browser 'accepted language' information, but provides a hook for geolocation via IP address. | |
getCurrentLocationProviderId ( ) | Returns the ID of the current LocationProvider (see UserCountry plugin code) from the Tracker cache. | |
getLanguageToCountryList ( ) : array | Returns a list of language to country mappings. | |
getLanguagesList ( ) : array | Returns the list of valid language codes. | |
getLastJsonError ( ) : string | Returns a human readable error message in case an error occcurred during the last json encode/decode. | |
getProviderNames ( ) : array | Returns list of provider names | |
getRandomString ( integer $length = 16, string $alphabet = "abcdefghijklmnoprstuvwxyz0123456789" ) : string | Generate random string. | |
getRequestVar ( string $varName, string | null $varDefault = null, string | null $varType = null, array | null $requestArrayToUse = null ) : mixed | Gets a sanitized request parameter by name from the $_GET and $_POST superglobals. | |
getSqlStringFieldsArray ( array | string $fields ) : string | Returns a string with a comma separated list of placeholders for use in an SQL query. Used mainly to fill the `IN (. | |
hasJsonErrorOccurred ( ) : boolean | Detects whether an error occurred during the last json encode/decode. | |
hash ( string $str, boolean $raw_output = false ) : string | Configurable hash() algorithm (defaults to md5) | |
hashStringToInt ( string $string ) : integer | Hashes a string into an integer which should be very low collision risks | |
hex2bin ( string $str ) : string | Convert hexadecimal representation into binary data. | |
isActionsPluginEnabled ( ) | ||
isGoalPluginEnabled ( ) | * Tracker | |
isPhpCgiType ( ) : boolean | Returns true if PHP is executed as CGI type. | |
isPhpCliMode ( ) : boolean | Returns true if PHP was invoked from command-line interface (shell) | |
isRunningConsoleCommand ( ) : boolean | Returns true if the current request is a console command, eg. | |
isXmlHttpRequest ( ) : boolean | Returns true if the request is an AJAX request. | |
json_decode ( string $json, boolean $assoc = false ) : mixed | JSON decode wrapper - missing or broken in some php 5.x versions | |
json_encode ( mixed $value ) : string | JSON encode wrapper - missing or broken in some php 5.x versions | |
mb_strlen ( string $string ) : integer | Multi-byte strlen() - works with UTF-8 | |
mb_strtolower ( string $string ) : string | Multi-byte strtolower() - works with UTF-8. | |
mb_substr ( string $string, integer $start ) : string | Multi-byte substr() - works with UTF-8. | |
prefixTable ( string $table ) : string | Returns a prefixed table name. | |
prefixTables ( ) : array | Returns an array containing the prefixed table names of every passed argument. | |
printDebug ( $info = '' ) | ||
sanitizeInputValue ( string $value ) : string | Sanitize a single input value and removes line breaks, tabs and null characters. | |
sanitizeInputValues ( mixed $value, boolean $alreadyStripslashed = false ) : mixed | Sanitizes a string to help avoid XSS vulnerabilities. | |
sanitizeLineBreaks ( string $value ) : string | ||
sanitizeNullBytes ( string $value ) : string | ||
sendHeader ( string $header, boolean $replace = true ) | Sets outgoing header. | |
sendResponseCode ( integer $code ) | Sends the given response code if supported. | |
stringEndsWith ( $haystack, $needle ) | ||
unprefixTable ( string $table ) : string | Removes the prefix from a table name and returns the result. | |
unsanitizeInputValue ( string $value ) : string | Unsanitizes a single input value and returns the result. | |
unsanitizeInputValues ( string | array $value ) : string | array | Unsanitizes one or more values and returns the result. |
Метод | Описание | |
---|---|---|
checkValidLanguagesIsSet ( $validLanguages ) : array |
Метод | Описание | |
---|---|---|
sanitizeString ( $value ) : string | Sanitize a single input value |
protected static checkValidLanguagesIsSet ( $validLanguages ) : array | ||
$validLanguages | ||
Результат | array |
public static convertUserIdToVisitorIdBin ( $userId ) : string | ||
$userId | ||
Результат | string |
public static convertVisitorIdToBin ( string $id ) : string | ||
$id | string | |
Результат | string | binary string |
public static extractCountryCodeFromBrowserLanguage ( string $browserLanguage, array $validCountries, boolean $enableLanguageToCountryGuess ) : array | ||
$browserLanguage | string | |
$validCountries | array | Array of valid countries |
$enableLanguageToCountryGuess | boolean | (if true, will guess country based on language that lacks region information) |
Результат | array | Array of 2 letter ISO codes |
public static extractLanguageAndRegionCodeFromBrowserLanguage ( string $browserLanguage, array $validLanguages = [] ) : string | ||
$browserLanguage | string | Browser's accepted langauge header |
$validLanguages | array | array of valid language codes. Note that if the array includes "fr" then it will consider all regional variants of this language valid, such as "fr-ca" etc. |
Результат | string | 2 letter ISO 639 code 'es' (Spanish) or if found, includes the region as well: 'es-ar' |
public static generateUniqId ( ) : string | ||
Результат | string | 32 chars |
public static getCampaignParameters ( ) : array | ||
Результат | array | array( 0 => array( ... ) // campaign names parameters 1 => array( ... ) // campaign keyword parameters ); |
public static getClassLineage ( string $class ) : string[] | ||
$class | string | A class name. |
Результат | string[] | The list of parent classes in order from highest ancestor to the descended class. |
public static getContinent ( string $country ) : string | ||
$country | string | 2 letters iso code |
Результат | string | Continent (3 letters code : afr, asi, eur, amn, ams, oce) |
public static getContinentsList ( ) : array | ||
Результат | array | Array of 3 letter continent codes |
public static getCountriesList ( boolean $includeInternalCodes = false ) : array | ||
$includeInternalCodes | boolean | |
Результат | array | Array of (2 letter ISO codes => 3 letter continent code) |
public static getCountry ( string $lang, boolean $enableLanguageToCountryGuess, string $ip ) : string | ||
$lang | string | browser lang |
$enableLanguageToCountryGuess | boolean | If set to true, some assumption will be made and detection guessed more often, but accuracy could be affected |
$ip | string | |
Результат | string | 2 letter ISO code |
public static getCurrentLocationProviderId ( ) |
public static getLanguageToCountryList ( ) : array | ||
Результат | array | Array of two letter ISO language codes mapped with two letter ISO country codes: `array('fr' => 'fr') // French => France` |
public static getLanguagesList ( ) : array | ||
Результат | array | Array of two letter ISO codes mapped with their associated language names (in English). E.g. `array('en' => 'English', 'ja' => 'Japanese')`. |
public static getLastJsonError ( ) : string | ||
Результат | string |
public static getProviderNames ( ) : array | ||
Результат | array | Array of ( dnsName => providerName ) |
public static getRequestVar ( string $varName, string | null $varDefault = null, string | null $varType = null, array | null $requestArrayToUse = null ) : mixed | ||
$varName | string | Name of the request parameter to get. By default, we look in `$_GET[$varName]` and `$_POST[$varName]` for the value. |
$varDefault | string | null | The value to return if the request parameter cannot be found or has an empty value. |
$varType | string | null | Expected type of the request variable. This parameters value must be one of the following: `'array'`, `'int'`, `'integer'`, `'string'`, `'json'`. If `'json'`, the string value will be `json_decode`-d and then sanitized. |
$requestArrayToUse | array | null | The array to use instead of `$_GET` and `$_POST`. |
Результат | mixed | The sanitized request parameter. |
public static getSqlStringFieldsArray ( array | string $fields ) : string | ||
$fields | array | string | The names of the mysql table fields to bind, e.g. `array(fieldName1, fieldName2, fieldName3)`. _Note: The content of the array isn't important, just its length._ |
Результат | string | The placeholder string, e.g. `"?, ?, ?"`. |
public static hasJsonErrorOccurred ( ) : boolean | ||
Результат | boolean |
public static hashStringToInt ( string $string ) : integer | ||
$string | string | String to hash |
Результат | integer | Resulting int hash |
public static isPhpCgiType ( ) : boolean | ||
Результат | boolean | true if PHP invoked as a CGI |
public static isPhpCliMode ( ) : boolean | ||
Результат | boolean | true if PHP invoked as a CGI or from CLI |
public static isRunningConsoleCommand ( ) : boolean | ||
Результат | boolean |
public static isXmlHttpRequest ( ) : boolean | ||
Результат | boolean |
public static json_encode ( mixed $value ) : string | ||
$value | mixed | |
Результат | string |
public static mb_strtolower ( string $string ) : string | ||
$string | string | |
Результат | string |
public static prefixTable ( string $table ) : string | ||
$table | string | The table name to prefix, ie "log_visit" |
Результат | string | The prefixed name, ie "piwik-production_log_visit". |
public static prefixTables ( ) : array | ||
Результат | array | The prefixed names in an array. |
public static sanitizeInputValue ( string $value ) : string | ||
$value | string | |
Результат | string | sanitized input |
public static sanitizeInputValues ( mixed $value, boolean $alreadyStripslashed = false ) : mixed | ||
$value | mixed | The variable to be sanitized. If an array is supplied, the contents of the array will be sanitized recursively. The keys of the array will also be sanitized. |
$alreadyStripslashed | boolean | Implementation detail, ignore. |
Результат | mixed | The sanitized value. |
public static sanitizeLineBreaks ( string $value ) : string | ||
$value | string | |
Результат | string | Line breaks and line carriage removed |
public static sanitizeNullBytes ( string $value ) : string | ||
$value | string | |
Результат | string | Null bytes removed |
public static sendHeader ( string $header, boolean $replace = true ) | ||
$header | string | The header. |
$replace | boolean | Whether to replace existing or not. |
public static sendResponseCode ( integer $code ) | ||
$code | integer | Eg 204 |
public static unprefixTable ( string $table ) : string | ||
$table | string | The prefixed table name, eg "piwik-production_log_visit". |
Результат | string | The unprefixed table name, eg "log_visit". |
public static unsanitizeInputValue ( string $value ) : string | ||
$value | string | |
Результат | string | unsanitized input |