diff --git "a/include/class-web\\MediaWikis.php" "b/include/class-web\\MediaWikis.php" index 5f1d997..532fa05 100644 --- "a/include/class-web\\MediaWikis.php" +++ "b/include/class-web\\MediaWikis.php" @@ -1,86 +1,90 @@ . # 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\WikipediaEn ::class, + \wm\WikipediaEs ::class, + \wm\WikipediaFr ::class, + \wm\WikipediaDe ::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-wm\\WikipediaDe.php" "b/include/class-wm\\WikipediaDe.php" new file mode 100644 index 0000000..1ced60d --- /dev/null +++ "b/include/class-wm\\WikipediaDe.php" @@ -0,0 +1,38 @@ +. + +# Wikimedia +namespace wm; + +/** + * English Wikipedia singleton class + * + * @see https://de.wikipedia.org/ + */ +class WikipediaDe extends \mw\StaticSite { + + /** + * @override + */ + const UID = 'dewiki'; + + /** + * @override + */ + const API_URL = 'https://de.wikipedia.org/w/api.php'; + +} diff --git "a/include/class-wm\\WikipediaEn.php" "b/include/class-wm\\WikipediaEn.php" new file mode 100644 index 0000000..d28a403 --- /dev/null +++ "b/include/class-wm\\WikipediaEn.php" @@ -0,0 +1,38 @@ +. + +# Wikimedia +namespace wm; + +/** + * English Wikipedia singleton class + * + * @see https://en.wikipedia.org/ + */ +class WikipediaEn extends \mw\StaticSite { + + /** + * @override + */ + const UID = 'enwiki'; + + /** + * @override + */ + const API_URL = 'https://en.wikipedia.org/w/api.php'; + +} diff --git "a/include/class-wm\\WikipediaEs.php" "b/include/class-wm\\WikipediaEs.php" new file mode 100644 index 0000000..a327f48 --- /dev/null +++ "b/include/class-wm\\WikipediaEs.php" @@ -0,0 +1,38 @@ +. + +# Wikimedia +namespace wm; + +/** + * English Wikipedia singleton class + * + * @see https://es.wikipedia.org/ + */ +class WikipediaEs extends \mw\StaticSite { + + /** + * @override + */ + const UID = 'eswiki'; + + /** + * @override + */ + const API_URL = 'https://es.wikipedia.org/w/api.php'; + +} diff --git "a/include/class-wm\\WikipediaFr.php" "b/include/class-wm\\WikipediaFr.php" new file mode 100644 index 0000000..64e5ad9 --- /dev/null +++ "b/include/class-wm\\WikipediaFr.php" @@ -0,0 +1,38 @@ +. + +# Wikimedia +namespace wm; + +/** + * English Wikipedia singleton class + * + * @see https://fr.wikipedia.org/ + */ +class WikipediaFr extends \mw\StaticSite { + + /** + * @override + */ + const UID = 'frwiki'; + + /** + * @override + */ + const API_URL = 'https://fr.wikipedia.org/w/api.php'; + +}