PHP Class Piwik\Updates

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

Méthodes publiques

Méthode Description
deletePluginFromConfigFile ( $pluginToDelete )
disableMaintenanceMode ( ) Helper method to disable maintenance mode after large updates.
doUpdate ( Updater $updater ) Perform the incremental version update.
enableMaintenanceMode ( ) Enables maintenance mode. Should be used for updates where Piwik will be unavailable for a large amount of time.
getMigrationQueries ( Updater $updater ) : array Return SQL to be executed in this update.
getMigrations ( Updater $updater ) : Migration[] Return migrations to be executed in this update.
getSql ( )
isMajorUpdate ( ) : boolean Tell the updater that this is a major update.
update ( )

Method Details

deletePluginFromConfigFile() public static méthode

public static deletePluginFromConfigFile ( $pluginToDelete )

disableMaintenanceMode() public static méthode

Helper method to disable maintenance mode after large updates.
public static disableMaintenanceMode ( )

doUpdate() public méthode

This method should preform all updating logic. If you define migrations in an overridden getMigrations() method, you must call {@link Updater::executeMigrations()} here. See {@link \Piwik\Plugins\ExamplePlugin\Updates\Updates_0_0_2} for an example.
public doUpdate ( Updater $updater )
$updater Updater

enableMaintenanceMode() public static méthode

Enables maintenance mode. Should be used for updates where Piwik will be unavailable for a large amount of time.
public static enableMaintenanceMode ( )

getMigrationQueries() public méthode

Return SQL to be executed in this update.
Deprecation: since Piwik 3.0.0, implement {@link getMigrations()} instead. Will be removed in Piwik 4.0.0
public getMigrationQueries ( Updater $updater ) : array
$updater Updater
Résultat array

getMigrations() public méthode

Migrations should be defined here, instead of in doUpdate(), since this method is used to display a preview of which migrations and database queries an update will run. If you execute migrations directly in doUpdate(), they won't be displayed to the user.
public getMigrations ( Updater $updater ) : Migration[]
$updater Updater
Résultat Piwik\Updater\Migration[]

getSql() public static méthode

Deprecation: since v2.12.0 use getMigrationQueries() instead. Will be removed in Piwik 4.0.0
public static getSql ( )

isMajorUpdate() public static méthode

Leads to a more visible notice. NOTE to release manager: Remember to mention in the Changelog that this update contains major DB upgrades and will take some time!
public static isMajorUpdate ( ) : boolean
Résultat boolean

update() public static méthode

Deprecation: since v2.12.0 use doUpdate() instead. Will be removed in Piwik 4.0.0
public static update ( )