From 73afcad34c244f17706d686669a02abc1b709708 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Sep 2011 17:05:32 -0400 Subject: [PATCH] add hooks for upgrades --- EVENTS.txt | 4 ++++ scripts/upgrade.php | 30 +++++++++++++++++------------- 2 files changed, 21 insertions(+), 13 deletions(-) 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() -- 2.39.5