MediaWiki REL1_30
ExternalStoreMedium.php
Go to the documentation of this file.
1<?php
30abstract class ExternalStoreMedium {
32 protected $params = [];
33
37 public function __construct( array $params = [] ) {
38 $this->params = $params;
39 }
40
48 abstract public function fetchFromURL( $url );
49
56 public function batchFetchFromURLs( array $urls ) {
57 $retval = [];
58 foreach ( $urls as $url ) {
59 $data = $this->fetchFromURL( $url );
60 // Dont return when false to allow for simpler implementations.
61 // errored urls are handled in ExternalStore::batchFetchFromURLs
62 if ( $data !== false ) {
63 $retval[$url] = $data;
64 }
65 }
66
67 return $retval;
68 }
69
78 abstract public function store( $location, $data );
79}
Accessable external objects in a particular storage medium.
fetchFromURL( $url)
Fetch data from given external store URL.
store( $location, $data)
Insert a data item into a given location.
__construct(array $params=[])
batchFetchFromURLs(array $urls)
Fetch data from given external store URLs.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account incomplete not yet checked for validity & $retval
Definition hooks.txt:266