Wilkins has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/370632 )
Change subject: Patch for the previous commit in review ...................................................................... Patch for the previous commit in review Handling Kghbln comments - https urls - removing shim - compatibiliy with MediaWiki 1.23+ - some cleanup - merging INSTALL into README Change-Id: I120000e27d9f1ce001934382cae0c34659d32ec1 --- D INSTALL M README.md D SemanticGenealogy.i18n.php M SemanticGenealogy.php 4 files changed, 108 insertions(+), 93 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticGenealogy refs/changes/32/370632/1 diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 459c84a..0000000 --- a/INSTALL +++ /dev/null @@ -1,20 +0,0 @@ - -== Requirements == - -Semantic Genealogy requires: -* MediaWiki 1.19 or above -* Semantic MediaWiki 1.17 or above -* PHP 5.3 or above - - -== Installation == - -Installation instructions are available online in a more convenient form for -reading at https://www.mediawiki.org/wiki/Extension:SemanticGenalogy - -Copy all files into MediaWiki's extensions folder, either by using Git or by -extracting an installation package. You need to enter one line to your local -settings (somewhere after the inclusion of Semantic MediaWiki): - -// Semantic Genealogy -require_once( "$IP/extensions/SemanticGenealogy/SemanticGenealogy.php" ); diff --git a/README.md b/README.md index 619f185..8c61cb1 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,95 @@ Semantic Genealogy ================== -THIS EXTENSION IS CURRENTLY IN DEVELOPMENT AND IS NOT DONE TO BE USED IN A PRODUCTION ENVIRONMENT. BREAKING CHANGES CAN BE INTRODUCED ! +Features +-------- -### Features -* Special page to generate a FamilyTree +* Special page to generate a FamilyTree : `Special:FamilyTree` * Include FamilyTree inside pages with a wiki code * Several Trees: Ancestors Tree, Descendants Tree, Relation Link Tree, Descendants list * Several Styles: Simple, Boxes * GEDCOM file format export -### Authors -* Thomas Pellissier Tanon <thoma...@hotmail.fr> (Maintainer) +Requirements +------------ + +Semantic Genealogy requires: +* MediaWiki 1.23 or above +* Semantic MediaWiki 1.7 or above +* PHP 5.4 or above -### Links +Installation +------------ + +#### Installation from source + +Installation instructions are available online in a more convenient form for +reading at https://www.mediawiki.org/wiki/Extension:Semantic_Genealogy + +Copy all files into MediaWiki's extensions folder, either by using Git or by +extracting an installation package. You need to enter one line to your local +settings (somewhere after the inclusion of Semantic MediaWiki): + + +#### Installation from composer + +Not yet. + + +Configuration +------------- + +```php +// Semantic Genealogy +require_once "$IP/extensions/SemanticGenealogy/SemanticGenealogy.php"; + +// Insert the $wgGenealogicalProperties array to specify which Semantic properties match which concept. +// The properties can differ if you used personnal nouns that fit your language. + +// Here is an example of a french configuration +$wgGenealogicalProperties = array( + 'givenname' => 'Prenom', + 'surname' => 'Nom', + 'nickname' => 'Surnom', + 'sex' => 'Sexe', + 'birthdate' => 'Datenaissance', + 'birthplace' => 'Lieunaissance', + 'deathdate' => 'Datedeces', + 'deathplace' => 'Lieudeces', + 'father' => 'Pere', + 'mother' => 'Mere', + 'partner' => 'Conjoint' +); + +// Here is an example of an english configuration +$wgGenealogicalProperties = array( + 'givenname' => 'Firstname', + 'surname' => 'Lastname', + 'nickname' => 'Nickname', + 'sex' => 'Sex', + 'birthdate' => 'date of birth', + 'birthplace' => 'place of birth', + 'deathdate' => 'date of death', + 'deathplace' => 'place of death', + 'father' => 'Father', + 'mother' => 'Mother', + 'partner' => 'Conjoint' +); + +``` + + +Authors +------- + +* Thomas Pellissier Tanon <thoma...@hotmail.fr> (Author, Maintainer) +* Thibault Taillandier <thiba...@taillandier.name> (Developer) + + +Links +----- + * Official extension page : https://www.mediawiki.org/wiki/Extension:Semantic_Genealogy diff --git a/SemanticGenealogy.i18n.php b/SemanticGenealogy.i18n.php deleted file mode 100644 index d127f33..0000000 --- a/SemanticGenealogy.i18n.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -/** - * This is a backwards-compatibility shim, generated by: - * https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php - * - * Beginning with MediaWiki 1.23, translation strings are stored in json files, - * and the EXTENSION.i18n.php file only exists to provide compatibility with - * older releases of MediaWiki. For more information about this migration, see: - * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format - * - * This shim maintains compatibility back to MediaWiki 1.17. - */ -$messages = []; -if ( !function_exists( 'wfJsonI18nShimc57238e8287ad032' ) ) { - /** - * I have no idea what this does - * - * @param string $cache the cache - * @param string $code the code - * @param array &$cachedData the cachedData - * - * @return true - */ - function wfJsonI18nShimc57238e8287ad032( $cache, $code, &$cachedData ) { - $codeSequence = array_merge( [ $code ], $cachedData['fallbackSequence'] ); - foreach ( $codeSequence as $csCode ) { - $fileName = __DIR__ . "/i18n/$csCode.json"; - if ( is_readable( $fileName ) ) { - $data = FormatJson::decode( file_get_contents( $fileName ), true ); - foreach ( array_keys( $data ) as $key ) { - if ( $key === '' || $key[0] === '@' ) { - unset( $data[$key] ); - } - } - $cachedData['messages'] = array_merge( $data, $cachedData['messages'] ); - } - - $cachedData['deps'][] = new FileDependency( $fileName ); - } - return true; - } - - $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShimc57238e8287ad032'; -} diff --git a/SemanticGenealogy.php b/SemanticGenealogy.php index 9ac2559..0cb8cc8 100644 --- a/SemanticGenealogy.php +++ b/SemanticGenealogy.php @@ -2,7 +2,7 @@ /** * Initialization file for the Semantic Genealogy extension. * - * On MediaWiki.org: http://www.mediawiki.org/wiki/Extension:Semantic_Genealogy + * On MediaWiki.org: https://www.mediawiki.org/wiki/Extension:Semantic_Genealogy * * @file SemanticGenealogy.php * @ingroup SemanticGenealogy @@ -24,16 +24,16 @@ die( 'Not an entry point.' ); } -if ( version_compare( $wgVersion, '1.19', '<' ) ) { - die( '<b>Error:</b> This version of Semantic Genealogy requires MediaWiki 1.19 or above.' ); +if ( version_compare( $wgVersion, '1.23', '<' ) ) { + die( '<b>Error:</b> This version of Semantic Genealogy requires MediaWiki 1.23 or above.' ); } // Show a warning if Semantic MediaWiki is not loaded. if ( ! defined( 'SMW_VERSION' ) ) { die( '<b>Error:</b> You need to have ' - .'<a href="http://semantic-mediawiki.org/wiki/Semantic_MediaWiki">Semantic MediaWiki</a> ' + .'<a href="https://semantic-mediawiki.org/wiki/Semantic_MediaWiki">Semantic MediaWiki</a> ' .'installed in order to use ' - .'<a href="http://www.mediawiki.org/wiki/Extension:Semantic Maps">Semantic Maps</a>.<br />' + .'<a href="https://www.mediawiki.org/wiki/Extension:Semantic Maps">Semantic Maps</a>.<br />' ); } @@ -52,10 +52,13 @@ 'name' => 'Semantic Genealogy', 'version' => SGENEA_VERSION, 'author' => [ - '[http://www.mediawiki.org/wiki/User:Tpt Tpt]' + '[https://www.mediawiki.org/wiki/User:Tpt Tpt]', + '[https://www.mediawiki.org/wiki/User:Thibault_Taillandier Thibault Taillandier]', + '...' ], 'url' => 'https://www.mediawiki.org/wiki/Extension:Semantic_Genealogy', - 'descriptionmsg' => 'semanticgenealogy-desc' + 'descriptionmsg' => 'semanticgenealogy-desc', + 'license-name' => 'GPL-2.0+' ]; $wgGenealogicalProperties = [ @@ -68,19 +71,18 @@ 'deathdate' => 'Date de décès', 'deathplace' => 'Lieu de décès', 'father' => 'Père', - 'mother' => 'Mère' + 'mother' => 'Mère', + 'partner' => 'Conjoint' ]; -$dir = __DIR__ . '/'; -$dirTree = $dir.'src/Tree/'; -$dirDecorator = $dir.'src/Decorator/'; +$dirTree = __DIR__ . '/src/Tree/'; +$dirDecorator = __DIR__ . '/src/Decorator/'; $wgMessagesDirs['SemanticGenealogy'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles['SemanticGenealogy'] = $dir . 'SemanticGenealogy.i18n.php'; -$wgExtensionMessagesFiles['SemanticGenealogyAlias'] = $dir . 'SemanticGenealogy.alias.php'; +$wgExtensionMessagesFiles['SemanticGenealogyAlias'] = __DIR__ . '/SemanticGenealogy.alias.php'; -$wgAutoloadClasses['SemanticGenealogy'] = $dir . 'SemanticGenealogy.body.php'; -$wgAutoloadClasses['PersonPageValues'] = $dir . 'PersonPageValues.php'; +$wgAutoloadClasses['SemanticGenealogy'] = __DIR__ . '/SemanticGenealogy.body.php'; +$wgAutoloadClasses['PersonPageValues'] = __DIR__ . '/PersonPageValues.php'; $wgAutoloadClasses['FamilyTree'] = $dirTree . 'FamilyTree.php'; $wgAutoloadClasses['AncestorsFamilyTree'] = $dirTree . 'AncestorsFamilyTree.php'; $wgAutoloadClasses['DescendantFamilyTree'] = $dirTree . 'DescendantFamilyTree.php'; @@ -90,21 +92,21 @@ $wgAutoloadClasses['TreeDecorator'] = $dirDecorator . 'TreeDecorator.php'; $wgAutoloadClasses['SimpleDecorator'] = $dirDecorator . 'SimpleDecorator.php'; $wgAutoloadClasses['BoxDecorator'] = $dirDecorator . 'BoxDecorator.php'; -$wgAutoloadClasses['Tools'] = $dir . 'Tools.php'; +$wgAutoloadClasses['Tools'] = __DIR__ . '/Tools.php'; -$wgAutoloadClasses['SemanticGenealogyException'] = $dir . 'SemanticGenealogyException.php'; +$wgAutoloadClasses['SemanticGenealogyException'] = __DIR__ . '/SemanticGenealogyException.php'; -$wgAutoloadClasses['GenealogicalFilePrinter'] = $dir . 'GenealogicalFilePrinter.php'; -$wgAutoloadClasses['Gedcom5FilePrinter'] = $dir . 'Gedcom5FilePrinter.php'; -$wgAutoloadClasses['Gedcom5ResultPrinter'] = $dir . 'Gedcom5ResultPrinter.php'; +$wgAutoloadClasses['GenealogicalFilePrinter'] = __DIR__ . '/GenealogicalFilePrinter.php'; +$wgAutoloadClasses['Gedcom5FilePrinter'] = __DIR__ . '/Gedcom5FilePrinter.php'; +$wgAutoloadClasses['Gedcom5ResultPrinter'] = __DIR__ . '/Gedcom5ResultPrinter.php'; $smwgResultFormats['gedcom'] = 'Gedcom5ResultPrinter'; $smwgResultFormats['gedcom5'] = 'Gedcom5ResultPrinter'; -$wgAutoloadClasses['SpecialFamilyTree'] = $dir . 'SpecialFamilyTree.php'; +$wgAutoloadClasses['SpecialFamilyTree'] = __DIR__ . '/SpecialFamilyTree.php'; $wgSpecialPages['FamilyTree'] = 'SpecialFamilyTree'; $moduleTemplate = [ - 'localBasePath' => $dir, + 'localBasePath' => __DIR__, 'remoteBasePath' => ( $wgExtensionAssetsPath === false ? $wgScriptPath . '/extensions' : $wgExtensionAssetsPath ) . '/SemanticGenealogy', 'group' => 'ext.smg' @@ -113,7 +115,9 @@ $wgResourceModules['ext.smg.specialfamilytree'] = $moduleTemplate + [ 'scripts' => 'modules/specialFamilyTree.js', 'styles' => 'modules/styles.css', - 'dependencies' => [ 'jquery.ui.autocomplete' ], + 'dependencies' => [ + 'jquery.ui.autocomplete' + ], 'messages' => [ ] ]; -- To view, visit https://gerrit.wikimedia.org/r/370632 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I120000e27d9f1ce001934382cae0c34659d32ec1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticGenealogy Gerrit-Branch: master Gerrit-Owner: Wilkins <thiba...@taillandier.name> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits