mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-12 09:26:05 +00:00
Merge "Use ExtensionRegistry instead of class_exists"
This commit is contained in:
commit
aeb6e6cccb
|
@ -55,7 +55,7 @@ class EchoHooks {
|
|||
}
|
||||
|
||||
// turn schema off if eventLogging is not enabled
|
||||
if ( !class_exists( 'EventLogging' ) ) {
|
||||
if ( !ExtensionRegistry::getInstance()->isLoaded( 'EventLogging' ) ) {
|
||||
foreach ( $wgEchoEventLoggingSchemas as $schema => $property ) {
|
||||
if ( $property['enabled'] ) {
|
||||
$wgEchoEventLoggingSchemas[$schema]['enabled'] = false;
|
||||
|
|
|
@ -60,10 +60,6 @@ class GenerateSampleNotifications extends Maintenance {
|
|||
}
|
||||
|
||||
public function execute() {
|
||||
if ( !class_exists( 'EchoHooks' ) ) {
|
||||
$this->error( "Echo isn't enabled on this wiki\n", 1 );
|
||||
}
|
||||
|
||||
$user = $this->getOptionUser( 'user' );
|
||||
$agent = $this->getOptionUser( 'agent' );
|
||||
$otherUser = $this->getOptionUser( 'other' );
|
||||
|
@ -301,7 +297,7 @@ class GenerateSampleNotifications extends Maintenance {
|
|||
}
|
||||
|
||||
private function generateContentTranslation( User $user ) {
|
||||
if ( !class_exists( 'ContentTranslationHooks' ) ) {
|
||||
if ( !ExtensionRegistry::getInstance()->isLoaded( 'ContentTranslation' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -387,7 +383,7 @@ class GenerateSampleNotifications extends Maintenance {
|
|||
}
|
||||
|
||||
private function generateOneEditThanks( User $user, User $agent ) {
|
||||
if ( !class_exists( 'ThanksHooks' ) ) {
|
||||
if ( !ExtensionRegistry::getInstance()->isLoaded( 'Thanks' ) ) {
|
||||
return;
|
||||
}
|
||||
// make an edit, thank it once
|
||||
|
@ -406,7 +402,7 @@ class GenerateSampleNotifications extends Maintenance {
|
|||
$this->output( "{$agent->getName()} is thanking {$user->getName()} for edit {$revision->getId()} on {$title->getPrefixedText()}\n" );
|
||||
}
|
||||
private function generateMultipleEditThanks( User $user, User $agent, User $otherUser ) {
|
||||
if ( !class_exists( 'ThanksHooks' ) ) {
|
||||
if ( !ExtensionRegistry::getInstance()->isLoaded( 'Thanks' ) ) {
|
||||
return;
|
||||
}
|
||||
// make an edit, thank it twice
|
||||
|
|
|
@ -32,10 +32,6 @@ class ProcessEchoEmailBatch extends Maintenance {
|
|||
public function execute() {
|
||||
global $wgEchoCluster;
|
||||
|
||||
if ( !class_exists( 'EchoHooks' ) ) {
|
||||
$this->error( "Echo isn't enabled on this wiki\n", 1 );
|
||||
}
|
||||
|
||||
$ignoreConfiguredSchedule = $this->getOption( "ignoreConfiguredSchedule", 0 );
|
||||
|
||||
$this->output( "Started processing... \n" );
|
||||
|
|
|
@ -1795,7 +1795,7 @@ TEXT
|
|||
}
|
||||
|
||||
protected function isParserFunctionsInstalled() {
|
||||
if ( class_exists( 'ExtParserFunctions' ) ) {
|
||||
if ( ExtensionRegistry::getInstance()->isLoaded( 'ParserFunctions' ) ) {
|
||||
return true;
|
||||
} else {
|
||||
return "ParserFunctions not enabled";
|
||||
|
|
Loading…
Reference in a new issue