diff --git "a/include/class-web\\MediaWikis.php" "b/include/class-web\\MediaWikis.php" index 03d0d66..5f1d997 100644 --- "a/include/class-web\\MediaWikis.php" +++ "b/include/class-web\\MediaWikis.php" @@ -1,83 +1,86 @@ . # websites in the Internet namespace web; /** * All the MediaWiki instances in the Internet :^) */ abstract class MediaWikis { /** * Get all the registered MediaWiki classes * + * TODO: Smarter way. + * * @return array */ protected static function allClasses() { return [ \wm\WikipediaIt ::class, \wm\Wikidata ::class, \wm\Commons ::class, \wm\MetaWiki ::class, + \web\WikimediaCH ::class, \web\LandscapeforWiki::class, ]; } /** * Get all the registered MediaWiki instances * * @generator */ public static function all() { foreach( self::allClasses() as $classname ) { yield $classname::instance(); } } /** * Get a specific MediaWiki instance from its UID * * @param $uid string * @return mw\StaticSite|false */ public static function findFromUID( $uid ) { foreach( self::all() as $one ) { if( $one::UID === $uid ) { return $one; } } return false; } /** * Get all the registered MediaWiki UIDs ordered alphabetically * * @return array */ public static function allUIDs() { $all = []; foreach( self::all() as $wiki ) { $all[] = $wiki::UID; } sort( $all ); return $all; } } diff --git "a/include/class-web\\WikimediaCH.php" "b/include/class-web\\WikimediaCH.php" new file mode 100644 index 0000000..34f8ae0 --- /dev/null +++ "b/include/class-web\\WikimediaCH.php" @@ -0,0 +1,38 @@ +. + +# Internet +namespace web; + +/** + * Wikimedia CH members wiki + * + * @see https://meta.wikimedia.org/ + */ +class WikimediaCH extends \mw\StaticSite { + + /** + * @override + */ + const UID = 'wmch'; + + /** + * @override + */ + const API_URL = 'https://members.wikimedia.ch/api.php'; + +}