diff options
author | BeezyT <timo@ezdesign.de> | 2012-08-16 17:59:26 +0400 |
---|---|---|
committer | BeezyT <timo@ezdesign.de> | 2012-08-16 17:59:26 +0400 |
commit | 2dfe749fce7c817aaa0a9ebd30bf5282a372d84c (patch) | |
tree | d345c7824c4a0cf2e45babd68dc24b5a007b0cc5 /core/Updates.php | |
parent | 4de9cfa37f2d56deb18843f35db2b1cee471afd9 (diff) |
refs #2976 updates can be marked a major
git-svn-id: http://dev.piwik.org/svn/trunk@6790 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/Updates.php')
-rw-r--r-- | core/Updates.php | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/core/Updates.php b/core/Updates.php index f932227ad9..e53a1d5bbc 100644 --- a/core/Updates.php +++ b/core/Updates.php @@ -39,4 +39,51 @@ abstract class Piwik_Updates static function update() { } + + /** + * Tell the updater that this is a major update. + * Leads to a more visible notice. + */ + static function isMajorUpdate() + { + return false; + } + + /** + * Helper method to enable maintenance mode during large updates + */ + static function enableMaintenanceMode() + { + $config = Piwik_Config::getInstance(); + $config->init(); + + $tracker = $config->Tracker; + $tracker['record_statistics'] = 0; + $config->Tracker = $tracker; + + $general = $config->General; + $general['maintenance_mode'] = 1; + $config->General = $general; + + $config->forceSave(); + } + + /** + * Helper method to disable maintenance mode after large updates + */ + static function disableMaintenanceMode() + { + $config = Piwik_Config::getInstance(); + $config->init(); + + $tracker = $config->Tracker; + $tracker['record_statistics'] = 1; + $config->Tracker = $tracker; + + $general = $config->General; + $general['maintenance_mode'] = 0; + $config->General = $general; + + $config->forceSave(); + } } |