]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - extensions/LocalisationUpdate/fetcher/Fetcher.php
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / extensions / LocalisationUpdate / fetcher / Fetcher.php
diff --git a/extensions/LocalisationUpdate/fetcher/Fetcher.php b/extensions/LocalisationUpdate/fetcher/Fetcher.php
new file mode 100644 (file)
index 0000000..9ff7958
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * @file
+ * @author Niklas Laxström
+ * @license GPL-2.0+
+ */
+
+namespace LocalisationUpdate;
+
+/**
+ * Interface for classes which fetch files over different protocols and ways.
+ */
+interface Fetcher {
+       /**
+        * Fetches a single resource.
+        *
+        * @return bool|string False on failure.
+        */
+       public function fetchFile( $url );
+
+       /**
+        * Fetch a list of resources. This has the benefit of being able to pick up
+        * new languages as they appear if languages are stored in separate files.
+        *
+        * @return array
+        */
+       public function fetchDirectory( $pattern );
+}