Skip to content
Merged
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
46 changes: 0 additions & 46 deletions DefaultSettings.php

This file was deleted.

1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This file contains the RELEASE-NOTES of the **Semantic Meta Tags** (a.k.a. SMT)
* Semantic MediaWiki to version 7.0 and later
* MediaWiki to version 1.43 and later
* Updated to Semantic MediaWiki 7.0's namespaced data-item classes
* Moved the extension registration and settings defaults into `extension.json` (the `$smtg…` configuration variable names are unchanged)
* The major version jumps from 4.x to 7.0 to track the Semantic MediaWiki release it supports

### 4.1.1
Expand Down
93 changes: 0 additions & 93 deletions SemanticMetaTags.php

This file was deleted.

34 changes: 29 additions & 5 deletions extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,43 @@
"i18n"
]
},
"callback": "SemanticMetaTags::initExtension",
"ExtensionFunctions": [
"SemanticMetaTags::onExtensionFunction"
"SMT\\Setup::onExtensionFunction"
],
"AutoloadClasses": {
"SemanticMetaTags": "SemanticMetaTags.php"
},
"AutoloadNamespaces": {
"SMT\\": "src/"
},
"TestAutoloadNamespaces": {
"SMT\\Tests\\": "tests/phpunit/"
},
"config_prefix": "smtg",
"config": {
"TagsProperties": {
"value": [],
"description": "An array of tags that assigns related properties such as `'keywords' => [ 'Has keywords', ... ]`."
},
"TagsStrings": {
"value": [],
"description": "Describes static content for an assigned `<meta>` tag such as `'some:tag' => 'Content that is static'`."
},
"TagsBlacklist": {
"value": [
"generator",
"robots"
],
"description": "Listed tags are generally assumed to be reserved or excluded for free use."
},
"TagsPropertyFallbackUsage": {
"value": false,
"description": "In case it is set `true` then the first property that returns a valid content for an assigned tag will be used exclusively."
},
"MetaPropertyPrefixes": {
"value": [
"og:"
],
"description": "Identifies prefixes that require `meta:property:...`."
}
},
"load_composer_autoloader": true,
"manifest_version": 2
}
35 changes: 35 additions & 0 deletions src/Setup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace SMT;

use SMW\Services\ServicesFactory as ApplicationFactory;

/**
* @license GPL-2.0-or-later
* @since 7.0
*
* @author mwjames
*/
class Setup {

/**
* @since 7.0
*/
public static function onExtensionFunction() {
$configuration = [
'metaTagsContentPropertySelector' => $GLOBALS['smtgTagsProperties'],
'metaTagsStaticContentDescriptor' => $GLOBALS['smtgTagsStrings'],
'metaTagsBlacklist' => $GLOBALS['smtgTagsBlacklist'],
'metaTagsFallbackUseForMultipleProperties' => $GLOBALS['smtgTagsPropertyFallbackUsage'],
'metaTagsMetaPropertyPrefixes' => $GLOBALS['smtgMetaPropertyPrefixes']
];

$hookRegistry = new HookRegistry(
ApplicationFactory::getInstance()->getStore(),
new Options( $configuration )
);

$hookRegistry->register();
}

}
8 changes: 3 additions & 5 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@
die( "\nThe Semantic MediaWiki test autoloader is not available" );
}

if ( !defined( 'SMT_VERSION' ) ) {
die( "\nSemantic Meta Tags is not available, please check your Composer or LocalSettings.php.\n" );
}

$width = 20;

if ( !defined( 'SMW_PHPUNIT_FIRST_COLUMN_WIDTH' ) ) {
define( 'SMW_PHPUNIT_FIRST_COLUMN_WIDTH', $width );
}

print sprintf( "\n%-{$width}s%s\n", "Semantic Meta Tags: ", SMT_VERSION );
$extensionInfo = json_decode( file_get_contents( __DIR__ . '/../extension.json' ), true );

print sprintf( "\n%-{$width}s%s\n", "Semantic Meta Tags: ", $extensionInfo['version'] ?? 'UNKNOWN' );

$autoLoader = require SMW_PHPUNIT_AUTOLOADER_FILE;
$autoloader->addPsr4( 'SMT\\Tests\\', __DIR__ . '/phpunit/Unit' );
Expand Down
4 changes: 4 additions & 0 deletions tests/phpunit/Integration/I18nJsonFileIntegrityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public function i18nFileProvider() {
$provider = [];
$location = $GLOBALS['wgMessagesDirs']['SemanticMetaTags'];

if ( is_array( $location ) ) {
$location = $location[0];
}

$bulkFileProvider = UtilityFactory::getInstance()->newBulkFileProvider( $location );
$bulkFileProvider->searchByFileExtension( 'json' );

Expand Down