mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-23 23:44:53 +00:00
Some final fixes for deployment
Change-Id: Idfde86bba1966a8741f2f4a318c3745cc2e8e658
This commit is contained in:
parent
72cae969ac
commit
5a955cc9d9
2
Echo.php
2
Echo.php
|
@ -147,6 +147,8 @@ $wgHooks['ArticleEditUpdateNewTalk'][] = 'EchoHooks::abortNewtalkNotification';
|
||||||
|
|
||||||
// Configuration
|
// Configuration
|
||||||
|
|
||||||
|
$wgEchoDisableStandardEmail = true;
|
||||||
|
|
||||||
$wgEchoDefaultNotificationTypes = array(
|
$wgEchoDefaultNotificationTypes = array(
|
||||||
'all' => array(
|
'all' => array(
|
||||||
'notify' => true,
|
'notify' => true,
|
||||||
|
|
|
@ -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 ) {
|
||||||
|
|
|
@ -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");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue