From 08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 12 Aug 2013 09:28:15 +0200 Subject: Update to MediaWiki 1.21.1 --- includes/externalstore/ExternalStoreMedium.php | 60 ++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 includes/externalstore/ExternalStoreMedium.php (limited to 'includes/externalstore/ExternalStoreMedium.php') diff --git a/includes/externalstore/ExternalStoreMedium.php b/includes/externalstore/ExternalStoreMedium.php new file mode 100644 index 00000000..41af7d87 --- /dev/null +++ b/includes/externalstore/ExternalStoreMedium.php @@ -0,0 +1,60 @@ +params = $params; + } + + /** + * Fetch data from given external store URL + * + * @param string $url An external store URL + * @return string|bool The text stored or false on error + * @throws MWException + */ + abstract public function fetchFromURL( $url ); + + /** + * Insert a data item into a given location + * + * @param string $location the location name + * @param string $data the data item + * @return string|bool The URL of the stored data item, or false on error + * @throws MWException + */ + abstract public function store( $location, $data ); +} -- cgit v1.2.2 From 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 8 Dec 2013 09:55:49 +0100 Subject: Update to MediaWiki 1.22.0 --- includes/externalstore/ExternalStoreMedium.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'includes/externalstore/ExternalStoreMedium.php') diff --git a/includes/externalstore/ExternalStoreMedium.php b/includes/externalstore/ExternalStoreMedium.php index 41af7d87..02bdcb51 100644 --- a/includes/externalstore/ExternalStoreMedium.php +++ b/includes/externalstore/ExternalStoreMedium.php @@ -48,6 +48,25 @@ abstract class ExternalStoreMedium { */ abstract public function fetchFromURL( $url ); + /** + * Fetch data from given external store URLs. + * + * @param array $urls A list of external store URLs + * @return array Map from the url to the text stored. Unfound data is not represented + */ + public function batchFetchFromURLs( array $urls ) { + $retval = array(); + foreach ( $urls as $url ) { + $data = $this->fetchFromURL( $url ); + // Dont return when false to allow for simpler implementations. + // errored urls are handled in ExternalStore::batchFetchFromURLs + if ( $data !== false ) { + $retval[$urls] = $data; + } + } + return $retval; + } + /** * Insert a data item into a given location * -- cgit v1.2.2