2 namespace MediaWiki\Interwiki
;
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
27 * Service interface for looking up Interwiki records.
31 interface InterwikiLookup
{
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 );
42 * Fetch an Interwiki object
44 * @param string $prefix Interwiki prefix to use
45 * @return Interwiki|null|bool
47 public function fetch( $prefix );
50 * Returns information about all interwiki prefixes, in the form of rows
51 * of the interwiki table. Each row may have the following keys:
53 * - iw_prefix: the prefix. Always present.
54 * - iw_url: the URL to use for linking, with $1 as a placeholder for the target page.
56 * - iw_api: the URL of the API. Optional.
57 * - iw_wikiid: the wiki ID (usually the database name for local wikis). Optional.
58 * - iw_local: whether the wiki is local, and the "magic redirect" mechanism should apply.
60 * - iw_trans: whether "scary transclusion" is allowed for this site.
63 * @param string|null $local If set, limits output to local/non-local interwikis
64 * @return array[] interwiki rows.
66 public function getAllPrefixes( $local = null );
69 * Purge the in-process and persistent object cache for an interwiki prefix
70 * @param string $prefix
72 public function invalidateCache( $prefix );