Yuml classdiagram not work anymore
<classdiagram> [Utilisateur]+1->*[Commande] [Commande]++1-items >*[Liste des éléments] [Commande]-0..1>[Méthode de Paiement] </classdiagram>NO WORK
<usecase> [User]-(Login) [User]-(Logout) (Login)<(Reminder) (Login)>(Captcha) </usecase>
WORK
PHP source code for Mediawiki : https://wiki.visionduweb.fr/index.php?title=Code_PHP_pour_Mediawiki_yUML
<?php // Author: Sindri Traustason http://sindri.info //Avoid unstubbing $wgParser on setHook() too early on modern (1.12+) MW versions, as per r35980 if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) { $wgHooks['ParserFirstCallInit'][] = 'efYUMLInit'; } else { // Otherwise do things the old fashioned way $wgExtensionFunctions[] = 'efYUMLInit'; } function efYUMLInit() { global $wgParser; $wgParser->setHook( 'classdiagram', 'efClassdiagramRender' ); $wgParser->setHook( 'usecase', 'efUsecaseRender' ); return true; } function yUMLRenderDiagram( $input, $args, $diagramType ) { $type = ""; if(!empty($args["type"])){ $type = "/".$args["type"]; } $scale = ""; if(!empty($args["scale"])){ $scale=";scale:".$args["scale"]; } $yumldir = ""; if(!empty($args["dir"])){ $yumldir=";dir:".$args["dir"]; } $uml_code = preg_replace( array("/\n/", "/,,/"), array(", ", "," ), trim($input)); // L'adresse de l'image est affichée avec https:// $output = "<img src=\"https://yUML.me/diagram".$type.$scale.$yumldir."/".$diagramType."/"; return $output.htmlspecialchars( $uml_code )."\"/>"; } function efClassdiagramRender( $input, $args, $parser ) { return yUMLRenderDiagram( $input, $args, "class" ); } function efUsecaseRender( $input, $args, $parser ) { return yUMLRenderDiagram( $input, $args, "usecase" ); } ?>
Last version for PHP Source :
Dernière modification proposée par Zer00CooL : https://github.com/ZerooCool/yuml-mediawiki/blob/master/yUML/yUML.php
<classdiagram> [Utilisateur]+1->*[Commande] [Commande]++1-items >*[Liste des éléments] [Commande]-0..1>[Méthode de Paiement] </classdiagram>
I test my syntaxe, and change the syntaxe for this new syntaxe :
<classdiagram> [Utilisateur]1 Commandes *>[Commande] [Commande]1 *>[Produits] [Commande]1 *>[Méthode de Paiement] [Méthode de Paiement]1 1>[Paiement] </classdiagram>
NO WORK WITH <classdiagram>
<classdiagram type="scruffy" scale="125"> [Utilisateur]+1->*[Commande] [Commande]++1-items >*[Liste des éléments] [Commande]-0..1>[Méthode de Paiement] </classdiagram>