Index: trunk/extensions/ContributionTracking/ContributionTracking.php |
— | — | @@ -50,7 +50,7 @@ |
51 | 51 | |
52 | 52 | /** |
53 | 53 | * The default 'return to' URL for a thank you page after posting to the contribution |
54 | | - * |
| 54 | + * |
55 | 55 | * NO trailing slash, please |
56 | 56 | */ |
57 | 57 | $wgContributionTrackingReturnToURLDefault = 'http://wikimediafoundation.org/wiki/Thank_You'; |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | $wgContributionTrackingPayPalRecurringIPN = 'https://civicrm.wikimedia.org/fundcore_gateway/paypal'; |
73 | 73 | |
74 | 74 | /** |
75 | | - * 'Business' string for PayPal |
| 75 | + * 'Business' string for PayPal |
76 | 76 | */ |
77 | 77 | $wgContributionTrackingPayPalBusiness = 'donations@wikimedia.org'; |
78 | 78 | |
— | — | @@ -88,17 +88,30 @@ |
89 | 89 | // api modules |
90 | 90 | $wgAPIModules['contributiontracking'] = 'ApiContributionTracking'; |
91 | 91 | |
92 | | -function efContributionTrackingLoadUpdates(){ |
93 | | - global $wgExtNewTables, $wgExtNewFields; |
94 | | - $dir = dirname( __FILE__ ) . '/'; |
95 | | - $wgExtNewTables[] = array( 'contribution_tracking', $dir . 'ContributionTracking.sql' ); |
96 | | - $wgExtNewTables[] = array( 'contribution_tracking_owa_ref', $dir . 'ContributionTracking_OWA_ref.sql' ); |
97 | | - |
98 | | - $wgExtNewFields[] = array( |
99 | | - 'contribution_tracking', |
100 | | - 'owa_session', |
101 | | - $dir . 'patch-owa.sql', |
102 | | - ); |
103 | | - return true; |
104 | | - |
| 92 | +/** |
| 93 | + * @param $updater DatabaseUpdater |
| 94 | + * @return bool |
| 95 | + */ |
| 96 | +function efContributionTrackingLoadUpdates( $updater = null ){ |
| 97 | + |
| 98 | + $dir = dirname( __FILE__ ) . '/'; |
| 99 | + if ( $updater === null ) { |
| 100 | + global $wgExtNewTables, $wgExtNewFields; |
| 101 | + |
| 102 | + $wgExtNewTables[] = array( 'contribution_tracking', $dir . 'ContributionTracking.sql' ); |
| 103 | + $wgExtNewTables[] = array( 'contribution_tracking_owa_ref', $dir . 'ContributionTracking_OWA_ref.sql' ); |
| 104 | + |
| 105 | + $wgExtNewFields[] = array( |
| 106 | + 'contribution_tracking', |
| 107 | + 'owa_session', |
| 108 | + $dir . 'patch-owa.sql', |
| 109 | + ); |
| 110 | + } else { |
| 111 | + $updater->addExtensionTable( 'contribution_tracking', $dir . 'ContributionTracking.sql' ); |
| 112 | + $updater->addExtensionTable( 'contribution_tracking_owa_ref', $dir . 'ContributionTracking_OWA_ref.sql' ); |
| 113 | + $updater->addExtensionUpdate( array( 'addField', 'contribution_tracking', 'owa_session', |
| 114 | + $dir . 'patch-owa.sql', true ) ); |
| 115 | + } |
| 116 | + return true; |
| 117 | + |
105 | 118 | } |