UpdateCheck
extends PluginBase
in package
Plugin to check for extension updates after a super admin logs in.
Uses the ExtensionInstaller library.
Tags
Table of Contents
Properties
- $allowedPublicMethods : mixed
- $storage : string
- Where to save plugin settings etc.
Methods
- afterSuccessfulLogin() : void
- Checks if an extension update check is due after a super admin successfully logs in.
- beforeControllerAction() : void
- If we're in an admin controller and the flag is set, render the JavaScript that will Ajax the checkAll() URL and push a notification.
- beforePluginManagerMenuRender() : void
- checkAll() : void
- Used to check for available updates for all plugins.
- init() : void
- composeNotification() : void
- Compose messages and errors into a nice notification message. Extra annoying if $foundSecurityVersion is set to true.
- getCheckUrl() : string
- registerMyScript() : void
- spitOutUrl() : void
Properties
$allowedPublicMethods
public
mixed
$allowedPublicMethods
= array('checkAll')
Tags
$storage
Where to save plugin settings etc.
protected
string
$storage
= 'DbStorage'
Methods
afterSuccessfulLogin()
Checks if an extension update check is due after a super admin successfully logs in.
public
afterSuccessfulLogin() : void
This method is triggered after a successful user login. It verifies if the current user has super admin permissions. If so, it retrieves the timestamp of the last extension update check and compares it with the current date and time. If the next scheduled check date has passed or is today, a flag is set in the session to trigger an extension update check.
Tags
beforeControllerAction()
If we're in an admin controller and the flag is set, render the JavaScript that will Ajax the checkAll() URL and push a notification.
public
beforeControllerAction() : void
beforePluginManagerMenuRender()
public
beforePluginManagerMenuRender() : void
checkAll()
Used to check for available updates for all plugins.
public
checkAll() : void
This method should be run at super admin login, max once every day. Run by Ajax to avoid increased page load time. This method can also be run manually for testing.
init()
public
init() : void
composeNotification()
Compose messages and errors into a nice notification message. Extra annoying if $foundSecurityVersion is set to true.
protected
composeNotification(array<string|int, string> $messages, array<string|int, string> $errors, bool $foundSecurityVersion) : void
Parameters
- $messages : array<string|int, string>
- $errors : array<string|int, string>
- $foundSecurityVersion : bool
getCheckUrl()
protected
getCheckUrl() : string
Return values
stringregisterMyScript()
protected
registerMyScript() : void
spitOutUrl()
protected
spitOutUrl() : void