Skip to content

Commit

Permalink
Add CI for MW 1.41/42/43 (#81)
Browse files Browse the repository at this point in the history
* Add CI for MW 1.41/42/43

* Update composer.json

* Update HookRegistry.php

* Update ci.yml

* Update composer.json
  • Loading branch information
paladox authored Feb 10, 2025
1 parent 7077c21 commit 345ba69
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 14 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,28 @@ jobs:
database_image: "mariadb:11.2"
coverage: true
experimental: false
- mediawiki_version: '1.41'
smw_version: dev-master
php_version: 8.1
database_type: mysql
database_image: "mariadb:11.2"
coverage: false
experimental: false
- mediawiki_version: '1.42'
smw_version: dev-master
php_version: 8.1
database_type: mysql
database_image: "mariadb:11.2"
coverage: false
experimental: false
- mediawiki_version: '1.43'
smw_version: dev-master
php_version: 8.1
database_type: mysql
database_image: "mariadb:11.2"
coverage: false
experimental: false

env:
MW_VERSION: ${{ matrix.mediawiki_version }}
SMW_VERSION: ${{ matrix.smw_version }}
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"require": {
"php": ">=7.1",
"composer/installers":"^1.0.12",
"mediawiki/semantic-media-wiki": "^3.1|^3.2|^4.0",
"mediawiki/lingo": "3.1.1"
},
"require-dev": {
Expand Down Expand Up @@ -75,7 +74,7 @@
"fix": [
"@phpcs-fix"
],
"phpunit": "php ${MW_INSTALL_PATH:-../..}/tests/phpunit/phpunit.php -c phpunit.xml.dist",
"phpunit": "php ${MW_INSTALL_PATH:-../..}/tests/phpunit/phpunit.php -c phpunit.xml.dist --bootstrap tests/bootstrap.php",
"phpunit-coverage": "php ${MW_INSTALL_PATH:-../..}/tests/phpunit/phpunit.php -c phpunit.xml.dist --testdox --coverage-text --coverage-html coverage/php --coverage-clover coverage/php/coverage.xml",
"post-test-coverage": [
"sed -i 's|/var/www/html/extensions/SemanticResultFormats/||g' coverage/php/coverage.xml",
Expand Down
18 changes: 6 additions & 12 deletions src/HookRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SG;

use Hooks;
use MediaWiki\MediaWikiServices;
use MediaWiki\Linker\LinkTarget;
use SMW\DIWikiPage;

Expand Down Expand Up @@ -34,7 +34,7 @@ public function __construct() {
* @return bool
*/
public function isRegistered( $name ) {
return Hooks::isRegistered( $name );
return MediaWikiServices::getInstance()->getHookContainer()->isRegistered( $name );
}

/**
Expand All @@ -53,7 +53,7 @@ public function getHandlerFor( $name ) {
*/
public function register() {
foreach ( $this->handlers as $name => $callback ) {
Hooks::register( $name, $callback );
MediaWikiServices::getInstance()->getHookContainer()->register( $name, $callback );
}
}

Expand Down Expand Up @@ -92,15 +92,9 @@ private function addCallbackHandlers() {
*
* @since 1.0
*/
if ( version_compare( MW_VERSION, "1.35.0", "<" ) ) {
$this->handlers['TitleMoveComplete'] = static function ( &$old_title ) {
return \SG\Cache\CacheInvalidator::getInstance()->invalidateCacheOnPageMove( $old_title );
};
} else {
$this->handlers['PageMoveComplete'] = static function ( LinkTarget $old_title ) {
return \SG\Cache\CacheInvalidator::getInstance()->invalidateCacheOnPageMove( $old_title );
};
}
$this->handlers['PageMoveComplete'] = static function ( LinkTarget $old_title ) {
return \SG\Cache\CacheInvalidator::getInstance()->invalidateCacheOnPageMove( $old_title );
};
}

}

0 comments on commit 345ba69

Please sign in to comment.