diff --git a/includes/Query.php b/includes/Query.php index cb6acc6a..2eea8350 100644 --- a/includes/Query.php +++ b/includes/Query.php @@ -5,6 +5,7 @@ use DateInterval; use DateTime; use Exception; +use ExtensionRegistry; use MediaWiki\MediaWikiServices; use MediaWiki\User\UserFactory; use MWException; @@ -886,7 +887,7 @@ private function _addlasteditor( $option ) { * @param mixed $option */ private function _addpagecounter( $option ) { - if ( class_exists( '\\HitCounters\\Hooks' ) ) { + if ( ExtensionRegistry::getInstance()->isLoaded( 'HitCounters' ) ) { $this->addTable( 'hit_counter', 'hit_counter' ); $this->addSelect( [ @@ -1781,7 +1782,7 @@ private function _ordermethod( $option ) { $this->addOrderBy( 'cl1.cl_timestamp' ); break; case 'counter': - if ( class_exists( '\\HitCounters\\Hooks' ) ) { + if ( ExtensionRegistry::getInstance()->isLoaded( 'HitCounters' ) ) { // If the "addpagecounter" parameter was not used the table and join need to be added now. if ( !array_key_exists( 'hit_counter', $this->tables ) ) { $this->addTable( 'hit_counter', 'hit_counter' );