Some final fixes for deployment

Change-Id: Idfde86bba1966a8741f2f4a318c3745cc2e8e658
This commit is contained in:
Andrew Garrett 2012-08-02 12:50:46 -07:00
parent 72cae969ac
commit 5a955cc9d9
3 changed files with 10 additions and 5 deletions

View file

@ -147,6 +147,8 @@ $wgHooks['ArticleEditUpdateNewTalk'][] = 'EchoHooks::abortNewtalkNotification';
// Configuration // Configuration
$wgEchoDisableStandardEmail = true;
$wgEchoDefaultNotificationTypes = array( $wgEchoDefaultNotificationTypes = array(
'all' => array( 'all' => array(
'notify' => true, 'notify' => true,

View file

@ -243,7 +243,8 @@ class EchoHooks {
* @return true in all cases * @return true in all cases
*/ */
static function abortEmailNotification() { static function abortEmailNotification() {
return false; global $wgEchoDisableStandardEmail;
return ! $wgEchoDisableStandardEmail;
} }
public static function makeGlobalVariablesScript( &$vars, $outputPage ) { public static function makeGlobalVariablesScript( &$vars, $outputPage ) {

View file

@ -175,12 +175,14 @@ class EchoEvent {
* Loads data from the database into this object, given the event ID. * Loads data from the database into this object, given the event ID.
* @param $id Event ID * @param $id Event ID
*/ */
public function loadFromID($id) { public function loadFromID( $id, $fromMaster = false ) {
$dbr = wfGetDB( DB_SLAVE ); $db = wfGetDB( $fromMaster ? DB_MASTER : DB_SLAVE );
$row = $dbr->selectRow( 'echo_event', '*', array('event_id' => $id), __METHOD__ ); $row = $db->selectRow( 'echo_event', '*', array('event_id' => $id), __METHOD__ );
if ( ! $row ) { if ( ! $row && !$fromMaster ) {
$this->loadFromID( $id, true );
} elseif ( ! $row ) {
throw new MWException( "No EchoEvent found with ID: $id"); throw new MWException( "No EchoEvent found with ID: $id");
} }