From: Evan Prodromou Date: Thu, 15 Sep 2011 21:05:32 +0000 (-0400) Subject: add hooks for upgrades X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=73afcad34c244f17706d686669a02abc1b709708;p=quix0rs-gnu-social.git add hooks for upgrades --- diff --git a/EVENTS.txt b/EVENTS.txt index 0a9759c246..922b79a865 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -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 + diff --git a/scripts/upgrade.php b/scripts/upgrade.php index 4c793ac15e..1bf444267c 100644 --- a/scripts/upgrade.php +++ b/scripts/upgrade.php @@ -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()