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