Skip to content
This repository was archived by the owner on Oct 10, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: smw
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['https://www.semantic-mediawiki.org/wiki/Sponsorship']
92 changes: 92 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:

jobs:

test:

runs-on: ubuntu-22.04
continue-on-error: ${{ matrix.experimental }}

strategy:
matrix:
include:
# SMW 6.0.1 has a bug where #ask returns empty results in the prepareContentForEdit
# context used by JSONScript parser-type tests. Upgraded to dev-master as workaround;
# pin to 7.x once released. See: https://github.com/SemanticMediaWiki/SemanticResultFormats/pull/1020
- mediawiki_version: '1.43'
smw_version: dev-master
pf_version: 6.0.5
php_version: 8.1
database_type: mysql
database_image: "mariadb:11.2"
coverage: false
experimental: false
- mediawiki_version: '1.43'
smw_version: dev-master
pf_version: 6.0.5
php_version: 8.3
database_type: mysql
database_image: "mariadb:11.2"
coverage: true
experimental: false
- mediawiki_version: '1.44'
smw_version: dev-master
pf_version: 6.0.5
php_version: 8.2
database_type: mysql
database_image: "mariadb:11.2"
coverage: false
experimental: false
- mediawiki_version: '1.45'
smw_version: dev-master
pf_version: 6.0.5
php_version: 8.3
database_type: mysql
database_image: "mariadb:11.2"
coverage: false
experimental: false

env:
MW_VERSION: ${{ matrix.mediawiki_version }}
SMW_VERSION: ${{ matrix.smw_version }}
PF_VERSION: ${{ matrix.pf_version }}
PHP_VERSION: ${{ matrix.php_version }}
DB_TYPE: ${{ matrix.database_type }}
DB_IMAGE: ${{ matrix.database_image }}
MM_VERSION: ${{ matrix.mm_version }}


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
if: matrix.coverage == false

- name: Run tests with coverage
run: make ci-coverage
if: matrix.coverage == true

- name: Run Phan static analysis
run: make install composer-phan
if: matrix.coverage == true

- name: Upload code coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/php/coverage.xml
if: matrix.coverage == true
20 changes: 19 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
.svn
!.*
*~
*.kate-swp
.*.swp

.idea/

.envrc
.phpunit.result.cache

composer.lock
composer.phar

npm-debug.log

vendor/
extensions/
node_modules/
conf/
.DS_Store
.env
coverage
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "build"]
path = build
url = https://github.com/gesinn-it-pub/docker-compose-ci.git
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
-include .env
export

# setup for docker-compose-ci build directory
# delete "build" directory to update docker-compose-ci

ifeq (,$(wildcard ./build/))
$(shell git submodule update --init --remote)
endif

EXTENSION=SemanticSignup

# docker images
MW_VERSION?=1.43
PF_VERSION ?= 6.0.5
PHP_VERSION?=8.1
DB_TYPE?=mysql
DB_IMAGE?="mariadb:11.2"

# extensions
SMW_VERSION?=dev-master

# composer
# Enables "composer update" inside of extension
COMPOSER_EXT?=true

# nodejs
# Enables node.js related tests and "npm install"
# NODE_JS?=true

# check for build dir and git submodule init if it does not exist
include build/Makefile
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Semantic Signup

