Merge "Special:Upload should not crash on failing previews"
[mediawiki.git] / includes / interwiki / InterwikiLookup.php
blobd0a7719bbec8b84d9cb154d884f29096a65e1133
1 <?php
2 namespace MediaWiki\Interwiki;
4 /**
5 * Service interface for looking up Interwiki records.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * http://www.gnu.org/copyleft/gpl.html
22 * @file
24 use Interwiki;
26 /**
27 * Service interface for looking up Interwiki records.
29 * @since 1.28
31 interface InterwikiLookup {
33 /**
34 * Check whether an interwiki prefix exists
36 * @param string $prefix Interwiki prefix to use
37 * @return bool Whether it exists
39 public function isValidInterwiki( $prefix );
41 /**
42 * Fetch an Interwiki object
44 * @param string $prefix Interwiki prefix to use
45 * @return Interwiki|null|bool
47 public function fetch( $prefix );
49 /**
50 * Returns all interwiki prefixes
52 * @param string|null $local If set, limits output to local/non-local interwikis
53 * @return string[] List of prefixes
55 public function getAllPrefixes( $local = null );
57 /**
58 * Purge the in-process and persistent object cache for an interwiki prefix
59 * @param string $prefix
61 public function invalidateCache( $prefix );