Merge "Use ExtensionRegistry instead of class_exists"

This commit is contained in:
jenkins-bot 2017-12-28 23:48:47 +00:00 committed by Gerrit Code Review
commit aeb6e6cccb
4 changed files with 5 additions and 13 deletions

View file

@ -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;

View file

@ -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

View file

@ -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" );

View file

@ -1795,7 +1795,7 @@ TEXT
}
protected function isParserFunctionsInstalled() {
if ( class_exists( 'ExtParserFunctions' ) ) {
if ( ExtensionRegistry::getInstance()->isLoaded( 'ParserFunctions' ) ) {
return true;
} else {
return "ParserFunctions not enabled";