diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 905da19..f632a29 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,22 +15,7 @@ jobs: strategy: matrix: - include: - - mediawiki_version: '1.35' - smw_version: '4.2.0' - approved_revs_version: 1.8.2 - php_version: 7.4 - database_type: mysql - database_image: "mysql:5.7" - coverage: true - experimental: false - - mediawiki_version: '1.35' - smw_version: '4.2.0' - approved_revs_version: 1.8.2 - php_version: 7.4 - database_type: sqlite - coverage: false - experimental: false + include: - mediawiki_version: '1.39' smw_version: '4.2.0' approved_revs_version: 2.1 @@ -56,7 +41,7 @@ jobs: coverage: false experimental: false - mediawiki_version: '1.42' - smw_version: '4.2.0' + smw_version: dev-master approved_revs_version: master php_version: 8.2 database_type: mysql @@ -75,6 +60,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Update submodules + run: git submodule update --init --remote - name: Run tests run: make ci diff --git a/Makefile b/Makefile index 2267c8c..9f7b8df 100644 --- a/Makefile +++ b/Makefile @@ -4,20 +4,20 @@ export # setup for docker-compose-ci build directory # delete "build" directory to update docker-compose-ci -ifeq (,$(wildcard ./build/Makefile)) +ifeq (,$(wildcard ./build/)) $(shell git submodule update --init --remote) endif EXTENSION=SemanticExtraSpecialProperties # docker images -MW_VERSION?=1.35 -PHP_VERSION?=7.4 -DB_TYPE?=sqlite -DB_IMAGE?="" +MW_VERSION?=1.39 +PHP_VERSION?=8.1 +DB_TYPE?=mysql +DB_IMAGE?="mariadb:10" # extensions -SMW_VERSION=4.2.0 +SMW_VERSION?=4.2.0 # composer # Enables "composer update" inside of extension @@ -28,4 +28,4 @@ COMPOSER_EXT?=true # NODE_JS?=true # check for build dir and git submodule init if it does not exist -include build/Makefile \ No newline at end of file +include build/Makefile diff --git a/extension.json b/extension.json index da0c2f8..e2a41fb 100644 --- a/extension.json +++ b/extension.json @@ -13,7 +13,7 @@ "license-name": "GPL-2.0-or-later", "type": "semantic", "requires": { - "MediaWiki": ">= 1.35", + "MediaWiki": ">= 1.39", "extensions": { "SemanticMediaWiki": "*" } diff --git a/src/AppFactory.php b/src/AppFactory.php index 165ef39..fd9d701 100644 --- a/src/AppFactory.php +++ b/src/AppFactory.php @@ -168,13 +168,8 @@ public function newWikiPage( Title $title ) { ); } - // Pre 1.36 $services = MediaWikiServices::getInstance(); - if ( !method_exists( $services, 'getWikiPageFactory' ) ) { - return WikiPage::factory( $title ); - } else { - return $services->getWikiPageFactory()->newFromTitle( $title ); - } + return $services->getWikiPageFactory()->newFromTitle( $title ); } /** diff --git a/src/PropertyAnnotators/UserEditCountPerNsPropertyAnnotator.php b/src/PropertyAnnotators/UserEditCountPerNsPropertyAnnotator.php index 607e2f1..3127afc 100755 --- a/src/PropertyAnnotators/UserEditCountPerNsPropertyAnnotator.php +++ b/src/PropertyAnnotators/UserEditCountPerNsPropertyAnnotator.php @@ -117,25 +117,10 @@ private function getEditsPerNs( $id, $ip ): array { $db = $this->appFactory->getConnection(); $queryTables = [ 'revision', 'actor', 'page' ]; - if ( version_compare( MW_VERSION, '1.39', '>=' ) ) { - $joinConditions = [ - 'page' => [ 'INNER JOIN', [ 'page_id=rev_page' ] ], - 'actor' => [ 'INNER JOIN', [ 'actor_id=rev_actor' ] ] - ]; - } else { - $queryTables[] = 'revision_actor_temp'; - $joinConditions = [ - 'page' => [ 'INNER JOIN', [ - 'page_id=rev_page' - ] ], - 'revision_actor_temp' => [ 'INNER JOIN', [ - 'revactor_rev=rev_id' - ] ], - 'actor' => [ 'INNER JOIN', [ - 'actor_id=revactor_actor' - ] ] - ]; - } + $joinConditions = [ + 'page' => [ 'INNER JOIN', [ 'page_id=rev_page' ] ], + 'actor' => [ 'INNER JOIN', [ 'actor_id=rev_actor' ] ] + ]; $result = $db->select( // FROM.