PHP Класс Piwik\SettingsPiwik

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

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

Метод Описание
checkPiwikServerWorking ( $piwikServerUrl, boolean $acceptInvalidSSLCertificates = false ) : boolean Returns true if the Piwik server appears to be working.
getCurrentGitBranch ( )
getKnownSegmentsToArchive ( ) : array Returns every stored segment to pre-process for each site during cron archiving.
getKnownSegmentsToArchiveForSite ( integer $idSite ) : string[] Returns the list of stored segments to pre-process for an individual site when executing cron archiving.
getPiwikUrl ( ) : string Returns the URL to this Piwik instance, eg. **http://demo.piwik.org/** or **http://example.org/piwik/**.
getSalt ( ) : string Get salt from [General] section
getWebsitesCountToDisplay ( ) : integer Number of websites to show in the Website selector
isAutoUpdateEnabled ( ) : boolean Detect whether user has enabled auto updates. Please note this config is a bit misleading. It is currently actually used for 2 things: To disable making any connections back to Piwik, and to actually disable the auto update of core and plugins.
isAutoUpdatePossible ( ) : boolean Detects whether an auto update can be made. An update is possible if the user is not on multiple servers and if automatic updates are actually enabled. If a user is running Piwik on multiple servers an update is not possible as it would be installed only on one server instead of all of them. Also if a user has disabled automatic updates we cannot perform any automatic updates.
isGitDeployment ( ) : boolean Returns true if Piwik is deployed using git FAQ: http://piwik.org/faq/how-to-install/faq_18271/
isHttpsForced ( ) : boolean
isMultiServerEnvironment ( ) : boolean Returns true if Piwik is running on more than one server. For example in a load balanced environment. In this case we should not make changes to the config and not install a plugin via the UI as it would be only executed on one server.
isPiwikInstalled ( ) : boolean Return true if Piwik is installed (installation is done).
isSameFingerprintAcrossWebsites ( ) : boolean Note: this config settig is also checked in the InterSites plugin
isSegmentationEnabled ( ) : boolean Returns true if segmentation is allowed for this user, false if otherwise.
isUniqueVisitorsEnabled ( string $periodLabel ) : boolean Returns true if unique visitors should be processed for the given period type.
isUserCredentialsSanityCheckEnabled ( ) : boolean Should Piwik check that the login & password have minimum length and valid characters?
overwritePiwikUrl ( $currentUrl )
rewriteMiscUserPathWithInstanceId ( $path ) : mixed If Piwik uses per-domain config file, make sure CustomLogo is unique

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

Метод Описание
getPiwikInstanceId ( ) : string
rewritePathAppendPiwikInstanceId ( $pathToRewrite, $leadingPathToAppendHostnameTo ) : mixed

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

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

If the Piwik server is in an error state (eg. some directories are not writable and Piwik displays error message), or if the Piwik server is "offline", this will return false..
public static checkPiwikServerWorking ( $piwikServerUrl, boolean $acceptInvalidSSLCertificates = false ) : boolean
$piwikServerUrl
$acceptInvalidSSLCertificates boolean
Результат boolean

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

public static getCurrentGitBranch ( )

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

Returns every stored segment to pre-process for each site during cron archiving.
public static getKnownSegmentsToArchive ( ) : array
Результат array The list of stored segments that apply to all sites.

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

Returns the list of stored segments to pre-process for an individual site when executing cron archiving.
public static getKnownSegmentsToArchiveForSite ( integer $idSite ) : string[]
$idSite integer The ID of the site to get stored segments for.
Результат string[] The list of stored segments that apply to the requested site.

getPiwikInstanceId() защищенный статический Метод

protected static getPiwikInstanceId ( ) : string
Результат string or False if not set

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

Returns the URL to this Piwik instance, eg. **http://demo.piwik.org/** or **http://example.org/piwik/**.
public static getPiwikUrl ( ) : string
Результат string

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

Get salt from [General] section
public static getSalt ( ) : string
Результат string

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

Number of websites to show in the Website selector
public static getWebsitesCountToDisplay ( ) : integer
Результат integer

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

Detect whether user has enabled auto updates. Please note this config is a bit misleading. It is currently actually used for 2 things: To disable making any connections back to Piwik, and to actually disable the auto update of core and plugins.
public static isAutoUpdateEnabled ( ) : boolean
Результат boolean

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

Detects whether an auto update can be made. An update is possible if the user is not on multiple servers and if automatic updates are actually enabled. If a user is running Piwik on multiple servers an update is not possible as it would be installed only on one server instead of all of them. Also if a user has disabled automatic updates we cannot perform any automatic updates.
public static isAutoUpdatePossible ( ) : boolean
Результат boolean

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

Returns true if Piwik is deployed using git FAQ: http://piwik.org/faq/how-to-install/faq_18271/
public static isGitDeployment ( ) : boolean
Результат boolean

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

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

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

Returns true if Piwik is running on more than one server. For example in a load balanced environment. In this case we should not make changes to the config and not install a plugin via the UI as it would be only executed on one server.
public static isMultiServerEnvironment ( ) : boolean
Результат boolean

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

Return true if Piwik is installed (installation is done).
public static isPiwikInstalled ( ) : boolean
Результат boolean

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

Note: this config settig is also checked in the InterSites plugin
public static isSameFingerprintAcrossWebsites ( ) : boolean
Результат boolean

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

Returns true if segmentation is allowed for this user, false if otherwise.
public static isSegmentationEnabled ( ) : boolean
Результат boolean

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

Unique visitor processing is controlled by the [General] enable_processing_unique_visitors_... INI config options. By default, unique visitors are processed only for day/week/month periods.
public static isUniqueVisitorsEnabled ( string $periodLabel ) : boolean
$periodLabel string `"day"`, `"week"`, `"month"`, `"year"` or `"range"`
Результат boolean

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

Should Piwik check that the login & password have minimum length and valid characters?
public static isUserCredentialsSanityCheckEnabled ( ) : boolean
Результат boolean True if checks enabled; false otherwise

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

public static overwritePiwikUrl ( $currentUrl )
$currentUrl

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

If Piwik uses per-domain config file, make sure CustomLogo is unique
public static rewriteMiscUserPathWithInstanceId ( $path ) : mixed
$path
Результат mixed

rewritePathAppendPiwikInstanceId() защищенный статический Метод

protected static rewritePathAppendPiwikInstanceId ( $pathToRewrite, $leadingPathToAppendHostnameTo ) : mixed
$pathToRewrite
$leadingPathToAppendHostnameTo
Результат mixed