Debian Codegraph @

thumb_handler.php

raw symbols SCIP
1 <?php
2 /**
3 * The web entry point to be used as 404 handler behind a web server rewrite
4 * rule for media thumbnails, internally handled via thumb.php.
5 *
6 * This script will interpret a request URL like
7 * `/w/images/thumb/a/a9/Example.jpg/50px-Example.jpg` and treat it as
8 * if it was a request to thumb.php with the relevant query parameters filled
9 * out. See also $wgGenerateThumbnailOnParse.
10 *
11 * @see thumb.php
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 * http://www.gnu.org/copyleft/gpl.html
27 *
28 * @file
29 * @ingroup entrypoint
30 * @ingroup Media
31 */
32
33 use MediaWiki\Context\RequestContext;
34 use MediaWiki\EntryPointEnvironment;
35 use MediaWiki\FileRepo\Thumbnail404EntryPoint;
36 use MediaWiki\MediaWikiServices;
37
38 define( 'MW_NO_OUTPUT_COMPRESSION', 1 );
39 define( 'MW_ENTRY_POINT', 'thumb_handler' );
40
41 require __DIR__ . '/includes/WebStart.php';
42
43 ( new Thumbnail404EntryPoint(
44 RequestContext::getMain(),
45 new EntryPointEnvironment(),
46 MediaWikiServices::getInstance()
47 ) )->run();