PHP Class Piwik\SettingsPiwik

Afficher le fichier Open project: piwik/piwik Class Usage Examples

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
getPiwikInstanceId ( ) : string
rewritePathAppendPiwikInstanceId ( $pathToRewrite, $leadingPathToAppendHostnameTo ) : mixed

Method Details

checkPiwikServerWorking() public static méthode

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
Résultat boolean

getCurrentGitBranch() public static méthode

public static getCurrentGitBranch ( )

getKnownSegmentsToArchive() public static méthode

Returns every stored segment to pre-process for each site during cron archiving.
public static getKnownSegmentsToArchive ( ) : array
Résultat array The list of stored segments that apply to all sites.

getKnownSegmentsToArchiveForSite() public static méthode

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.
Résultat string[] The list of stored segments that apply to the requested site.

getPiwikInstanceId() protected static méthode

protected static getPiwikInstanceId ( ) : string
Résultat string or False if not set

getPiwikUrl() public static méthode

Returns the URL to this Piwik instance, eg. **http://demo.piwik.org/** or **http://example.org/piwik/**.
public static getPiwikUrl ( ) : string
Résultat string

getSalt() public static méthode

Get salt from [General] section
public static getSalt ( ) : string
Résultat string

getWebsitesCountToDisplay() public static méthode

Number of websites to show in the Website selector
public static getWebsitesCountToDisplay ( ) : integer
Résultat integer

isAutoUpdateEnabled() public static méthode

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
Résultat boolean

isAutoUpdatePossible() public static méthode

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
Résultat boolean

isGitDeployment() public static méthode

Returns true if Piwik is deployed using git FAQ: http://piwik.org/faq/how-to-install/faq_18271/
public static isGitDeployment ( ) : boolean
Résultat boolean

isHttpsForced() public static méthode

public static isHttpsForced ( ) : boolean
Résultat boolean

isMultiServerEnvironment() public static méthode

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
Résultat boolean

isPiwikInstalled() public static méthode

Return true if Piwik is installed (installation is done).
public static isPiwikInstalled ( ) : boolean
Résultat boolean

isSameFingerprintAcrossWebsites() public static méthode

Note: this config settig is also checked in the InterSites plugin
public static isSameFingerprintAcrossWebsites ( ) : boolean
Résultat boolean

isSegmentationEnabled() public static méthode

Returns true if segmentation is allowed for this user, false if otherwise.
public static isSegmentationEnabled ( ) : boolean
Résultat boolean

isUniqueVisitorsEnabled() public static méthode

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"`
Résultat boolean

isUserCredentialsSanityCheckEnabled() public static méthode

Should Piwik check that the login & password have minimum length and valid characters?
public static isUserCredentialsSanityCheckEnabled ( ) : boolean
Résultat boolean True if checks enabled; false otherwise

overwritePiwikUrl() public static méthode

public static overwritePiwikUrl ( $currentUrl )
$currentUrl

rewriteMiscUserPathWithInstanceId() public static méthode

If Piwik uses per-domain config file, make sure CustomLogo is unique
public static rewriteMiscUserPathWithInstanceId ( $path ) : mixed
$path
Résultat mixed

rewritePathAppendPiwikInstanceId() protected static méthode

protected static rewritePathAppendPiwikInstanceId ( $pathToRewrite, $leadingPathToAppendHostnameTo ) : mixed
$pathToRewrite
$leadingPathToAppendHostnameTo
Résultat mixed