Index: trunk/phase3/maintenance/update.php |
— | — | @@ -9,7 +9,6 @@ |
10 | 10 | * @ingroup Maintenance |
11 | 11 | */ |
12 | 12 | |
13 | | -define( 'MW_CMDLINE_CALLBACK', 'wfSetupUpdateScript' ); |
14 | 13 | $wgUseMasterForMaintenance = true; |
15 | 14 | require_once( 'Maintenance.php' ); |
16 | 15 | |
— | — | @@ -76,20 +75,20 @@ |
77 | 76 | |
78 | 77 | $this->output( "Done.\n" ); |
79 | 78 | } |
80 | | -} |
81 | 79 | |
82 | | -function wfSetupUpdateScript() { |
83 | | - global $wgLocalisationCacheConf; |
| 80 | + protected function afterFinalSetup() { |
| 81 | + global $wgLocalisationCacheConf; |
84 | 82 | |
85 | | - # Don't try to access the database |
86 | | - # This needs to be disabled early since extensions will try to use the l10n |
87 | | - # cache from $wgExtensionSetupFunctions (bug 20471) |
88 | | - $wgLocalisationCacheConf = array( |
89 | | - 'class' => 'LocalisationCache', |
90 | | - 'storeClass' => 'LCStore_Null', |
91 | | - 'storeDirectory' => false, |
92 | | - 'manualRecache' => false, |
93 | | - ); |
| 83 | + # Don't try to access the database |
| 84 | + # This needs to be disabled early since extensions will try to use the l10n |
| 85 | + # cache from $wgExtensionSetupFunctions (bug 20471) |
| 86 | + $wgLocalisationCacheConf = array( |
| 87 | + 'class' => 'LocalisationCache', |
| 88 | + 'storeClass' => 'LCStore_Null', |
| 89 | + 'storeDirectory' => false, |
| 90 | + 'manualRecache' => false, |
| 91 | + ); |
| 92 | + } |
94 | 93 | } |
95 | 94 | |
96 | 95 | $maintClass = 'UpdateMediaWiki'; |
Index: trunk/phase3/maintenance/Maintenance.php |
— | — | @@ -694,12 +694,10 @@ |
695 | 695 | $wgLBFactoryConf['serverTemplate']['user'] = $wgDBuser; |
696 | 696 | $wgLBFactoryConf['serverTemplate']['password'] = $wgDBpassword; |
697 | 697 | } |
| 698 | + LBFactory::destroyInstance(); |
698 | 699 | } |
699 | 700 | |
700 | | - if ( defined( 'MW_CMDLINE_CALLBACK' ) ) { |
701 | | - $fn = MW_CMDLINE_CALLBACK; |
702 | | - $fn(); |
703 | | - } |
| 701 | + $this->afterFinalSetup(); |
704 | 702 | |
705 | 703 | $wgShowSQLErrors = true; |
706 | 704 | @set_time_limit( 0 ); |
— | — | @@ -709,6 +707,15 @@ |
710 | 708 | } |
711 | 709 | |
712 | 710 | /** |
| 711 | + * Execute a callback function at the end of initialisation |
| 712 | + */ |
| 713 | + protected function afterFinalSetup() { |
| 714 | + if ( defined( 'MW_CMDLINE_CALLBACK' ) ) { |
| 715 | + call_user_func( MW_CMDLINE_CALLBACK ); |
| 716 | + } |
| 717 | + } |
| 718 | + |
| 719 | + /** |
713 | 720 | * Potentially debug globals. Originally a feature only |
714 | 721 | * for refreshLinks |
715 | 722 | */ |