PHP Class Piwik\Plugins\Marketplace\UpdateCommunication

Show file Open project: piwik/piwik Class Usage Examples

Public Methods

Method Description
__construct ( SystemSettings $settings )
canBeEnabled ( ) : boolean Checks whether a plugin update notification can be enabled or not. It cannot be enabled if for instance the Marketplace is disabled or if update notifications are disabled in general.
isEnabled ( ) : boolean Checks whether plugin update notification is enabled or not. If the marketplace is disabled or if update communication is disabled in general, it will return false as well.
sendNotificationIfUpdatesAvailable ( ) : boolean Sends an email to all super users if there is an update available for any plugins from the Marketplace.

Protected Methods

Method Description
buildNotificationMessage ( $pluginsToBeNotified, $hasThemeUpdate, $hasPluginUpdate )
getLatestVersion ( $plugin )
getLatestVersionSent ( $plugin )
getNotificationSentOptionName ( $plugin )
getPluginsHavingUpdate ( )
hasNotificationAlreadyReceived ( $plugin )
sendEmailNotification ( $subject, $message ) Send an email notification to all super users.
sendNotifications ( $pluginsToBeNotified )
setHasLatestUpdateNotificationReceived ( $plugin )

Method Details

__construct() public method

public __construct ( SystemSettings $settings )
$settings Piwik\Plugins\CoreUpdater\SystemSettings

buildNotificationMessage() protected method

protected buildNotificationMessage ( $pluginsToBeNotified, $hasThemeUpdate, $hasPluginUpdate )

canBeEnabled() public static method

Checks whether a plugin update notification can be enabled or not. It cannot be enabled if for instance the Marketplace is disabled or if update notifications are disabled in general.
public static canBeEnabled ( ) : boolean
return boolean

getLatestVersion() protected method

protected getLatestVersion ( $plugin )

getLatestVersionSent() protected method

protected getLatestVersionSent ( $plugin )

getNotificationSentOptionName() protected method

protected getNotificationSentOptionName ( $plugin )

getPluginsHavingUpdate() protected method

protected getPluginsHavingUpdate ( )

hasNotificationAlreadyReceived() protected method

protected hasNotificationAlreadyReceived ( $plugin )

isEnabled() public method

Checks whether plugin update notification is enabled or not. If the marketplace is disabled or if update communication is disabled in general, it will return false as well.
public isEnabled ( ) : boolean
return boolean

sendEmailNotification() protected method

Send an email notification to all super users.
protected sendEmailNotification ( $subject, $message )
$subject
$message

sendNotificationIfUpdatesAvailable() public method

For each update we send an email only once.

sendNotifications() protected method

protected sendNotifications ( $pluginsToBeNotified )

setHasLatestUpdateNotificationReceived() protected method