PHP Class Piwik\SettingsServer

Show file Open project: piwik/piwik Class Usage Examples

Public Methods

Method Description
getMemoryLimitValue ( ) : integer | boolean Get php memory_limit (in Megabytes)
isArchivePhpTriggered ( ) : boolean Returns true if the current script execution was triggered by the cron archiving script.
isGdExtensionEnabled ( ) : boolean Returns true if the GD PHP extension is available, false if otherwise.
isIIS ( ) : boolean Returns true if running on Microsoft IIS 7 (or above), false if otherwise.
isTimezoneSupportEnabled ( ) : boolean Returns true if this PHP version/build supports timezone manipulation (e.g., php >= 5.2, or compiled with **EXPERIMENTAL_DATE_SUPPORT=1** for php < 5.2).
isTrackerApiRequest ( ) : boolean Returns true if the current request is a Tracker request.
isWindows ( ) : boolean Returns true if running on a Windows operating system, false if otherwise.
raiseMemoryLimitIfNecessary ( ) : boolean Raise PHP memory limit if below the minimum required
setIsNotTrackerApiRequest ( ) Set the current request is not a tracker API request
setIsTrackerApiRequest ( ) Mark the current request as a Tracker API request
setMaxExecutionTime ( integer $executionTime ) Set maximum script execution time.

Protected Methods

Method Description
setMemoryLimit ( integer $minimumMemoryLimit ) : boolean Set PHP memory limit

Method Details

getMemoryLimitValue() public static method

Prior to PHP 5.2.1, or on Windows, --enable-memory-limit is not a compile-time default, so ini_get('memory_limit') may return false.
See also: http://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes
public static getMemoryLimitValue ( ) : integer | boolean
return integer | boolean memory limit in megabytes, or false if there is no limit

isArchivePhpTriggered() public static method

Helpful for error handling: directly throw error without HTML (eg. when DB is down).
public static isArchivePhpTriggered ( ) : boolean
return boolean

isGdExtensionEnabled() public static method

_Note: ImageGraph and the sparkline report visualization depend on the GD extension._
public static isGdExtensionEnabled ( ) : boolean
return boolean

isIIS() public static method

Returns true if running on Microsoft IIS 7 (or above), false if otherwise.
public static isIIS ( ) : boolean
return boolean

isTimezoneSupportEnabled() public static method

Returns true if this PHP version/build supports timezone manipulation (e.g., php >= 5.2, or compiled with **EXPERIMENTAL_DATE_SUPPORT=1** for php < 5.2).
public static isTimezoneSupportEnabled ( ) : boolean
return boolean

isTrackerApiRequest() public static method

Returns true if the current request is a Tracker request.
public static isTrackerApiRequest ( ) : boolean
return boolean true if the current request is a Tracking API Request (ie. piwik.php)

isWindows() public static method

Returns true if running on a Windows operating system, false if otherwise.
Since: 0.6.5
public static isWindows ( ) : boolean
return boolean

raiseMemoryLimitIfNecessary() public static method

Raise PHP memory limit if below the minimum required
public static raiseMemoryLimitIfNecessary ( ) : boolean
return boolean true if set; false otherwise

setIsNotTrackerApiRequest() public static method

Set the current request is not a tracker API request
public static setIsNotTrackerApiRequest ( )

setIsTrackerApiRequest() public static method

Mark the current request as a Tracker API request
public static setIsTrackerApiRequest ( )

setMaxExecutionTime() public static method

Set maximum script execution time.
public static setMaxExecutionTime ( integer $executionTime )
$executionTime integer max execution time in seconds (0 = no limit)

setMemoryLimit() protected static method

Note: system settings may prevent scripts from overriding the master value
protected static setMemoryLimit ( integer $minimumMemoryLimit ) : boolean
$minimumMemoryLimit integer
return boolean true if set; false otherwise