]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
add hooks for upgrades
authorEvan Prodromou <evan@status.net>
Thu, 15 Sep 2011 21:05:32 +0000 (17:05 -0400)
committerEvan Prodromou <evan@status.net>
Thu, 15 Sep 2011 21:05:32 +0000 (17:05 -0400)
EVENTS.txt
scripts/upgrade.php

index 0a9759c246c45e71a1c126dca22be98b3c11224e..922b79a865ea24d0bb85ce7347f2717a68525883 100644 (file)
@@ -1418,3 +1418,7 @@ StartShowInvitationSuccess: Right before showing invitations success msg
 EndShowInvitationSuccess: After showing invitations success msg
 - $action: invitation action
 
+StartUpgrade: when starting a site upgrade
+
+EndUpgrade: when ending a site upgrade; good place to do your own upgrades
+
index 4c793ac15e43c34163dc81ede7db46bd3c608cd9..1bf444267cd54b7db7c5766c4792161c6ec1cacb 100644 (file)
@@ -33,23 +33,27 @@ require_once INSTALLDIR.'/scripts/commandline.inc';
 
 function main()
 {
-    updateSchemaCore();
-    updateSchemaPlugins();
+    if (Event::handle('StartUpgrade')) {
+        updateSchemaCore();
+        updateSchemaPlugins();
 
-    // These replace old "fixup_*" scripts
+        // These replace old "fixup_*" scripts
 
-    fixupNoticeRendered();
-    fixupNoticeConversation();
-    initConversation();
-    initInbox();
-    fixupGroupURI();
+        fixupNoticeRendered();
+        fixupNoticeConversation();
+        initConversation();
+        initInbox();
+        fixupGroupURI();
 
-    initLocalGroup();
-    initNoticeReshare();
+        initLocalGroup();
+        initNoticeReshare();
     
-    initFaveURI();
-    initSubscriptionURI();
-    initGroupMemberURI();
+        initFaveURI();
+        initSubscriptionURI();
+        initGroupMemberURI();
+
+        Event::handle('EndUpgrade');
+    }
 }
 
 function tableDefs()