Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 22
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
SpecialApiSandbox
0.00% covered (danger)
0.00%
0 / 21
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 execute
0.00% covered (danger)
0.00%
0 / 19
0.00% covered (danger)
0.00%
0 / 1
2
 getGroupName
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3 * Implements Special:ApiSandbox
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
19 *
20 * @file
21 * @ingroup SpecialPage
22 */
23
24namespace MediaWiki\Specials;
25
26use MediaWiki\SpecialPage\SpecialPage;
27
28/**
29 * @ingroup SpecialPage
30 * @since 1.27
31 */
32class SpecialApiSandbox extends SpecialPage {
33
34    public function __construct() {
35        parent::__construct( 'ApiSandbox' );
36    }
37
38    public function execute( $par ) {
39        $this->setHeaders();
40        $out = $this->getOutput();
41        $this->addHelpLink( 'Help:ApiSandbox' );
42
43        $out->addJsConfigVars(
44            'apihighlimits',
45            $this->getAuthority()->isAllowed( 'apihighlimits' )
46        );
47        $out->addModuleStyles( [
48            'mediawiki.special',
49            'mediawiki.hlist',
50        ] );
51        $out->addModules( [
52            'mediawiki.special.apisandbox',
53            'mediawiki.apipretty',
54        ] );
55        $out->wrapWikiMsg(
56            "<div id='mw-apisandbox'><div class='mw-apisandbox-nojs error'>\n$1\n</div></div>",
57            'apisandbox-jsonly'
58        );
59    }
60
61    protected function getGroupName() {
62        return 'wiki';
63    }
64}
65
66/** @deprecated class alias since 1.41 */
67class_alias( SpecialApiSandbox::class, 'SpecialApiSandbox' );