[![Build Status](https://secure.travis-ci.org/SemanticMediaWiki/SemanticSignup.svg?branch=master)](http://travis-ci.org/SemanticMediaWiki/SemanticSignup)
[![Code Coverage](https://scrutinizer-ci.com/g/SemanticMediaWiki/SemanticSignup/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/SemanticMediaWiki/SemanticSignup/?branch=master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/SemanticMediaWiki/SemanticSignup/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/SemanticMediaWiki/SemanticSignup/?branch=master)
[![CI](https://github.com/SemanticMediaWiki/SemanticSignup/actions/workflows/ci.yml/badge.svg)](https://github.com/SemanticMediaWiki/SemanticSignup/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/SemanticMediaWiki/SemanticSignup/graph/badge.svg)](https://codecov.io/gh/SemanticMediaWiki/SemanticSignup)
[![Latest Stable Version](https://poser.pugx.org/mediawiki/semantic-signup/version.png)](https://packagist.org/packages/mediawiki/semantic-signup)
[![Packagist download count](https://poser.pugx.org/mediawiki/semantic-signup/d/total.png)](https://packagist.org/packages/mediawiki/semantic-signup)


Semantic Signup (a.k.a. SES) is a [Semantic Mediawiki][smw] extension that uses
Semantic Forms to improve the user registration process.

## Requirements

- PHP 5.3.2 or later
- MediaWiki 1.19 or later
- [Semantic MediaWiki][smw] 1.9+
- [Semantic Forms][sf] 2.8+
- PHP 8.1 or later
- MediaWiki 1.43 or later
- [Semantic MediaWiki][smw] 6.0+
- [Page Forms][pf] 6.0.5+

## Installation

Expand Down Expand Up @@ -68,6 +68,6 @@ but can also be executed using `composer phpunit` from the extension base direct

[gpl-licence]: https://www.gnu.org/copyleft/gpl.html
[smw]: https://github.com/SemanticMediaWiki/SemanticMediaWiki
[sf]: https://www.mediawiki.org/wiki/Extension:Semantic_Forms
[travis]: https://travis-ci.org/SemanticMediaWiki/SemanticSignup
[pf]: https://www.mediawiki.org/wiki/Extension:Page_Forms
[ci]: https://github.com/SemanticMediaWiki/SemanticSignup/actions
[composer]: https://getcomposer.org/
68 changes: 19 additions & 49 deletions SemanticSignup.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,61 +10,31 @@
* @author Jeroen De Dauw <jeroendedauw@gmail.com>
*
* @defgroup SES SemanticSignup
*/
if ( !defined( 'MEDIAWIKI' ) ) {
die( 'This file is part of the SemanticSignup extension, it is not a valid entry point.' );
}

if ( version_compare( $GLOBALS[ 'wgVersion' ], '1.19', 'lt' ) ) {
die( '<b>Error:</b> This version of <a href="https://github.com/SemanticMediaWiki/SemanticSignup/">SemanticSignup</a> is only compatible with MediaWiki 1.19 or above. You need to upgrade MediaWiki first.' );
}

if ( !defined( 'SF_VERSION' ) || version_compare( SF_VERSION, '2.8', 'lt' ) ) {
die( '<b>Error:</b> This version of <a href="https://github.com/SemanticMediaWiki/SemanticSignup/">SemanticSignup</a> is only compatible with Semantic Forms 2.8 or above. You need to upgrade <a href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms">Semantic Forms</a> first.' );
}

if ( defined( 'SES_VERSION' ) ) {
// Do not initialize more than once.
return 1;
}

define( 'SES_VERSION', '1.1-alpha' );

/**
* @codeCoverageIgnore
*/
call_user_func( function () {

// Register extension info
$GLOBALS['wgExtensionCredits']['semantic'][] = array(
'path' => __DIR__,
'name' => 'Semantic Signup',
'version' => SES_VERSION,
'author' => array(
'Serg Kutny',
'[https://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]',
'...'
),
'url' => 'https://www.mediawiki.org/wiki/Extension:SemanticSignup',
'descriptionmsg' => 'ses-desc',
'license-name' => 'GPL-3.0-or-later'
);

$GLOBALS['wgMessagesDirs']['semantic-signup'] = __DIR__ . '/i18n';
class SemanticSignup {

$GLOBALS['wgExtensionMessagesFiles']['semantic-signup'] = __DIR__ . '/i18n/SemanticSignup.i18n.php';
$GLOBALS['wgExtensionMessagesFiles']['semantic-signup-magic'] = __DIR__ . '/i18n/SemanticSignup.i18n.magic.php';
$GLOBALS['wgExtensionMessagesFiles']['semantic-signup-alias'] = __DIR__ . '/i18n/SemanticSignup.i18n.aliases.php';
public static function initExtension( $credits = [] ) {
// See https://phabricator.wikimedia.org/T151136
define( 'SES_VERSION', isset( $credits['version'] ) ? $credits['version'] : 'UNKNOWN' );
}

$GLOBALS['wgSpecialPages']['SemanticSignup'] = '\SES\SpecialSemanticSignup';
public static function onExtensionFunction() {
if ( !defined( 'SMW_VERSION' ) ) {

$GLOBALS['egSemanticSignupSettings'] = array();

// Finalize extension setup
$GLOBALS['wgExtensionFunctions'][] = function() {
if ( PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg' ) {
die( "\nThe 'Semantic Signup' extension requires 'Semantic MediaWiki' to be installed and enabled.\n" );
} else {
die(
'<b>Error:</b> The <a href="https://github.com/SemanticMediaWiki/SemanticSignup/">Semantic Signup</a> ' .
'extension requires <a href="https://www.semantic-mediawiki.org/wiki/Semantic_MediaWiki">Semantic MediaWiki</a> to be ' .
'installed and enabled.<br />'
);
}
}

$hookRegistry = new HookRegistry();
$hookRegistry->register( $GLOBALS['wgHooks'] );
};

} );
}
}
1 change: 1 addition & 0 deletions build
Submodule build added at 31d1f9
2 changes: 2 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fixes:
- "/var/www/html/extensions/SemanticSignup/::"
43 changes: 32 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
"source": "https://github.com/SemanticMediaWiki/SemanticSignup"
},
"require": {
"php": ">=5.3.0",
"composer/installers": "1.*,>=1.0.1",
"mediawiki/semantic-media-wiki": "~1.9|~2.0",
"mediawiki/semantic-forms": "~2.8|~3.0"
"php": ">=8.1",
"composer/installers": ">=1.0.1"
},
"require-dev": {
"mediawiki/semantic-media-wiki": "@dev"
"mediawiki/minus-x": "1.1.3",
"php-parallel-lint/php-console-highlighter": "1.0.0",
"php-parallel-lint/php-parallel-lint": "1.4.0"
},
"extra": {
"branch-alias": {
Expand All @@ -39,15 +39,36 @@
"autoload": {
"files" : [
"SemanticSignup.php"
],
"psr-4": {
"SES\\": "src/"
}
]
},
"config": {
"process-timeout": 0
"process-timeout": 0,
"allow-plugins": {
"composer/installers": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"scripts":{
"phpunit": "php ../../tests/phpunit/phpunit.php -c phpunit.xml.dist"
"test": [
"@analyze",
"@phpunit"
],
"test-coverage": [
"@analyze",
"@phpunit-coverage"
],
"analyze": [
"@lint",
"@minus-x"
],
"phpunit": "php ${MW_INSTALL_PATH:-../..}/tests/phpunit/phpunit.php -c phpunit.xml.dist",
"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/SemanticSignup/||g' coverage/php/coverage.xml",
"find coverage/php -type f -name '*.html' -exec sed -i 's|/var/www/html/extensions/||g' {} +"
],
"integration": "composer phpunit -- --testsuite=semantic-result-formats-integration",
"lint": "parallel-lint . --exclude vendor --exclude node_modules --exclude extensions",
"minus-x": "minus-x check ."
}
}
Loading
Loading